	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function walRewriteChecksums
_walRewriteChecksums:                   ## @walRewriteChecksums
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	(%rdi), %ebx
	movq	_WAL_FRAME_HDRSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%r15, %rax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -104(%rbp)                ## 8-byte Spill
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	leal	(%r15,%rbx), %edi
	callq	_sqlite3_malloc
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	xorl	%edi, %edi
	cmpl	$0, 4(%r12)
	setg	%dil
	callq	_assert
	movl	4(%r12), %edi
	movl	$24, %ecx
	cmpl	$1, %edi
	je	LBB0_4
## %bb.3:
	decl	%edi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_walFrameOffset
	movl	%eax, %ecx
	addl	$16, %ecx
LBB0_4:
	movl	8(%r12), %edi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	movl	$8, %edx
	callq	_sqlite3OsRead
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_sqlite3Get4byte
	movq	16(%r12), %rcx
	movq	%rax, (%rcx)
	leaq	16(%rbx), %rdi
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	callq	_sqlite3Get4byte
	movq	16(%r12), %rcx
	movq	%rax, 8(%rcx)
	movl	4(%r12), %r14d
	movl	$0, 4(%r12)
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_11
## %bb.5:
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	cmpl	-52(%rbp), %r14d                ## 4-byte Folded Reload
	movq	_SQLITE_OK@GOTPCREL(%rip), %r12
	jg	LBB0_11
## %bb.6:
	leal	(,%r15,4), %eax
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r14d, %edi
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	_walFrameOffset
	movl	%eax, %r15d
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %edi
	movq	_WAL_FRAME_HDRSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	addl	%ebx, %edx
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%r15d, %ecx
	callq	_sqlite3OsRead
	movl	%eax, %r13d
	movl	(%r12), %eax
	cmpl	%eax, %r13d
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_sqlite3Get4byte
	movq	%rax, %r13
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	callq	_sqlite3Get4byte
	movq	_WAL_FRAME_HDRSIZE@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	leaq	(%rbx,%rcx,4), %rcx
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %r8
	callq	_walEncodeFrame
	movl	8(%r12), %edi
	movq	_SQLITE_OK@GOTPCREL(%rip), %r12
	movq	%rbx, %rsi
	movl	-68(%rbp), %edx                 ## 4-byte Reload
	movl	%r15d, %ecx
	callq	_sqlite3OsWrite
	movl	%eax, %r13d
	movl	(%r12), %eax
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	cmpl	%eax, %r13d
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	leal	1(%r14), %eax
	cmpl	-52(%rbp), %r14d                ## 4-byte Folded Reload
	movl	%eax, %r14d
	jl	LBB0_7
LBB0_11:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_sqlite3_free
	jmp	LBB0_12
LBB0_1:
	movq	_SQLITE_NOMEM_BKPT@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_14
## %bb.13:
	movl	%r13d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SQLITE_OK,4,2                  ## @SQLITE_OK
	.comm	_WAL_FRAME_HDRSIZE,4,2          ## @WAL_FRAME_HDRSIZE
	.comm	_SQLITE_NOMEM_BKPT,4,2          ## @SQLITE_NOMEM_BKPT
	.no_dead_strip	_walRewriteChecksums
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function walRewriteChecksums
_walRewriteChecksums:                   ; @walRewriteChecksums
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #32
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	ldr	w21, [x0]
Lloh3:
	adrp	x8, _WAL_FRAME_HDRSIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _WAL_FRAME_HDRSIZE@GOTPAGEOFF]
Lloh5:
	ldr	w26, [x8]
	lsl	x8, x26, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x22, x9, x8
	mov	sp, x22
	add	w0, w26, w21
	bl	_sqlite3_malloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x23, x0
	ldr	w8, [x20, #4]
	cmp	w8, #0
	cset	w0, gt
	bl	_assert
	ldr	w8, [x20, #4]
	subs	w0, w8, #1
	b.ne	LBB0_4
; %bb.2:
	mov	w3, #24
	b	LBB0_5
LBB0_3:
Lloh8:
	adrp	x8, _SQLITE_NOMEM_BKPT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SQLITE_NOMEM_BKPT@GOTPAGEOFF]
Lloh10:
	ldr	w27, [x8]
	b	LBB0_7
LBB0_4:
	mov	x1, x21
	bl	_walFrameOffset
	add	w3, w0, #16
LBB0_5:
	ldr	w0, [x20, #8]
	mov	x1, x23
	mov	w2, #8
	bl	_sqlite3OsRead
	mov	x27, x0
	mov	x0, x23
	bl	_sqlite3Get4byte
	ldr	x8, [x20, #16]
	str	x0, [x8]
	add	x0, x23, #16
	stur	x0, [x29, #-96]                 ; 8-byte Folded Spill
	bl	_sqlite3Get4byte
	ldr	x8, [x20, #16]
	str	x0, [x8, #8]
	ldr	w25, [x20, #4]
	str	wzr, [x20, #4]
Lloh11:
	adrp	x24, _SQLITE_OK@GOTPAGE
Lloh12:
	ldr	x24, [x24, _SQLITE_OK@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w27, w8
	ccmp	w25, w19, #0, eq
	b.le	LBB0_9
LBB0_6:
	mov	x0, x23
	bl	_sqlite3_free
LBB0_7:
	ldur	x8, [x29, #-88]
Lloh13:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.8:
	mov	x0, x27
	sub	sp, x29, #80
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_9:
	lsl	w8, w26, #2
	stur	w8, [x29, #-100]                ; 4-byte Folded Spill
Lloh16:
	adrp	x26, _WAL_FRAME_HDRSIZE@GOTPAGE
Lloh17:
	ldr	x26, [x26, _WAL_FRAME_HDRSIZE@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x23
	bl	_sqlite3Get4byte
	mov	x27, x0
	ldur	x0, [x29, #-96]                 ; 8-byte Folded Reload
	bl	_sqlite3Get4byte
	mov	x2, x0
	ldrsw	x8, [x26]
	add	x3, x23, x8, lsl #2
	mov	x0, x20
	mov	x1, x27
                                        ; kill: def $w2 killed $w2 killed $x2
	mov	x4, x22
	bl	_walEncodeFrame
	ldr	w0, [x20, #8]
	mov	x1, x22
	ldur	w2, [x29, #-100]                ; 4-byte Folded Reload
	mov	x3, x28
	bl	_sqlite3OsWrite
	mov	x27, x0
	ldr	w8, [x24]
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	cmp	w27, w8
	ccmp	w25, w19, #0, eq
	add	w25, w25, #1
	b.ge	LBB0_6
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x25
	mov	x1, x21
	bl	_walFrameOffset
	mov	x28, x0
	ldr	w0, [x20, #8]
	ldr	w8, [x26]
	add	w2, w8, w21
	mov	x1, x23
	mov	x3, x28
	bl	_sqlite3OsRead
	ldr	w8, [x24]
	cmp	w0, w8
	b.eq	LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x27, x0
	b	LBB0_11
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.comm	_WAL_FRAME_HDRSIZE,4,2          ; @WAL_FRAME_HDRSIZE
	.comm	_SQLITE_NOMEM_BKPT,4,2          ; @SQLITE_NOMEM_BKPT
	.no_dead_strip	_walRewriteChecksums
.subsections_via_symbols
