	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rebuildPage
_rebuildPage:                           ## @rebuildPage
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movl	%esi, %r15d
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movslq	(%rcx), %r12
	movq	48(%rcx), %r13
	movq	32(%rcx), %rax
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movq	40(%rcx), %rcx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movslq	(%rax), %rcx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	leal	(%rbx,%r15), %ecx
	movl	%ecx, -72(%rbp)                 ## 4-byte Spill
	movl	4(%rax), %edi
	callq	_sqlite3PagerTempSpace
	movq	%rax, %r14
	xorl	%edi, %edi
	movq	%rbx, -104(%rbp)                ## 8-byte Spill
	testl	%ebx, %ebx
	setg	%dil
	callq	_assert
	movq	%r12, -112(%rbp)                ## 8-byte Spill
	leaq	20(,%r12,4), %rdi
	addq	%r13, %rdi
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	callq	_get2byte
	xorl	%r12d, %r12d
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	cmpq	%rdx, %rax
	movl	$0, %ecx
	cmovbeq	%rax, %rcx
	movq	%r14, -128(%rbp)                ## 8-byte Spill
	leaq	(%r14,%rcx,4), %rdi
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	leaq	(,%rcx,4), %rsi
	addq	%r13, %rsi
	movq	%rdx, %r13
	subl	%ecx, %edx
	callq	_memcpy
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rax
	cmpl	%r15d, (%rax)
	jg	LBB0_5
## %bb.1:
	xorl	%ebx, %ebx
	movq	_NB@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%r14), %rax
	addq	%rax, %rax
	xorl	%edi, %edi
	cmpq	%rax, %rbx
	setl	%dil
	callq	_ALWAYS
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	1(%rbx), %r12
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rax
	cmpl	%r15d, 4(%rax,%rbx,4)
	movq	%r12, %rbx
	jle	LBB0_2
	jmp	LBB0_5
LBB0_4:
	movq	%rbx, %r12
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
LBB0_5:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r13,4), %rdx
	movl	%r12d, %eax
	shlq	$3, %rax
	addq	16(%rcx), %rax
	movslq	%r15d, %rsi
	movq	%rdx, %r15
	movslq	-72(%rbp), %rdx                 ## 4-byte Folded Reload
	movq	%rdx, -144(%rbp)                ## 8-byte Spill
	movq	%r15, %r13
	movq	%r15, -136(%rbp)                ## 8-byte Spill
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movq	(%rax), %rax
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	movslq	%r12d, %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%rcx), %rax
	movq	24(%rcx), %rcx
	movq	(%rcx,%rsi,8), %r12
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movslq	(%rax,%rsi,4), %r14
	xorl	%edi, %edi
	testq	%r14, %r14
	setg	%dil
	callq	_assert
	movq	%r12, %rdi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_SQLITE_WITHIN
	leaq	(%r12,%r14,4), %rcx
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=2
	cmpq	%r15, %rcx
	jg	LBB0_19
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=2
	subq	%rbx, %r12
	addq	-128(%rbp), %r12                ## 8-byte Folded Reload
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=2
	movq	-120(%rbp), %rax                ## 8-byte Reload
	cmpq	%rax, %r12
	jge	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=2
	cmpq	%rax, %rcx
	jg	LBB0_19
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=2
	leaq	(,%r14,4), %rax
	subq	%rax, %r13
	movq	%r13, %r15
	subq	%rbx, %r15
	shrq	$2, %r15
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_put2byte
	movq	%r13, %rdi
	addq	$8, %rbx
	cmpq	%rbx, %rdi
	jb	LBB0_19
## %bb.13:                              ##   in Loop: Header=BB0_7 Depth=2
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r13
	movq	%r12, %rsi
	movl	%r14d, %edx
	callq	_memcpy
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	*8(%rbx)
	cmpl	%eax, %r14d
	sete	%al
	movq	_CORRUPT_DB@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	setne	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_assert
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	*8(%rbx)
	xorl	%edi, %edi
	cmpl	%eax, %r14d
	setne	%dil
	callq	_testcase
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	incq	%rsi
	cmpq	-144(%rbp), %rsi                ## 8-byte Folded Reload
	jge	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_7 Depth=2
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rax
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movslq	(%rax,%rdx,4), %rax
	cmpq	%rax, %rsi
	movq	-136(%rbp), %r15                ## 8-byte Reload
	jl	LBB0_7
## %bb.15:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	leal	1(%rdx), %r12d
	movq	16(%rcx), %rax
	leaq	(%rax,%rdx,8), %rax
	addq	$8, %rax
	jmp	LBB0_6
LBB0_19:
	movq	_SQLITE_CORRUPT_BKPT@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_17:
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movl	%eax, 16(%rbx)
	movq	$0, 24(%rbx)
	movq	-112(%rbp), %r14                ## 8-byte Reload
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	leaq	(%r12,%r14,4), %rdi
	addq	$4, %rdi
	xorl	%esi, %esi
	callq	_put2byte
	leaq	(%r12,%r14,4), %rdi
	addq	$12, %rdi
	movl	16(%rbx), %esi
	callq	_put2byte
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	callq	_put2byte
	movl	$0, 28(%r12,%r14,4)
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
LBB0_20:
	movl	(%rax), %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NB,4,2                         ## @NB
	.comm	_SQLITE_CORRUPT_BKPT,4,2        ## @SQLITE_CORRUPT_BKPT
	.comm	_CORRUPT_DB,8,3                 ## @CORRUPT_DB
	.comm	_SQLITE_OK,4,2                  ## @SQLITE_OK
	.no_dead_strip	_rebuildPage
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rebuildPage
_rebuildPage:                           ; @rebuildPage
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x20, x3
	mov	x26, x2
	mov	x27, x1
	mov	x23, x0
	ldr	w25, [x3]
	ldp	x24, x19, [x3, #40]
	ldr	x8, [x3, #32]
	ldp	w22, w0, [x8]
                                        ; kill: def $w22 killed $w22 def $x22
	sxtw	x22, w22
	add	x8, x19, x22, lsl #2
	str	x8, [sp, #40]                   ; 8-byte Folded Spill
	add	w21, w2, w1
	bl	_sqlite3PagerTempSpace
	mov	x28, x0
	str	w26, [sp, #8]                   ; 4-byte Folded Spill
	cmp	w26, #0
	cset	w0, gt
	bl	_assert
	str	w25, [sp, #12]                  ; 4-byte Folded Spill
	add	w8, w25, #5
	add	x0, x19, w8, sxtw #2
	str	x0, [sp]                        ; 8-byte Folded Spill
	bl	_get2byte
	cmp	x0, x22
	csel	x8, xzr, x0, hi
	lsl	x9, x8, #2
	str	x28, [sp, #24]                  ; 8-byte Folded Spill
	add	x0, x28, x9
	add	x1, x19, x9
	sub	w2, w22, w8
	bl	_memcpy
	ldr	x8, [x23]
	ldr	w8, [x8]
	cmp	w8, w27
	b.le	LBB0_2
; %bb.1:
	mov	w8, #0
	b	LBB0_6
LBB0_2:
	mov	x22, #0
Lloh0:
	adrp	x25, _NB@GOTPAGE
Lloh1:
	ldr	x25, [x25, _NB@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldrsw	x8, [x25]
	cmp	x22, x8, lsl #1
	cset	w0, lt
	bl	_ALWAYS
	cbz	x0, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x8, x22, #1
	ldr	x9, [x23]
	add	x9, x9, x22, lsl #2
	ldr	w9, [x9, #4]
	mov	x22, x8
	cmp	w9, w27
	b.le	LBB0_3
	b	LBB0_6
LBB0_5:
	mov	x8, x22
LBB0_6:
	ldr	x9, [x23, #16]
	add	x9, x9, w8, uxtw #3
	sxtw	x26, w27
	sxtw	x10, w21
	str	x10, [sp, #32]                  ; 8-byte Folded Spill
	ldr	x22, [sp, #40]                  ; 8-byte Folded Reload
	mov	x27, x22
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	ldr	x9, [x9]
	str	x9, [sp, #16]                   ; 8-byte Folded Spill
	sxtw	x25, w8
LBB0_8:                                 ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x23, #24]
	ldr	x21, [x8, x26, lsl #3]
	ldr	x8, [x23, #8]
	ldrsw	x28, [x8, x26, lsl #2]
	cmp	x28, #0
	cset	w0, gt
	bl	_assert
	mov	x0, x21
	mov	x1, x19
	mov	x2, x22
	bl	_SQLITE_WITHIN
	add	x8, x21, x28, lsl #2
	cbz	x0, LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	cmp	x8, x22
	b.gt	LBB0_16
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=2
	sub	x8, x21, x19
	ldr	x9, [sp, #24]                   ; 8-byte Folded Reload
	add	x21, x9, x8
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_8 Depth=2
	ldr	x9, [sp, #16]                   ; 8-byte Folded Reload
	cmp	x21, x9
	ccmp	x8, x9, #4, lt
	b.gt	LBB0_16
LBB0_12:                                ;   in Loop: Header=BB0_8 Depth=2
	sub	x27, x27, x28, lsl #2
	sub	x8, x27, x19
	lsr	x22, x8, #2
	mov	x0, x24
	mov	x1, x22
	bl	_put2byte
	add	x24, x24, #8
	cmp	x27, x24
	b.lo	LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=2
	mov	x0, x27
	mov	x1, x21
	mov	x2, x28
	bl	_memcpy
	ldr	x8, [x20, #8]
	mov	x0, x20
	mov	x1, x21
	blr	x8
	cmp	w28, w0
Lloh2:
	adrp	x8, _CORRUPT_DB@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CORRUPT_DB@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	ccmp	x8, #0, #0, ne
	cset	w0, ne
	bl	_assert
	ldr	x8, [x20, #8]
	mov	x0, x20
	mov	x1, x21
	blr	x8
	cmp	w28, w0
	cset	w0, ne
	bl	_testcase
	add	x26, x26, #1
	ldr	x8, [sp, #32]                   ; 8-byte Folded Reload
	cmp	x26, x8
	b.ge	LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_8 Depth=2
	ldr	x8, [x23]
	ldrsw	x8, [x8, x25, lsl #2]
	cmp	x26, x8
	ldr	x22, [sp, #40]                  ; 8-byte Folded Reload
	b.lt	LBB0_8
; %bb.15:                               ;   in Loop: Header=BB0_7 Depth=1
	add	w8, w25, #1
	ldr	x9, [x23, #16]
	add	x9, x9, w8, sxtw #3
	b	LBB0_7
LBB0_16:
Lloh5:
	adrp	x8, _SQLITE_CORRUPT_BKPT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SQLITE_CORRUPT_BKPT@GOTPAGEOFF]
	b	LBB0_18
LBB0_17:
	ldp	w8, w21, [sp, #8]               ; 8-byte Folded Reload
	str	w8, [x20, #16]
	str	xzr, [x20, #24]
	add	w8, w21, #1
	add	x0, x19, w8, sxtw #2
	mov	w1, #0
	bl	_put2byte
	add	w8, w21, #3
	add	x0, x19, w8, sxtw #2
	ldr	w1, [x20, #16]
	bl	_put2byte
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	mov	x1, x22
	bl	_put2byte
	add	w8, w21, #7
	str	wzr, [x19, w8, sxtw #2]
Lloh7:
	adrp	x8, _SQLITE_OK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SQLITE_OK@GOTPAGEOFF]
LBB0_18:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_NB,4,2                         ; @NB
	.comm	_SQLITE_CORRUPT_BKPT,4,2        ; @SQLITE_CORRUPT_BKPT
	.comm	_CORRUPT_DB,8,3                 ; @CORRUPT_DB
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.no_dead_strip	_rebuildPage
.subsections_via_symbols
