	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function btreeRestoreCursorPosition
_btreeRestoreCursorPosition:            ## @btreeRestoreCursorPosition
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	$0, -36(%rbp)
	callq	_cursorOwnsBtShared
	movl	%eax, %edi
	callq	_assert
	movq	(%rbx), %rax
	movq	_CURSOR_REQUIRESEEK@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setge	%dil
	callq	_assert
	movq	(%rbx), %rax
	movq	_CURSOR_FAULT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movl	8(%rbx), %r14d
	jmp	LBB0_11
LBB0_2:
	movq	_CURSOR_INVALID@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	%rax, (%rbx)
	movl	$410, %edi                      ## imm = 0x19A
	callq	_sqlite3FaultSim
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_SQLITE_IOERR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_5
LBB0_4:
	movq	16(%rbx), %rsi
	movl	24(%rbx), %edx
	leaq	-36(%rbp), %r8
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_btreeMoveto
	movl	%eax, %r14d
LBB0_5:
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_11
## %bb.6:
	movq	16(%rbx), %rdi
	callq	_sqlite3_free
	movq	$0, 16(%rbx)
	movq	(%rbx), %rax
	movq	_CURSOR_VALID@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	sete	%cl
	cmpq	(%r15), %rax
	sete	%al
	orb	%cl, %al
	movzbl	%al, %edi
	callq	_assert
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, 8(%rbx)
	jmp	LBB0_9
LBB0_8:
	cmpl	$0, 8(%rbx)
	je	LBB0_11
LBB0_9:
	movq	(%rbx), %rax
	cmpq	(%r12), %rax
	jne	LBB0_11
## %bb.10:
	movq	_CURSOR_SKIPNEXT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
LBB0_11:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CURSOR_REQUIRESEEK,8,3         ## @CURSOR_REQUIRESEEK
	.comm	_CURSOR_FAULT,8,3               ## @CURSOR_FAULT
	.comm	_CURSOR_INVALID,8,3             ## @CURSOR_INVALID
	.comm	_SQLITE_IOERR,4,2               ## @SQLITE_IOERR
	.comm	_SQLITE_OK,4,2                  ## @SQLITE_OK
	.comm	_CURSOR_VALID,8,3               ## @CURSOR_VALID
	.comm	_CURSOR_SKIPNEXT,8,3            ## @CURSOR_SKIPNEXT
	.no_dead_strip	_btreeRestoreCursorPosition
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function btreeRestoreCursorPosition
_btreeRestoreCursorPosition:            ; @btreeRestoreCursorPosition
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
	str	wzr, [sp, #12]
	bl	_cursorOwnsBtShared
	bl	_assert
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _CURSOR_REQUIRESEEK@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CURSOR_REQUIRESEEK@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, ge
	bl	_assert
	ldr	x8, [x19]
Lloh3:
	adrp	x9, _CURSOR_FAULT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CURSOR_FAULT@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	w20, [x19, #8]
	b	LBB0_11
LBB0_2:
Lloh6:
	adrp	x21, _CURSOR_INVALID@GOTPAGE
Lloh7:
	ldr	x21, [x21, _CURSOR_INVALID@GOTPAGEOFF]
	ldr	x8, [x21]
	str	x8, [x19]
	mov	w0, #410
	bl	_sqlite3FaultSim
	cbz	x0, LBB0_4
; %bb.3:
Lloh8:
	adrp	x8, _SQLITE_IOERR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SQLITE_IOERR@GOTPAGEOFF]
Lloh10:
	ldr	w20, [x8]
	b	LBB0_5
LBB0_4:
	ldr	x1, [x19, #16]
	ldr	w2, [x19, #24]
	add	x4, sp, #12
	mov	x0, x19
	mov	w3, #0
	bl	_btreeMoveto
	mov	x20, x0
LBB0_5:
Lloh11:
	adrp	x8, _SQLITE_OK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SQLITE_OK@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w20, w8
	b.ne	LBB0_11
; %bb.6:
	ldr	x0, [x19, #16]
	bl	_sqlite3_free
	str	xzr, [x19, #16]
Lloh14:
	adrp	x22, _CURSOR_VALID@GOTPAGE
Lloh15:
	ldr	x22, [x22, _CURSOR_VALID@GOTPAGEOFF]
	ldr	x8, [x19]
	ldr	x9, [x22]
	cmp	x8, x9
	ldr	x9, [x21]
	ccmp	x8, x9, #4, ne
	cset	w0, eq
	bl	_assert
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_8
; %bb.7:
	str	w8, [x19, #8]
	b	LBB0_9
LBB0_8:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_11
LBB0_9:
	ldr	x8, [x19]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.10:
Lloh16:
	adrp	x8, _CURSOR_SKIPNEXT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CURSOR_SKIPNEXT@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	str	x8, [x19]
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_CURSOR_REQUIRESEEK,8,3         ; @CURSOR_REQUIRESEEK
	.comm	_CURSOR_FAULT,8,3               ; @CURSOR_FAULT
	.comm	_CURSOR_INVALID,8,3             ; @CURSOR_INVALID
	.comm	_SQLITE_IOERR,4,2               ; @SQLITE_IOERR
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.comm	_CURSOR_VALID,8,3               ; @CURSOR_VALID
	.comm	_CURSOR_SKIPNEXT,8,3            ; @CURSOR_SKIPNEXT
	.no_dead_strip	_btreeRestoreCursorPosition
.subsections_via_symbols
