	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function btreeOverwriteCell
_btreeOverwriteCell:                    ## @btreeOverwriteCell
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rcx
	movl	4(%rsi), %r14d
	addl	(%rsi), %r14d
	movq	16(%rdi), %r12
	movq	%r12, -48(%rbp)
	movq	(%rdi), %rsi
	movslq	8(%rdi), %r8
	leaq	(%rsi,%r8), %rax
	cmpq	(%r12), %rax
	jg	LBB0_2
## %bb.1:
	movq	16(%r12), %rax
	addq	8(%r12), %rax
	cmpq	%rax, %rsi
	jge	LBB0_3
LBB0_2:
	movq	_SQLITE_CORRUPT_BKPT@GOTPCREL(%rip), %rax
LBB0_17:
	movl	(%rax), %r13d
LBB0_18:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rdi, %rbx
	movq	%r12, %rdi
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rcx, %rdx
	xorl	%ecx, %ecx
                                        ## kill: def $r8d killed $r8d killed $r8
	callq	_btreeOverwriteContent
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_18
## %bb.4:
	movl	8(%rbx), %r15d
	cmpl	%r14d, %r15d
	je	LBB0_16
## %bb.5:
	movslq	%r15d, %r13
	movl	%r14d, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_assert
	movl	%r15d, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_assert
	addq	(%rbx), %r13
	movq	%r13, %rdi
	callq	_get4byte
	movl	%eax, %ebx
	movq	32(%r12), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	(%rax), %r12d
	addl	$-4, %r12d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	leaq	-48(%rbp), %rdx
	xorl	%ecx, %ecx
	callq	_btreeGetPage
	testl	%eax, %eax
	jne	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	-48(%rbp), %rax
	movl	24(%rax), %edi
	callq	_sqlite3PagerPageRefcount
	cmpl	$1, %eax
	jne	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	leal	(%r12,%r15), %eax
	cmpl	%r14d, %eax
	jge	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	-48(%rbp), %rax
	movq	8(%rax), %rdi
	callq	_get4byte
	movl	%eax, %ebx
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	_SQLITE_CORRUPT_BKPT@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	jmp	LBB0_14
LBB0_12:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	%r14d, %r12d
	subl	%r15d, %r12d
LBB0_13:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	-48(%rbp), %rdi
	movq	8(%rdi), %rsi
	addq	$4, %rsi
	movl	%r15d, %ecx
	movl	%r12d, %r8d
	callq	_btreeOverwriteContent
	movl	%eax, %r13d
LBB0_14:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	-48(%rbp), %rax
	movl	24(%rax), %edi
	callq	_sqlite3PagerUnref
	testl	%r13d, %r13d
	jne	LBB0_18
## %bb.15:                              ##   in Loop: Header=BB0_6 Depth=1
	addl	%r12d, %r15d
	cmpl	%r14d, %r15d
	jl	LBB0_6
LBB0_16:
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_7:
	movl	%eax, %r13d
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_SQLITE_CORRUPT_BKPT,4,2        ## @SQLITE_CORRUPT_BKPT
	.comm	_SQLITE_OK,4,2                  ## @SQLITE_OK
	.no_dead_strip	_btreeOverwriteCell
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function btreeOverwriteCell
_btreeOverwriteCell:                    ; @btreeOverwriteCell
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x1
	ldp	w23, w25, [x1]
	ldr	x21, [x0, #16]
	str	x21, [sp, #8]
	ldr	x1, [x0]
	ldrsw	x4, [x0, #8]
	ldr	x8, [x21]
	add	x9, x1, x4
	cmp	x9, x8
	b.gt	LBB0_2
; %bb.1:
	ldp	x8, x9, [x21, #8]
	add	x8, x9, x8
	cmp	x1, x8
	b.ge	LBB0_5
LBB0_2:
Lloh0:
	adrp	x8, _SQLITE_CORRUPT_BKPT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SQLITE_CORRUPT_BKPT@GOTPAGEOFF]
LBB0_3:
	ldr	w24, [x8]
LBB0_4:
	mov	x0, x24
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_5:
	mov	x22, x0
	mov	x0, x21
	mov	x2, x19
	mov	w3, #0
                                        ; kill: def $w4 killed $w4 killed $x4
	bl	_btreeOverwriteContent
	mov	x24, x0
	cbnz	w0, LBB0_4
; %bb.6:
	ldr	w20, [x22, #8]
	add	w25, w25, w23
	cmp	w20, w25
	b.eq	LBB0_17
; %bb.7:
	sxtw	x23, w20
	mvn	w8, w25
	lsr	w0, w8, #31
	bl	_assert
	mvn	w8, w20
	lsr	w0, w8, #31
	bl	_assert
	ldr	x8, [x22]
	add	x0, x8, x23
	bl	_get4byte
	mov	x23, x0
	ldr	x21, [x21, #32]
	ldr	w8, [x21]
	sub	w22, w8, #4
Lloh2:
	adrp	x26, _SQLITE_CORRUPT_BKPT@GOTPAGE
Lloh3:
	ldr	x26, [x26, _SQLITE_CORRUPT_BKPT@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	add	x2, sp, #8
	mov	x0, x21
	mov	x1, x23
	mov	w3, #0
	bl	_btreeGetPage
	cbnz	w0, LBB0_18
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [sp, #8]
	ldr	w0, [x8, #24]
	bl	_sqlite3PagerPageRefcount
	cmp	w0, #1
	b.ne	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	add	w8, w22, w20
	cmp	w8, w25
	b.ge	LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [sp, #8]
	ldr	x0, [x8, #8]
	bl	_get4byte
	mov	x23, x0
	b	LBB0_14
LBB0_12:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w24, [x26]
	b	LBB0_15
LBB0_13:                                ;   in Loop: Header=BB0_8 Depth=1
	sub	w22, w25, w20
LBB0_14:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x0, [sp, #8]
	ldr	x8, [x0, #8]
	add	x1, x8, #4
	mov	x2, x19
	mov	x3, x20
	mov	x4, x22
	bl	_btreeOverwriteContent
	mov	x24, x0
LBB0_15:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [sp, #8]
	ldr	w0, [x8, #24]
	bl	_sqlite3PagerUnref
	cbnz	w24, LBB0_4
; %bb.16:                               ;   in Loop: Header=BB0_8 Depth=1
	add	w20, w22, w20
	cmp	w20, w25
	b.lt	LBB0_8
LBB0_17:
Lloh4:
	adrp	x8, _SQLITE_OK@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SQLITE_OK@GOTPAGEOFF]
	b	LBB0_3
LBB0_18:
	mov	x24, x0
	b	LBB0_4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_CORRUPT_BKPT,4,2        ; @SQLITE_CORRUPT_BKPT
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.no_dead_strip	_btreeOverwriteCell
.subsections_via_symbols
