	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function walCheckpoint
_walCheckpoint:                         ## @walCheckpoint
	.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
	movq	%r9, -136(%rbp)                 ## 8-byte Spill
	movl	%r8d, -52(%rbp)                 ## 4-byte Spill
	movq	%rcx, %r13
	movq	%rdx, %r14
	movl	%esi, %ebx
	movq	%rdi, %r12
	movq	$0, -96(%rbp)
	movq	$0, -80(%rbp)
	movq	$0, -112(%rbp)
	callq	_walPagesize
	movl	%eax, %r15d
	xorl	%edi, %edi
	cmpl	$32769, %eax                    ## imm = 0x8001
	setl	%dil
	callq	_testcase
	xorl	%edi, %edi
	cmpl	$65536, %r15d                   ## imm = 0x10000
	setge	%dil
	callq	_testcase
	movq	%r12, %rdi
	callq	_walCkptInfo
	movq	(%rax), %rcx
	cmpq	8(%r12), %rcx
	jge	LBB0_12
## %bb.1:
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	%r15d, -56(%rbp)                ## 4-byte Spill
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	leaq	-96(%rbp), %rsi
	movq	%r12, %rdi
	callq	_walIteratorInit
	movq	_SQLITE_OK@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_55
## %bb.2:
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	-96(%rbp), %edi
	callq	_assert
	movq	_SQLITE_CHECKPOINT_PASSIVE@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
	cmpl	%ecx, (%rdx)
	cmoveq	%rax, %r14
	movq	8(%r12), %rdx
	movq	16(%r12), %rax
	movq	%rax, -128(%rbp)                ## 8-byte Spill
	movq	_WAL_NREADER@GOTPCREL(%rip), %rcx
	cmpl	$2, (%rcx)
	movq	%r13, -104(%rbp)                ## 8-byte Spill
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	jl	LBB0_13
## %bb.3:
	movl	$1, %r15d
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	8(%r13), %rcx
	movq	%rax, (%rcx,%r15,8)
	movl	%r15d, %edi
	callq	_WAL_READ_LOCK
	movq	%r12, %rdi
	movl	%eax, %esi
	movl	$1, %edx
	callq	_walUnlockExclusive
	movq	_WAL_NREADER@GOTPCREL(%rip), %rcx
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	%r14d, %esi
LBB0_5:                                 ##   in Loop: Header=BB0_6 Depth=1
	incq	%r15
	movslq	(%rcx), %rax
	cmpq	%rax, %r15
	jge	LBB0_14
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rax
	movq	(%rax,%r15,8), %r14
	cmpq	%r14, %rdx
	jle	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r12, %rbx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	xorl	%edi, %edi
	cmpq	8(%r12), %r14
	setle	%dil
	callq	_assert
	movl	%r15d, %edi
	callq	_WAL_READ_LOCK
	movq	%r12, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movq	-104(%rbp), %rdx                ## 8-byte Reload
	movl	%eax, %ecx
	movl	$1, %r8d
	callq	_walBusyLock
	movl	%eax, %esi
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	%esi, %r14d
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpq	$1, %r15
	je	LBB0_4
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	_READMARK_NOT_USED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	_SQLITE_BUSY@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	movq	_WAL_NREADER@GOTPCREL(%rip), %rcx
	jne	LBB0_54
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	xorl	%eax, %eax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdx
	jmp	LBB0_5
LBB0_12:
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_55
LBB0_13:
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movl	-48(%rbp), %esi                 ## 4-byte Reload
LBB0_14:
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	(%r13), %rax
	cmpq	%rdx, %rax
	movq	_SQLITE_OK@GOTPCREL(%rip), %rbx
	jge	LBB0_47
## %bb.15:
	xorl	%edi, %edi
	callq	_WAL_READ_LOCK
	movq	%r12, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movq	-104(%rbp), %rdx                ## 8-byte Reload
	movl	%eax, %ecx
	movl	$1, %r8d
	callq	_walBusyLock
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movl	%eax, %esi
	cmpl	(%rbx), %eax
	jne	LBB0_47
## %bb.16:
	movq	(%r13), %r13
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	movl	-56(%rbp), %r14d                ## 4-byte Reload
	je	LBB0_18
## %bb.17:
	movl	28(%r12), %edi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_sqlite3OsSync
	cmpl	(%rbx), %eax
	jne	LBB0_22
LBB0_18:
	movq	%rbx, %r15
	movl	%r14d, %ebx
	imull	-128(%rbp), %ebx                ## 4-byte Folded Reload
	movl	%ebx, -116(%rbp)
	movl	24(%r12), %edi
	leaq	-120(%rbp), %rsi
	callq	_sqlite3OsFileSize
	cmpl	(%r15), %eax
	jne	LBB0_21
## %bb.19:
	cmpl	%ebx, -120(%rbp)
	jge	LBB0_21
## %bb.20:
	movl	24(%r12), %edi
	movq	_SQLITE_FCNTL_SIZE_HINT@GOTPCREL(%rip), %rcx
	movl	%eax, %ebx
	movl	(%rcx), %esi
	leaq	-116(%rbp), %rdx
	callq	_sqlite3OsFileControlHint
	movl	%ebx, %eax
LBB0_21:
	movq	_SQLITE_OK@GOTPCREL(%rip), %rbx
LBB0_22:
	cmpl	(%rbx), %eax
	jne	LBB0_36
## %bb.23:
	leaq	-80(%rbp), %r15
	jmp	LBB0_27
LBB0_24:                                ##   in Loop: Header=BB0_27 Depth=1
	movl	%ebx, %eax
LBB0_25:                                ##   in Loop: Header=BB0_27 Depth=1
	movq	%r14, %rbx
LBB0_26:                                ##   in Loop: Header=BB0_27 Depth=1
	cmpl	(%rbx), %eax
	jne	LBB0_36
LBB0_27:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %r14
	movl	%eax, %ebx
	movq	-96(%rbp), %rdi
	movq	%r15, %rsi
	leaq	-112(%rbp), %rdx
	callq	_walIteratorNext
	testq	%rax, %rax
	jne	LBB0_34
## %bb.28:                              ##   in Loop: Header=BB0_27 Depth=1
	movq	-112(%rbp), %rsi
	movq	%r12, %rdi
	callq	_walFramePgno
	xorl	%edi, %edi
	cmpq	-80(%rbp), %rax
	sete	%dil
	callq	_assert
	movq	-112(%rbp), %rdi
	cmpq	%r13, %rdi
	jle	LBB0_24
## %bb.29:                              ##   in Loop: Header=BB0_27 Depth=1
	cmpq	-48(%rbp), %rdi                 ## 8-byte Folded Reload
	movl	%ebx, %eax
	jg	LBB0_25
## %bb.30:                              ##   in Loop: Header=BB0_27 Depth=1
	movq	-128(%rbp), %rcx                ## 8-byte Reload
	cmpq	%rcx, -80(%rbp)
	movq	%r14, %rbx
	jg	LBB0_26
## %bb.31:                              ##   in Loop: Header=BB0_27 Depth=1
	movq	%r13, %r15
	movl	-56(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %esi
	callq	_walFrameOffset
	movq	_WAL_FRAME_HDRSIZE@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	movl	28(%r12), %edi
	movq	%r12, %r13
	movq	-136(%rbp), %r12                ## 8-byte Reload
	movq	%r12, %rsi
	movl	%r14d, %edx
	movl	%eax, %ecx
	callq	_sqlite3OsRead
	cmpl	(%rbx), %eax
	jne	LBB0_35
## %bb.32:                              ##   in Loop: Header=BB0_27 Depth=1
	movl	-80(%rbp), %ebx
	decl	%ebx
	imull	%r14d, %ebx
	movl	%ebx, %edi
	callq	_IS_BIG_INT
	movl	%eax, %edi
	callq	_testcase
	movl	24(%r13), %edi
	movq	%r12, %rsi
	movl	%r14d, %edx
	movl	%ebx, %ecx
	movq	_SQLITE_OK@GOTPCREL(%rip), %rbx
	callq	_sqlite3OsWrite
	cmpl	(%rbx), %eax
	movq	%r13, %r12
	movq	%r15, %r13
	leaq	-80(%rbp), %r15
	je	LBB0_26
	jmp	LBB0_36
LBB0_34:
	movl	%ebx, %eax
	movq	%r14, %rbx
	jmp	LBB0_36
LBB0_35:
	movq	%r13, %r12
LBB0_36:
	cmpl	(%rbx), %eax
	jne	LBB0_41
## %bb.37:
	movq	%r12, %rdi
	movq	%rbx, %r14
	movl	%eax, %ebx
	callq	_walIndexHdr
	movl	%ebx, %edx
	movq	%r14, %rbx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpq	(%rax), %rcx
	jne	LBB0_43
## %bb.38:
	movl	16(%r12), %ebx
	imull	-56(%rbp), %ebx                 ## 4-byte Folded Reload
	movl	%ebx, %edi
	callq	_IS_BIG_INT
	movl	%eax, %edi
	callq	_testcase
	movl	24(%r12), %edi
	movl	%ebx, %esi
	callq	_sqlite3OsTruncate
	movl	%eax, %edx
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_42
## %bb.39:
	movq	_SQLITE_OK@GOTPCREL(%rip), %rbx
	cmpl	(%rbx), %edx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	jne	LBB0_43
## %bb.40:
	movl	24(%r12), %edi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_sqlite3OsSync
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, %edx
	jmp	LBB0_43
LBB0_41:
	movq	%rbx, %r14
	movl	%eax, %ebx
	jmp	LBB0_46
LBB0_42:
	movq	_SQLITE_OK@GOTPCREL(%rip), %rbx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
LBB0_43:
	cmpl	(%rbx), %edx
	jne	LBB0_45
## %bb.44:
	movq	%rbx, %r14
	movl	%edx, %ebx
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%rcx, (%rax)
	jmp	LBB0_46
LBB0_45:
	movq	%rbx, %r14
	movl	%edx, %ebx
LBB0_46:
	xorl	%edi, %edi
	callq	_WAL_READ_LOCK
	movq	%r12, %rdi
	movl	%eax, %esi
	movl	$1, %edx
	callq	_walUnlockExclusive
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movl	%ebx, %esi
	movq	%r14, %rbx
LBB0_47:
	movq	_SQLITE_BUSY@GOTPCREL(%rip), %r15
	cmpl	(%r15), %esi
	movl	(%rbx), %ebx
	cmovel	%ebx, %esi
	cmpl	%ebx, %esi
	jne	LBB0_54
## %bb.48:
	movl	-60(%rbp), %eax                 ## 4-byte Reload
	movq	_SQLITE_CHECKPOINT_PASSIVE@GOTPCREL(%rip), %rcx
	cmpl	%eax, (%rcx)
	je	LBB0_54
## %bb.49:
	movl	(%r12), %edi
	callq	_assert
	movq	(%r13), %rcx
	movq	8(%r12), %rax
	cmpq	%rax, %rcx
	jge	LBB0_51
## %bb.50:
	movl	(%r15), %esi
	jmp	LBB0_54
LBB0_51:
	movq	_SQLITE_CHECKPOINT_RESTART@GOTPCREL(%rip), %rcx
	movl	%ebx, %esi
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	cmpl	%edx, (%rcx)
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	jne	LBB0_54
## %bb.52:
	xorl	%edi, %edi
	cmpq	%rax, %rcx
	sete	%dil
	callq	_assert
	movl	$1, %edi
	callq	_WAL_READ_LOCK
	movq	_WAL_NREADER@GOTPCREL(%rip), %r14
	movl	(%r14), %r8d
	decl	%r8d
	movq	%r12, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movq	-104(%rbp), %rdx                ## 8-byte Reload
	movl	%eax, %ecx
	callq	_walBusyLock
	movl	%eax, %esi
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jne	LBB0_54
## %bb.53:
	movl	$1, %edi
	movl	%esi, %ebx
	callq	_WAL_READ_LOCK
	movl	(%r14), %edx
	decl	%edx
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_walUnlockExclusive
	movl	%ebx, %esi
LBB0_54:
	movq	-96(%rbp), %rdi
	movl	%esi, %ebx
	callq	_walIteratorFree
	movl	%ebx, %eax
LBB0_55:
	addq	$104, %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_CHECKPOINT_PASSIVE,4,2  ## @SQLITE_CHECKPOINT_PASSIVE
	.comm	_WAL_NREADER,4,2                ## @WAL_NREADER
	.comm	_READMARK_NOT_USED,8,3          ## @READMARK_NOT_USED
	.comm	_SQLITE_BUSY,4,2                ## @SQLITE_BUSY
	.comm	_SQLITE_FCNTL_SIZE_HINT,4,2     ## @SQLITE_FCNTL_SIZE_HINT
	.comm	_WAL_FRAME_HDRSIZE,4,2          ## @WAL_FRAME_HDRSIZE
	.comm	_SQLITE_CHECKPOINT_RESTART,4,2  ## @SQLITE_CHECKPOINT_RESTART
	.no_dead_strip	_walCheckpoint
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function walCheckpoint
_walCheckpoint:                         ; @walCheckpoint
	.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	x21, x5
	mov	x28, x4
	mov	x20, x3
	mov	x23, x2
	mov	x26, x1
	mov	x19, x0
	stp	xzr, xzr, [sp, #48]
	str	xzr, [sp, #40]
	bl	_walPagesize
	mov	x25, x0
	cmp	w0, #8, lsl #12                 ; =32768
	cset	w0, le
	bl	_testcase
	cmp	w25, #16, lsl #12               ; =65536
	cset	w0, ge
	bl	_testcase
	mov	x0, x19
	bl	_walCkptInfo
	ldr	x8, [x0]
	ldr	x9, [x19, #8]
Lloh0:
	adrp	x24, _SQLITE_OK@GOTPAGE
Lloh1:
	ldr	x24, [x24, _SQLITE_OK@GOTPAGEOFF]
	cmp	x8, x9
	b.ge	LBB0_11
; %bb.1:
	mov	x22, x0
	add	x1, sp, #56
	mov	x0, x19
	bl	_walIteratorInit
	mov	x27, x0
	ldr	w8, [x24]
	cmp	w0, w8
	b.ne	LBB0_41
; %bb.2:
	str	x21, [sp, #8]                   ; 8-byte Folded Spill
	ldr	w0, [sp, #56]
	bl	_assert
Lloh2:
	adrp	x8, _SQLITE_CHECKPOINT_PASSIVE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SQLITE_CHECKPOINT_PASSIVE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, w26
	csel	x23, xzr, x23, eq
	ldp	x21, x8, [x19, #8]
	str	x8, [sp, #24]                   ; 8-byte Folded Spill
Lloh5:
	adrp	x9, _WAL_NREADER@GOTPAGE
Lloh6:
	ldr	x9, [x9, _WAL_NREADER@GOTPAGEOFF]
	ldr	w8, [x9]
	cmp	w8, #2
	str	w26, [sp, #20]                  ; 4-byte Folded Spill
	str	w28, [sp, #4]                   ; 4-byte Folded Spill
	b.lt	LBB0_12
; %bb.3:
	mov	w28, #1
	b	LBB0_7
LBB0_4:                                 ;   in Loop: Header=BB0_7 Depth=1
Lloh7:
	adrp	x8, _READMARK_NOT_USED@GOTPAGE
Lloh8:
	ldr	x8, [x8, _READMARK_NOT_USED@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	cmp	x28, #1
	csel	x8, x21, x8, eq
	ldr	x9, [x22, #8]
	str	x8, [x9, x28, lsl #3]
	mov	x0, x28
	bl	_WAL_READ_LOCK
	mov	x1, x0
	mov	x0, x19
	mov	w2, #1
	bl	_walUnlockExclusive
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
Lloh10:
	adrp	x9, _WAL_NREADER@GOTPAGE
Lloh11:
	ldr	x9, [x9, _WAL_NREADER@GOTPAGEOFF]
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x28, x28, #1
	ldrsw	x8, [x9]
	cmp	x28, x8
	b.ge	LBB0_12
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22, #8]
	ldr	x26, [x8, x28, lsl #3]
	cmp	x21, x26
	b.le	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x19, #8]
	cmp	x26, x8
	cset	w0, le
	bl	_assert
	mov	x0, x28
	bl	_WAL_READ_LOCK
	mov	x3, x0
	mov	x0, x19
	mov	x1, x23
	mov	x2, x20
	mov	w4, #1
	bl	_walBusyLock
	mov	x27, x0
	ldr	w8, [x24]
	cmp	w0, w8
	b.eq	LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
Lloh12:
	adrp	x8, _SQLITE_BUSY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SQLITE_BUSY@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w27, w8
	b.ne	LBB0_40
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x23, #0
	mov	x21, x26
	b	LBB0_5
LBB0_11:
	ldr	w27, [x24]
	b	LBB0_41
LBB0_12:
	ldr	x8, [x22]
	cmp	x8, x21
	b.ge	LBB0_34
; %bb.13:
	mov	w0, #0
	bl	_WAL_READ_LOCK
	mov	x3, x0
	mov	x0, x19
	mov	x1, x23
	mov	x2, x20
	mov	w4, #1
	bl	_walBusyLock
	mov	x27, x0
	ldr	w8, [x24]
	cmp	w0, w8
	b.ne	LBB0_34
; %bb.14:
	ldr	x28, [x22]
	ldr	w8, [sp, #4]                    ; 4-byte Folded Reload
	cbz	w8, LBB0_16
; %bb.15:
	ldr	w0, [x19, #28]
	ldr	w1, [sp, #4]                    ; 4-byte Folded Reload
	bl	_sqlite3OsSync
	mov	x27, x0
	ldr	w8, [x24]
	cmp	w0, w8
	b.ne	LBB0_18
LBB0_16:
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	mul	w26, w25, w8
	str	w26, [sp, #32]
	ldr	w0, [x19, #24]
	add	x1, sp, #36
	bl	_sqlite3OsFileSize
	mov	x27, x0
	ldr	w8, [x24]
	ldr	w9, [sp, #36]
	cmp	w0, w8
	ccmp	w9, w26, #0, eq
	b.ge	LBB0_18
; %bb.17:
	ldr	w0, [x19, #24]
Lloh15:
	adrp	x8, _SQLITE_FCNTL_SIZE_HINT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SQLITE_FCNTL_SIZE_HINT@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	add	x2, sp, #32
	bl	_sqlite3OsFileControlHint
LBB0_18:
	ldr	w8, [x24]
	cmp	w27, w8
	b.ne	LBB0_26
; %bb.19:
	ldr	x26, [sp, #8]                   ; 8-byte Folded Reload
	b	LBB0_21
LBB0_20:                                ;   in Loop: Header=BB0_21 Depth=1
	ldr	w8, [x24]
	cmp	w27, w8
	b.ne	LBB0_26
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [sp, #56]
	add	x1, sp, #48
	add	x2, sp, #40
	bl	_walIteratorNext
	cbnz	x0, LBB0_26
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=1
	ldr	x1, [sp, #40]
	mov	x0, x19
	bl	_walFramePgno
	ldr	x8, [sp, #48]
	cmp	x0, x8
	cset	w0, eq
	bl	_assert
	ldp	x0, x8, [sp, #40]
	cmp	x0, x28
	ccmp	x0, x21, #0, gt
	ldr	x9, [sp, #24]                   ; 8-byte Folded Reload
	ccmp	x8, x9, #0, le
	b.gt	LBB0_20
; %bb.23:                               ;   in Loop: Header=BB0_21 Depth=1
	mov	x1, x25
	bl	_walFrameOffset
Lloh18:
	adrp	x8, _WAL_FRAME_HDRSIZE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _WAL_FRAME_HDRSIZE@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	add	w3, w8, w0
	ldr	w0, [x19, #28]
	mov	x1, x26
	mov	x2, x25
	bl	_sqlite3OsRead
	ldr	w8, [x24]
	cmp	w0, w8
	b.ne	LBB0_25
; %bb.24:                               ;   in Loop: Header=BB0_21 Depth=1
	ldr	w8, [sp, #48]
	sub	w8, w8, #1
	mul	w27, w8, w25
	mov	x0, x27
	bl	_IS_BIG_INT
	bl	_testcase
	ldr	w0, [x19, #24]
	mov	x1, x26
	mov	x2, x25
	mov	x3, x27
	bl	_sqlite3OsWrite
	mov	x27, x0
	ldr	w8, [x24]
	cmp	w0, w8
	b.eq	LBB0_20
	b	LBB0_26
LBB0_25:
	mov	x27, x0
LBB0_26:
	ldr	w8, [x24]
	cmp	w27, w8
	b.ne	LBB0_33
; %bb.27:
	mov	x0, x19
	bl	_walIndexHdr
	ldr	x8, [x0]
	cmp	x21, x8
	ldr	w26, [sp, #4]                   ; 4-byte Folded Reload
	b.ne	LBB0_31
; %bb.28:
	ldr	w8, [x19, #16]
	mul	w25, w25, w8
	mov	x0, x25
	bl	_IS_BIG_INT
	bl	_testcase
	ldr	w0, [x19, #24]
	mov	x1, x25
	bl	_sqlite3OsTruncate
	mov	x27, x0
	cbz	w26, LBB0_31
; %bb.29:
	ldr	w8, [x24]
	cmp	w27, w8
	b.ne	LBB0_31
; %bb.30:
	ldr	w0, [x19, #24]
	mov	x1, x26
	bl	_sqlite3OsSync
	mov	x27, x0
LBB0_31:
	ldr	w8, [x24]
	cmp	w27, w8
	b.ne	LBB0_33
; %bb.32:
	str	x21, [x22]
LBB0_33:
	mov	w0, #0
	bl	_WAL_READ_LOCK
	mov	x1, x0
	mov	x0, x19
	mov	w2, #1
	bl	_walUnlockExclusive
LBB0_34:
Lloh21:
	adrp	x28, _SQLITE_BUSY@GOTPAGE
Lloh22:
	ldr	x28, [x28, _SQLITE_BUSY@GOTPAGEOFF]
	ldr	w8, [x28]
	ldr	w25, [x24]
	cmp	w27, w8
	csel	w27, w25, w27, eq
Lloh23:
	adrp	x8, _SQLITE_CHECKPOINT_PASSIVE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SQLITE_CHECKPOINT_PASSIVE@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	cmp	w27, w25
	ldr	w26, [sp, #20]                  ; 4-byte Folded Reload
	ccmp	w8, w26, #4, eq
	b.eq	LBB0_40
; %bb.35:
	ldr	w0, [x19]
	bl	_assert
	ldr	x9, [x22]
	ldr	x8, [x19, #8]
	cmp	x9, x8
	b.ge	LBB0_37
; %bb.36:
	ldr	w27, [x28]
	b	LBB0_40
LBB0_37:
Lloh26:
	adrp	x9, _SQLITE_CHECKPOINT_RESTART@GOTPAGE
Lloh27:
	ldr	x9, [x9, _SQLITE_CHECKPOINT_RESTART@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	mov	x27, x25
	cmp	w9, w26
Lloh29:
	adrp	x9, _WAL_NREADER@GOTPAGE
Lloh30:
	ldr	x9, [x9, _WAL_NREADER@GOTPAGEOFF]
	b.ne	LBB0_40
; %bb.38:
	cmp	x21, x8
	cset	w0, eq
	mov	x21, x9
	bl	_assert
	mov	w0, #1
	bl	_WAL_READ_LOCK
	mov	x3, x0
	ldr	w8, [x21]
	sub	w4, w8, #1
	mov	x0, x19
	mov	x1, x23
	mov	x2, x20
	bl	_walBusyLock
	mov	x27, x0
	ldr	w8, [x24]
	cmp	w0, w8
	b.ne	LBB0_40
; %bb.39:
	mov	w0, #1
	bl	_WAL_READ_LOCK
	mov	x1, x0
	ldr	w8, [x21]
	sub	w2, w8, #1
	mov	x0, x19
	bl	_walUnlockExclusive
LBB0_40:
	ldr	x0, [sp, #56]
	bl	_walIteratorFree
LBB0_41:
	mov	x0, x27
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.comm	_SQLITE_CHECKPOINT_PASSIVE,4,2  ; @SQLITE_CHECKPOINT_PASSIVE
	.comm	_WAL_NREADER,4,2                ; @WAL_NREADER
	.comm	_READMARK_NOT_USED,8,3          ; @READMARK_NOT_USED
	.comm	_SQLITE_BUSY,4,2                ; @SQLITE_BUSY
	.comm	_SQLITE_FCNTL_SIZE_HINT,4,2     ; @SQLITE_FCNTL_SIZE_HINT
	.comm	_WAL_FRAME_HDRSIZE,4,2          ; @WAL_FRAME_HDRSIZE
	.comm	_SQLITE_CHECKPOINT_RESTART,4,2  ; @SQLITE_CHECKPOINT_RESTART
	.no_dead_strip	_walCheckpoint
.subsections_via_symbols
