	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function walIndexPage
_walIndexPage:                          ## @walIndexPage
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	movq	%rdi, %r13
	movq	_SQLITE_OK@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r15d
	cmpl	%r12d, (%rdi)
	jle	LBB0_2
## %bb.1:
	movq	16(%r13), %rbx
	jmp	LBB0_5
LBB0_2:
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	leal	8(,%r12,8), %esi
	movq	16(%r13), %rdi
	callq	_sqlite3_realloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %rbx
	leal	1(%r12), %r14d
	movslq	(%r13), %rax
	leaq	(%rbx,%rax,8), %rdi
	movl	%r14d, %edx
	subl	%eax, %edx
	shll	$3, %edx
	xorl	%esi, %esi
	callq	_memset
	movq	%rbx, 16(%r13)
	movl	%r14d, (%r13)
	movq	_SQLITE_OK@GOTPCREL(%rip), %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
LBB0_5:
	movslq	%r12d, %r14
	cmpq	$0, (%rbx,%r14,8)
	jne	LBB0_12
## %bb.6:
	movq	8(%r13), %rax
	movq	_WAL_HEAPMEMORY_MODE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.7:
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rbx
	movq	_WALINDEX_PGSZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_sqlite3MallocZero
	movq	16(%r13), %rcx
	movq	%rax, (%rcx,%r14,8)
	movq	16(%r13), %rax
	cmpq	$0, (%rax,%r14,8)
	jne	LBB0_9
## %bb.8:
	movq	_SQLITE_NOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_9:
	movq	%rbx, %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	jmp	LBB0_12
LBB0_3:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	$0, (%rax)
	movq	_SQLITE_NOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_13
LBB0_10:
	movq	%rdx, %r15
	leaq	(%rbx,%r14,8), %r8
	movl	28(%r13), %ecx
	movl	32(%r13), %edi
	movq	_WALINDEX_PGSZ@GOTPCREL(%rip), %rax
	movq	%rsi, %rbx
	movl	(%rax), %edx
	movl	%r12d, %esi
	callq	_sqlite3OsShmMap
	movq	%r15, %rdx
	movq	%rbx, %rsi
	movl	%eax, %r15d
	movq	_SQLITE_READONLY@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jne	LBB0_12
## %bb.11:
	movq	_WAL_SHM_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 24(%r13)
	movl	(%rsi), %r15d
LBB0_12:
	movq	16(%r13), %rax
	movq	(%rax,%r14,8), %rax
	movq	%rax, (%rdx)
	testl	%r12d, %r12d
	sete	%cl
	testq	%rax, %rax
	setne	%al
	orb	%cl, %al
	cmpl	(%rsi), %r15d
	setne	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_assert
LBB0_13:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SQLITE_OK,4,2                  ## @SQLITE_OK
	.comm	_SQLITE_NOMEM,4,2               ## @SQLITE_NOMEM
	.comm	_WAL_HEAPMEMORY_MODE,8,3        ## @WAL_HEAPMEMORY_MODE
	.comm	_WALINDEX_PGSZ,4,2              ## @WALINDEX_PGSZ
	.comm	_SQLITE_READONLY,4,2            ## @SQLITE_READONLY
	.comm	_WAL_SHM_RDONLY,4,2             ## @WAL_SHM_RDONLY
	.no_dead_strip	_walIndexPage
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function walIndexPage
_walIndexPage:                          ; @walIndexPage
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x24, _SQLITE_OK@GOTPAGE
Lloh1:
	ldr	x24, [x24, _SQLITE_OK@GOTPAGEOFF]
	ldr	w22, [x24]
	ldr	w8, [x0]
	cmp	w8, w1
	b.le	LBB0_2
; %bb.1:
	ldr	x23, [x21, #16]
	b	LBB0_4
LBB0_2:
	add	w25, w20, #1
	lsl	w1, w25, #3
	ldr	x0, [x21, #16]
	bl	_sqlite3_realloc
	cbz	x0, LBB0_7
; %bb.3:
	mov	x23, x0
	ldrsw	x8, [x21]
	add	x0, x0, x8, lsl #3
	sub	w8, w25, w8
	lsl	w2, w8, #3
	mov	w1, #0
	bl	_memset
	str	x23, [x21, #16]
	str	w25, [x21]
LBB0_4:
	sxtw	x25, w20
	add	x4, x23, w20, sxtw #3
	ldr	x8, [x4]
	cbnz	x8, LBB0_10
; %bb.5:
	ldr	x8, [x21, #8]
Lloh2:
	adrp	x9, _WAL_HEAPMEMORY_MODE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _WAL_HEAPMEMORY_MODE@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.6:
Lloh5:
	adrp	x8, _WALINDEX_PGSZ@GOTPAGE
Lloh6:
	ldr	x8, [x8, _WALINDEX_PGSZ@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_sqlite3MallocZero
	ldr	x8, [x21, #16]
	lsl	x9, x25, #3
	str	x0, [x8, x9]
	ldr	x8, [x21, #16]
	ldr	x8, [x8, x9]
Lloh8:
	adrp	x9, _SQLITE_NOMEM@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SQLITE_NOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	cmp	x8, #0
	csel	w22, w9, w22, eq
	b	LBB0_10
LBB0_7:
	str	xzr, [x19]
Lloh11:
	adrp	x8, _SQLITE_NOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SQLITE_NOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w22, [x8]
	b	LBB0_11
LBB0_8:
Lloh14:
	adrp	x8, _WALINDEX_PGSZ@GOTPAGE
Lloh15:
	ldr	x8, [x8, _WALINDEX_PGSZ@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	ldp	w3, w0, [x21, #28]
	mov	x1, x20
	bl	_sqlite3OsShmMap
	mov	x22, x0
Lloh17:
	adrp	x8, _SQLITE_READONLY@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SQLITE_READONLY@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_10
; %bb.9:
Lloh20:
	adrp	x8, _WAL_SHM_RDONLY@GOTPAGE
Lloh21:
	ldr	x8, [x8, _WAL_SHM_RDONLY@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	ldr	w9, [x21, #24]
	orr	w8, w9, w8
	str	w8, [x21, #24]
	ldr	w22, [x24]
LBB0_10:
	ldr	x8, [x21, #16]
	ldr	x8, [x8, x25, lsl #3]
	str	x8, [x19]
	cmp	w20, #0
	ccmp	x8, #0, #0, ne
	ldr	w8, [x24]
	ccmp	w22, w8, #0, eq
	cset	w0, ne
	bl	_assert
LBB0_11:
	mov	x0, x22
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.comm	_SQLITE_NOMEM,4,2               ; @SQLITE_NOMEM
	.comm	_WAL_HEAPMEMORY_MODE,8,3        ; @WAL_HEAPMEMORY_MODE
	.comm	_WALINDEX_PGSZ,4,2              ; @WALINDEX_PGSZ
	.comm	_SQLITE_READONLY,4,2            ; @SQLITE_READONLY
	.comm	_WAL_SHM_RDONLY,4,2             ; @WAL_SHM_RDONLY
	.no_dead_strip	_walIndexPage
.subsections_via_symbols
