	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function defragmentPage
_defragmentPage:                        ## @defragmentPage
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	32(%rdi), %edi
	callq	_sqlite3PagerIswriteable
	movl	%eax, %edi
	callq	_assert
	xorl	%edi, %edi
	cmpq	$0, 40(%rbx)
	setne	%dil
	callq	_assert
	movq	40(%rbx), %rax
	movl	(%rax), %eax
	movq	_SQLITE_MAX_PAGE_SIZE@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpl	(%rcx), %eax
	setle	%dil
	callq	_assert
	xorl	%edi, %edi
	cmpq	$0, (%rbx)
	sete	%dil
	callq	_assert
	movq	40(%rbx), %rax
	movl	8(%rax), %edi
	callq	_sqlite3_mutex_held
	movl	%eax, %edi
	callq	_assert
	movq	40(%rbx), %rax
	movl	4(%rax), %edi
	callq	_sqlite3PagerTempSpace
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	8(%rbx), %r15
	movslq	16(%rbx), %r12
	movslq	20(%rbx), %r13
	movslq	24(%rbx), %r14
	leaq	(%r12,%r15), %rdi
	addq	$3, %rdi
	callq	_get2byte
	xorl	%edi, %edi
	cmpl	%eax, %r14d
	sete	%dil
	callq	_assert
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	40(%rbx), %rax
	movl	(%rax), %ebx
	movq	%r12, -104(%rbp)                ## 8-byte Spill
	leaq	(%r12,%r15), %rdi
	addq	$5, %rdi
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	callq	_get2byte
	cltq
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax), %rdi
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	leaq	(%r15,%rax), %rsi
	movl	%ebx, %edx
	subl	%eax, %edx
	callq	_memcpy
	leaq	(,%r14,2), %rax
	addq	%r13, %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testl	%r14d, %r14d
	jle	LBB0_7
## %bb.1:
	movl	%r14d, %eax
	leal	-4(%rbx), %ecx
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	addq	-48(%rbp), %r13                 ## 8-byte Folded Reload
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movl	%ebx, %ecx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ecx, %r12d
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	movq	%r13, %rdi
	callq	_get2byte
	movl	%eax, %r14d
	xorl	%edi, %edi
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	cmpl	%r15d, %eax
	sete	%dil
	callq	_testcase
	xorl	%edi, %edi
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	cmpl	%ebx, %r14d
	sete	%dil
	callq	_testcase
	cmpl	%r15d, %r14d
	jl	LBB0_14
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%ebx, %r14d
	jg	LBB0_14
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, -112(%rbp)                ## 8-byte Spill
	movl	$1, %edi
	callq	_assert
	movslq	%r14d, %r15
	addq	-80(%rbp), %r15                 ## 8-byte Folded Reload
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_cellSizePtr
	movl	%r12d, %ecx
	subl	%eax, %r12d
	cmpl	-56(%rbp), %r12d                ## 4-byte Folded Reload
	jl	LBB0_14
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %r13d
	addl	%eax, %r14d
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	cmpl	%eax, %r14d
	jg	LBB0_14
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edi, %edi
	xorl	%ebx, %ebx
	cmpl	%eax, %ecx
	setle	%dil
	sete	%bl
	callq	_assert
	movl	%ebx, %edi
	callq	_testcase
	xorl	%edi, %edi
	cmpl	-88(%rbp), %r14d                ## 4-byte Folded Reload
	sete	%dil
	callq	_testcase
	movslq	%r12d, %rdi
	addq	-48(%rbp), %rdi                 ## 8-byte Folded Reload
	movq	%r15, %rsi
	movl	%r13d, %edx
	callq	_memcpy
	movq	-112(%rbp), %r13                ## 8-byte Reload
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_put2byte
	addq	$2, %r13
	movl	%r12d, %ecx
	movq	-120(%rbp), %rax                ## 8-byte Reload
	decq	%rax
	jne	LBB0_2
	jmp	LBB0_8
LBB0_7:
	movl	%ebx, %r12d
LBB0_8:
	xorl	%edi, %edi
	movl	%r12d, %r14d
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	subl	%ebx, %r14d
	setge	%dil
	callq	_assert
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %esi
	callq	_put2byte
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movw	$0, 1(%rax,%rcx)
	movb	$0, 7(%rax,%rcx)
	addq	%rcx, %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	%r14d, %edx
	callq	_memset
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movl	32(%rbx), %edi
	callq	_sqlite3PagerIswriteable
	movl	%eax, %edi
	callq	_assert
	cmpl	28(%rbx), %r14d
	jne	LBB0_14
## %bb.9:
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_14:
	movq	_SQLITE_CORRUPT_BKPT@GOTPCREL(%rip), %rax
LBB0_15:
	movl	(%rax), %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SQLITE_MAX_PAGE_SIZE,4,2       ## @SQLITE_MAX_PAGE_SIZE
	.comm	_SQLITE_CORRUPT_BKPT,4,2        ## @SQLITE_CORRUPT_BKPT
	.comm	_SQLITE_OK,4,2                  ## @SQLITE_OK
	.no_dead_strip	_defragmentPage
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function defragmentPage
_defragmentPage:                        ; @defragmentPage
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldr	w0, [x0, #32]
	bl	_sqlite3PagerIswriteable
	bl	_assert
	ldr	x8, [x19, #40]
	cmp	x8, #0
	cset	w0, ne
	bl	_assert
	ldr	x8, [x19, #40]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _SQLITE_MAX_PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SQLITE_MAX_PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w0, le
	bl	_assert
	ldr	x8, [x19]
	cmp	x8, #0
	cset	w0, eq
	bl	_assert
	ldr	x8, [x19, #40]
	ldr	w0, [x8, #8]
	bl	_sqlite3_mutex_held
	bl	_assert
	ldr	x8, [x19, #40]
	ldr	w0, [x8, #4]
	bl	_sqlite3PagerTempSpace
	mov	x23, x0
	ldr	x27, [x19, #8]
	ldpsw	x8, x21, [x19, #16]
	ldrsw	x20, [x19, #24]
	add	x22, x8, x27
	add	x0, x22, #3
	bl	_get2byte
	cmp	w20, w0
	cset	w0, eq
	bl	_assert
	str	x19, [sp, #48]                  ; 8-byte Folded Spill
	ldr	x8, [x19, #40]
	ldr	w19, [x8]
	add	x0, x22, #5
	stp	x0, x22, [sp, #8]               ; 16-byte Folded Spill
	bl	_get2byte
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x9, w0
	str	x23, [sp, #40]                  ; 8-byte Folded Spill
	add	x8, x23, x9
	add	x1, x27, x9
	sub	w2, w19, w0
	mov	x0, x8
	bl	_memcpy
	add	x28, x21, x20, lsl #1
	cmp	w20, #1
	b.lt	LBB0_7
; %bb.1:
	and	x24, x20, #0xffffffff
	sub	w20, w19, #4
	add	x22, x27, x21
Lloh3:
	adrp	x8, _SQLITE_CORRUPT_BKPT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SQLITE_CORRUPT_BKPT@GOTPAGEOFF]
	str	x8, [sp, #24]                   ; 8-byte Folded Spill
	str	w19, [sp, #36]                  ; 4-byte Folded Spill
	mov	x21, x19
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_get2byte
	mov	x25, x0
	cmp	w0, w28
	cset	w0, eq
	bl	_testcase
	cmp	w25, w20
	cset	w0, eq
	bl	_testcase
	cmp	w25, w28
	b.lt	LBB0_9
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	w25, w20
	b.gt	LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	str	x24, [sp, #56]                  ; 8-byte Folded Spill
	mov	w0, #1
	bl	_assert
	ldp	x8, x0, [sp, #40]               ; 16-byte Folded Reload
	add	x24, x8, w25, sxtw
	mov	x1, x24
	bl	_cellSizePtr
	sub	w23, w21, w0
	cmp	w23, w28
	b.lt	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x26, x0
	mov	x19, x28
	mov	x28, x27
	add	w27, w0, w25
	ldr	w8, [sp, #36]                   ; 4-byte Folded Reload
	cmp	w27, w8
	b.gt	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	w21, w8
	cset	w0, le
	cset	w25, eq
	mov	x21, x8
	bl	_assert
	mov	x0, x25
	bl	_testcase
	cmp	w27, w21
	cset	w0, eq
	bl	_testcase
	mov	x27, x28
	add	x0, x28, w23, sxtw
	mov	x1, x24
	mov	x2, x26
	bl	_memcpy
	mov	x0, x22
	mov	x1, x23
	bl	_put2byte
	add	x22, x22, #2
	mov	x21, x23
	ldr	x24, [sp, #56]                  ; 8-byte Folded Reload
	subs	x24, x24, #1
	mov	x28, x19
	b.ne	LBB0_2
	b	LBB0_8
LBB0_7:
	mov	x23, x19
LBB0_8:
	subs	w20, w23, w28
	cset	w0, ge
	bl	_assert
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	mov	x1, x23
	bl	_put2byte
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	sturh	wzr, [x8, #1]
	strb	wzr, [x8, #7]
	add	x0, x27, x28
	mov	w1, #0
	mov	x2, x20
	bl	_memset
	ldr	x19, [sp, #48]                  ; 8-byte Folded Reload
	ldr	w0, [x19, #32]
	bl	_sqlite3PagerIswriteable
	bl	_assert
	ldr	w8, [x19, #28]
Lloh5:
	adrp	x9, _SQLITE_CORRUPT_BKPT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SQLITE_CORRUPT_BKPT@GOTPAGEOFF]
Lloh7:
	adrp	x10, _SQLITE_OK@GOTPAGE
Lloh8:
	ldr	x10, [x10, _SQLITE_OK@GOTPAGEOFF]
	cmp	w20, w8
	csel	x8, x10, x9, eq
	str	x8, [sp, #24]                   ; 8-byte Folded Spill
LBB0_9:
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_MAX_PAGE_SIZE,4,2       ; @SQLITE_MAX_PAGE_SIZE
	.comm	_SQLITE_CORRUPT_BKPT,4,2        ; @SQLITE_CORRUPT_BKPT
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.no_dead_strip	_defragmentPage
.subsections_via_symbols
