	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function saveCursorPosition
_saveCursorPosition:                    ## @saveCursorPosition
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_CURSOR_VALID@GOTPCREL(%rip), %r14
	movq	(%rdi), %rax
	cmpq	%rax, (%r14)
	sete	%cl
	movq	_CURSOR_SKIPNEXT@GOTPCREL(%rip), %r15
	cmpq	%rax, (%r15)
	sete	%al
	orb	%cl, %al
	movzbl	%al, %edi
	callq	_assert
	xorl	%edi, %edi
	cmpq	$0, 8(%rbx)
	sete	%dil
	callq	_assert
	movq	%rbx, %rdi
	callq	_cursorHoldsMutex
	movl	%eax, %edi
	callq	_assert
	movq	(%rbx), %rax
	cmpq	(%r15), %rax
	jne	LBB0_2
## %bb.1:
	movq	(%r14), %rax
	movq	%rax, (%rbx)
	jmp	LBB0_3
LBB0_2:
	movq	$0, 24(%rbx)
LBB0_3:
	movq	%rbx, %rdi
	callq	_saveCursorKey
	movl	%eax, %r14d
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_btreeReleaseAllCursorPages
	movq	_CURSOR_REQUIRESEEK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
LBB0_5:
	movq	_BTCF_ValidNKey@GOTPCREL(%rip), %rax
	movq	_BTCF_ValidOvfl@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_BTCF_AtLast@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	notl	%ecx
	andl	%ecx, 16(%rbx)
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CURSOR_VALID,8,3               ## @CURSOR_VALID
	.comm	_CURSOR_SKIPNEXT,8,3            ## @CURSOR_SKIPNEXT
	.comm	_SQLITE_OK,4,2                  ## @SQLITE_OK
	.comm	_CURSOR_REQUIRESEEK,8,3         ## @CURSOR_REQUIRESEEK
	.comm	_BTCF_ValidNKey,4,2             ## @BTCF_ValidNKey
	.comm	_BTCF_ValidOvfl,4,2             ## @BTCF_ValidOvfl
	.comm	_BTCF_AtLast,4,2                ## @BTCF_AtLast
	.no_dead_strip	_saveCursorPosition
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function saveCursorPosition
_saveCursorPosition:                    ; @saveCursorPosition
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x20, _CURSOR_VALID@GOTPAGE
Lloh1:
	ldr	x20, [x20, _CURSOR_VALID@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	x9, [x0]
	cmp	x8, x9
Lloh2:
	adrp	x21, _CURSOR_SKIPNEXT@GOTPAGE
Lloh3:
	ldr	x21, [x21, _CURSOR_SKIPNEXT@GOTPAGEOFF]
	ldr	x8, [x21]
	ccmp	x8, x9, #4, ne
	cset	w0, eq
	bl	_assert
	ldr	x8, [x19, #8]
	cmp	x8, #0
	cset	w0, eq
	bl	_assert
	mov	x0, x19
	bl	_cursorHoldsMutex
	bl	_assert
	ldr	x8, [x19]
	ldr	x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x20]
	str	x8, [x19]
	b	LBB0_3
LBB0_2:
	str	xzr, [x19, #24]
LBB0_3:
	mov	x0, x19
	bl	_saveCursorKey
	mov	x20, x0
Lloh4:
	adrp	x8, _SQLITE_OK@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SQLITE_OK@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_btreeReleaseAllCursorPages
Lloh7:
	adrp	x8, _CURSOR_REQUIRESEEK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CURSOR_REQUIRESEEK@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	str	x8, [x19]
LBB0_5:
Lloh10:
	adrp	x8, _BTCF_ValidNKey@GOTPAGE
Lloh11:
	ldr	x8, [x8, _BTCF_ValidNKey@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _BTCF_ValidOvfl@GOTPAGE
Lloh14:
	ldr	x9, [x9, _BTCF_ValidOvfl@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh16:
	adrp	x9, _BTCF_AtLast@GOTPAGE
Lloh17:
	ldr	x9, [x9, _BTCF_AtLast@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x19, #16]
	bic	w8, w9, w8
	str	w8, [x19, #16]
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_CURSOR_VALID,8,3               ; @CURSOR_VALID
	.comm	_CURSOR_SKIPNEXT,8,3            ; @CURSOR_SKIPNEXT
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.comm	_CURSOR_REQUIRESEEK,8,3         ; @CURSOR_REQUIRESEEK
	.comm	_BTCF_ValidNKey,4,2             ; @BTCF_ValidNKey
	.comm	_BTCF_ValidOvfl,4,2             ; @BTCF_ValidOvfl
	.comm	_BTCF_AtLast,4,2                ; @BTCF_AtLast
	.no_dead_strip	_saveCursorPosition
.subsections_via_symbols
