	.file	"extr_btree.c_saveCursorPosition.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	saveCursorPosition, @function
saveCursorPosition:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	rax, QWORD PTR [rdi]
	cmp	rax, QWORD PTR CURSOR_VALID[rip]
	mov	edi, 1
	je	.L2
	xor	edi, edi
	cmp	QWORD PTR CURSOR_SKIPNEXT[rip], rax
	sete	dil
.L2:
	call	assert@PLT
	xor	edi, edi
	cmp	QWORD PTR 8[rbx], 0
	sete	dil
	call	assert@PLT
	mov	rdi, rbx
	call	cursorHoldsMutex@PLT
	mov	edi, eax
	call	assert@PLT
	mov	rax, QWORD PTR CURSOR_SKIPNEXT[rip]
	cmp	QWORD PTR [rbx], rax
	je	.L10
	mov	QWORD PTR 24[rbx], 0
.L4:
	mov	rdi, rbx
	call	saveCursorKey@PLT
	cmp	DWORD PTR SQLITE_OK[rip], eax
	mov	r12d, eax
	je	.L11
.L5:
	mov	eax, DWORD PTR BTCF_ValidNKey[rip]
	or	eax, DWORD PTR BTCF_ValidOvfl[rip]
	or	eax, DWORD PTR BTCF_AtLast[rip]
	not	eax
	and	DWORD PTR 16[rbx], eax
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	mov	rax, QWORD PTR CURSOR_VALID[rip]
	mov	QWORD PTR [rbx], rax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rdi, rbx
	call	btreeReleaseAllCursorPages@PLT
	mov	rax, QWORD PTR CURSOR_REQUIRESEEK[rip]
	mov	QWORD PTR [rbx], rax
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	saveCursorPosition, .-saveCursorPosition
	.comm	SQLITE_OK,4,4
	.comm	CURSOR_VALID,8,8
	.comm	CURSOR_SKIPNEXT,8,8
	.comm	CURSOR_REQUIRESEEK,8,8
	.comm	BTCF_ValidOvfl,4,4
	.comm	BTCF_ValidNKey,4,4
	.comm	BTCF_AtLast,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_btree.c_saveCursorPosition.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	saveCursorPosition, %function
saveCursorPosition:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r6, .L10
	ldr	r3, [r0]
	ldr	r2, [r6]
	mov	r4, r0
	cmp	r3, r2
	ldrne	r5, .L10+4
	moveq	r0, #1
	ldrne	r0, [r5]
	ldreq	r5, .L10+4
	subne	r0, r0, r3
	clzne	r0, r0
	lsrne	r0, r0, #5
	bl	assert
	ldr	r0, [r4, #4]
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	mov	r0, r4
	bl	cursorHoldsMutex
	bl	assert
	ldr	r3, [r5]
	ldr	r2, [r4]
	mov	r0, r4
	cmp	r2, r3
	movne	r3, #0
	ldreq	r3, [r6]
	strne	r3, [r4, #12]
	streq	r3, [r4]
	bl	saveCursorKey
	ldr	r3, .L10+8
	mov	r5, r0
	ldr	r3, [r3]
	cmp	r3, r0
	beq	.L9
.L5:
	ldr	r3, .L10+12
	ldr	r2, .L10+16
	ldr	r1, .L10+20
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r1, [r1]
	orr	r3, r3, r2
	ldr	r2, [r4, #8]
	orr	r3, r3, r1
	bic	r3, r2, r3
	mov	r0, r5
	str	r3, [r4, #8]
	pop	{r4, r5, r6, pc}
.L9:
	mov	r0, r4
	bl	btreeReleaseAllCursorPages
	ldr	r3, .L10+24
	ldr	r3, [r3]
	str	r3, [r4]
	b	.L5
.L11:
	.align	2
.L10:
	.word	CURSOR_VALID
	.word	CURSOR_SKIPNEXT
	.word	SQLITE_OK
	.word	BTCF_ValidNKey
	.word	BTCF_ValidOvfl
	.word	BTCF_AtLast
	.word	CURSOR_REQUIRESEEK
	.size	saveCursorPosition, .-saveCursorPosition
	.comm	SQLITE_OK,4,4
	.comm	CURSOR_VALID,4,4
	.comm	CURSOR_SKIPNEXT,4,4
	.comm	CURSOR_REQUIRESEEK,4,4
	.comm	BTCF_ValidOvfl,4,4
	.comm	BTCF_ValidNKey,4,4
	.comm	BTCF_AtLast,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
