	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function clearDatabasePage
_clearDatabasePage:                     ## @clearDatabasePage
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movl	%edx, %r14d
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movl	(%rdi), %edi
	callq	_sqlite3_mutex_held
	movl	%eax, %edi
	callq	_assert
	movq	%r12, %rdi
	callq	_btreePagecount
	cmpq	%rbx, %rax
	jge	LBB0_2
## %bb.1:
	movq	_SQLITE_CORRUPT_BKPT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_21
LBB0_2:
	leaq	-56(%rbp), %rdx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_getAndInitPage
	movl	%eax, -44(%rbp)
	testl	%eax, %eax
	jne	LBB0_21
## %bb.3:
	movq	-56(%rbp), %rdi
	cmpl	$0, (%rdi)
	je	LBB0_5
## %bb.4:
	movq	_SQLITE_CORRUPT_BKPT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
LBB0_20:
	movq	-56(%rbp), %rdi
	movl	$0, (%rdi)
	callq	_releasePage
	movl	-44(%rbp), %eax
LBB0_21:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	$1, (%rdi)
	movslq	4(%rdi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	cmpl	$0, 8(%rdi)
	jle	LBB0_12
## %bb.6:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %esi
	callq	_findCell
	movq	%rax, %r13
	movq	-56(%rbp), %rdi
	cmpl	$0, 40(%rdi)
	jne	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	%r13, %rdi
	callq	_get4byte
	movq	%r12, %rdi
	movq	%rax, %rsi
	movl	$1, %edx
	movq	%r15, %rcx
	callq	_clearDatabasePage
	movl	%eax, -44(%rbp)
	testl	%eax, %eax
	jne	LBB0_20
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	-56(%rbp), %rdi
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	%r13, %rsi
	leaq	-68(%rbp), %rdx
	callq	_clearCell
	movl	%eax, -44(%rbp)
	testl	%eax, %eax
	jne	LBB0_20
## %bb.7:                               ##   in Loop: Header=BB0_8 Depth=1
	incl	%ebx
	movq	-56(%rbp), %rdi
	cmpl	8(%rdi), %ebx
	jl	LBB0_8
LBB0_12:
	cmpl	$0, 40(%rdi)
	je	LBB0_13
## %bb.14:
	testq	%r15, %r15
	je	LBB0_16
## %bb.15:
	movq	32(%rdi), %rax
	movq	_CORRUPT_DB@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	orq	(%rcx), %rax
	setne	%dil
	callq	_assert
	movq	-56(%rbp), %rax
	xorl	%edi, %edi
	cmpq	$0, 32(%rax)
	sete	%dil
	callq	_testcase
	movq	-56(%rbp), %rax
	movl	8(%rax), %eax
	addl	%eax, (%r15)
	jmp	LBB0_16
LBB0_13:
	movq	16(%rdi), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax), %rdi
	addq	$8, %rdi
	callq	_get4byte
	movq	%r12, %rdi
	movq	%rax, %rsi
	movl	$1, %edx
	movq	%r15, %rcx
	callq	_clearDatabasePage
	movl	%eax, -44(%rbp)
	testl	%eax, %eax
	jne	LBB0_20
LBB0_16:
	movq	-56(%rbp), %rdi
	testl	%r14d, %r14d
	je	LBB0_18
## %bb.17:
	leaq	-44(%rbp), %rsi
	callq	_freePage
	jmp	LBB0_20
LBB0_18:
	movl	24(%rdi), %edi
	callq	_sqlite3PagerWrite
	movl	%eax, -44(%rbp)
	testl	%eax, %eax
	jne	LBB0_20
## %bb.19:
	movq	-56(%rbp), %rdi
	movq	16(%rdi), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movzbl	(%rax,%rcx), %esi
	movq	_PTF_LEAF@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	callq	_zeroPage
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_SQLITE_CORRUPT_BKPT,4,2        ## @SQLITE_CORRUPT_BKPT
	.comm	_CORRUPT_DB,8,3                 ## @CORRUPT_DB
	.comm	_PTF_LEAF,4,2                   ## @PTF_LEAF
	.no_dead_strip	_clearDatabasePage
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function clearDatabasePage
_clearDatabasePage:                     ; @clearDatabasePage
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x3
	mov	x19, x2
	mov	x22, x1
	mov	x21, x0
	ldr	w0, [x0]
	bl	_sqlite3_mutex_held
	bl	_assert
	mov	x0, x21
	bl	_btreePagecount
	cmp	x0, x22
	b.ge	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _SQLITE_CORRUPT_BKPT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SQLITE_CORRUPT_BKPT@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	b	LBB0_6
LBB0_2:
	add	x2, sp, #8
	mov	x0, x21
	mov	x1, x22
	mov	w3, #0
	mov	w4, #0
	bl	_getAndInitPage
	str	w0, [sp, #4]
	cbnz	w0, LBB0_6
; %bb.3:
	ldr	x0, [sp, #8]
	ldr	w8, [x0]
	cbz	w8, LBB0_7
; %bb.4:
Lloh3:
	adrp	x8, _SQLITE_CORRUPT_BKPT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SQLITE_CORRUPT_BKPT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [sp, #4]
LBB0_5:
	ldr	x0, [sp, #8]
	str	wzr, [x0]
	bl	_releasePage
	ldr	w0, [sp, #4]
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_7:
	mov	w8, #1
	str	w8, [x0]
	ldp	w24, w8, [x0, #4]
                                        ; kill: def $w24 killed $w24 def $x24
	sxtw	x24, w24
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.8:
	mov	w22, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x1, x22
	bl	_findCell
	mov	x23, x0
	ldr	x0, [sp, #8]
	ldr	w8, [x0, #40]
	cbnz	w8, LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x23
	bl	_get4byte
	mov	x1, x0
	mov	x0, x21
	mov	w2, #1
	mov	x3, x20
	bl	_clearDatabasePage
	str	w0, [sp, #4]
	cbnz	w0, LBB0_5
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x0, [sp, #8]
LBB0_12:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x2, sp
	mov	x1, x23
	bl	_clearCell
	str	w0, [sp, #4]
	cbnz	w0, LBB0_5
; %bb.13:                               ;   in Loop: Header=BB0_9 Depth=1
	add	w22, w22, #1
	ldr	x0, [sp, #8]
	ldr	w8, [x0, #8]
	cmp	w22, w8
	b.lt	LBB0_9
LBB0_14:
	ldr	w8, [x0, #40]
	cbz	w8, LBB0_17
; %bb.15:
	cbz	x20, LBB0_18
; %bb.16:
	ldr	x8, [x0, #32]
Lloh6:
	adrp	x9, _CORRUPT_DB@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CORRUPT_DB@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	orr	x8, x8, x9
	cmp	x8, #0
	cset	w0, ne
	bl	_assert
	ldr	x8, [sp, #8]
	ldr	x8, [x8, #32]
	cmp	x8, #0
	cset	w0, eq
	bl	_testcase
	ldr	x8, [sp, #8]
	ldr	w8, [x8, #8]
	ldr	w9, [x20]
	add	w8, w9, w8
	str	w8, [x20]
	b	LBB0_18
LBB0_17:
	ldr	x8, [x0, #16]
	add	x8, x24, x8
	add	x0, x8, #8
	bl	_get4byte
	mov	x1, x0
	mov	x0, x21
	mov	w2, #1
	mov	x3, x20
	bl	_clearDatabasePage
	str	w0, [sp, #4]
	cbnz	w0, LBB0_5
LBB0_18:
	ldr	x0, [sp, #8]
	cbz	w19, LBB0_20
; %bb.19:
	add	x1, sp, #4
	bl	_freePage
	b	LBB0_5
LBB0_20:
	ldr	w0, [x0, #24]
	bl	_sqlite3PagerWrite
	str	w0, [sp, #4]
	cbnz	w0, LBB0_5
; %bb.21:
	ldr	x0, [sp, #8]
	ldr	x8, [x0, #16]
	ldrb	w8, [x8, x24]
Lloh9:
	adrp	x9, _PTF_LEAF@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PTF_LEAF@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_zeroPage
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_CORRUPT_BKPT,4,2        ; @SQLITE_CORRUPT_BKPT
	.comm	_CORRUPT_DB,8,3                 ; @CORRUPT_DB
	.comm	_PTF_LEAF,4,2                   ; @PTF_LEAF
	.no_dead_strip	_clearDatabasePage
.subsections_via_symbols
