	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function saveCursorKey
_saveCursorKey:                         ## @saveCursorKey
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_SQLITE_OK@GOTPCREL(%rip), %r12
	movl	(%r12), %r14d
	movq	_CURSOR_VALID@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	xorl	%edi, %edi
	cmpq	(%rbx), %rax
	sete	%dil
	callq	_assert
	xorl	%edi, %edi
	cmpq	$0, 8(%rbx)
	sete	%dil
	callq	_assert
	movq	%rbx, %rdi
	callq	_cursorHoldsMutex
	movl	%eax, %edi
	callq	_assert
	cmpq	$0, 24(%rbx)
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_sqlite3BtreeIntegerKey
	movl	%eax, 16(%rbx)
LBB0_7:
	cmpq	$0, 24(%rbx)
	je	LBB0_8
## %bb.9:
	xorl	%edi, %edi
	cmpq	$0, 8(%rbx)
	sete	%dil
	jmp	LBB0_10
LBB0_2:
	movq	%rbx, %rdi
	callq	_sqlite3BtreePayloadSize
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, 16(%rbx)
	leal	17(%rax), %edi
	callq	_sqlite3Malloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	%rax, %r15
	movl	16(%rbx), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movq	%rax, %rcx
	callq	_sqlite3BtreePayload
	movl	%eax, %r14d
	cmpl	(%r12), %eax
	jne	LBB0_5
## %bb.4:
	movslq	16(%rbx), %rax
	leaq	(%r15,%rax,4), %rdi
	xorl	%esi, %esi
	movl	$17, %edx
	callq	_memset
	movq	%r15, 8(%rbx)
	jmp	LBB0_7
LBB0_8:
	movl	$1, %edi
LBB0_10:
	callq	_assert
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_SQLITE_NOMEM_BKPT@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_7
LBB0_5:
	movq	%r15, %rdi
	callq	_sqlite3_free
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_SQLITE_OK,4,2                  ## @SQLITE_OK
	.comm	_CURSOR_VALID,8,3               ## @CURSOR_VALID
	.comm	_SQLITE_NOMEM_BKPT,4,2          ## @SQLITE_NOMEM_BKPT
	.no_dead_strip	_saveCursorKey
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function saveCursorKey
_saveCursorKey:                         ; @saveCursorKey
	.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	x22, _SQLITE_OK@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SQLITE_OK@GOTPAGEOFF]
	ldr	w20, [x22]
Lloh2:
	adrp	x8, _CURSOR_VALID@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CURSOR_VALID@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	ldr	x9, [x0]
	cmp	x8, x9
	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, #24]
	cbz	x8, LBB0_4
; %bb.1:
	mov	x0, x19
	bl	_sqlite3BtreeIntegerKey
	str	w0, [x19, #16]
LBB0_2:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_7
; %bb.3:
	ldr	x8, [x19, #8]
	cmp	x8, #0
	cset	w0, eq
	b	LBB0_8
LBB0_4:
	mov	x0, x19
	bl	_sqlite3BtreePayloadSize
	str	w0, [x19, #16]
	add	w0, w0, #17
	bl	_sqlite3Malloc
	cbz	x0, LBB0_9
; %bb.5:
	mov	x21, x0
	ldr	w2, [x19, #16]
	mov	x0, x19
	mov	w1, #0
	mov	x3, x21
	bl	_sqlite3BtreePayload
	mov	x20, x0
	ldr	w8, [x22]
	cmp	w0, w8
	b.ne	LBB0_10
; %bb.6:
	ldrsw	x8, [x19, #16]
	add	x0, x21, x8, lsl #2
	mov	w1, #0
	mov	w2, #17
	bl	_memset
	str	x21, [x19, #8]
	b	LBB0_2
LBB0_7:
	mov	w0, #1
LBB0_8:
	bl	_assert
	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
LBB0_9:
Lloh5:
	adrp	x8, _SQLITE_NOMEM_BKPT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SQLITE_NOMEM_BKPT@GOTPAGEOFF]
Lloh7:
	ldr	w20, [x8]
	b	LBB0_2
LBB0_10:
	mov	x0, x21
	bl	_sqlite3_free
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.comm	_CURSOR_VALID,8,3               ; @CURSOR_VALID
	.comm	_SQLITE_NOMEM_BKPT,4,2          ; @SQLITE_NOMEM_BKPT
	.no_dead_strip	_saveCursorKey
.subsections_via_symbols
