	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function walRestartHdr
_walRestartHdr:                         ## @walRestartHdr
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	%esi, -28(%rbp)
	callq	_walCkptInfo
	movq	%rax, %rbx
	movq	(%r14), %r15
	incl	16(%r14)
	movq	$0, 8(%r14)
	movq	%r15, %rdi
	callq	_sqlite3Get4byte
	leaq	1(%rax), %rsi
	movq	%r15, %rdi
	callq	_sqlite3Put4byte
	movq	(%r14), %rdi
	addq	$4, %rdi
	leaq	-28(%rbp), %rsi
	movl	$4, %edx
	callq	_memcpy
	movq	%r14, %rdi
	callq	_walIndexWriteHdr
	movq	$0, 16(%rbx)
	movq	$0, 8(%rbx)
	movq	(%rbx), %rax
	movq	$0, 8(%rax)
	movq	_WAL_NREADER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	cmpl	$3, %esi
	jl	LBB0_7
## %bb.1:
	leaq	-2(%rsi), %r8
	addq	$-3, %rsi
	movl	%r8d, %eax
	andl	$3, %eax
	movl	$2, %ecx
	cmpq	$3, %rsi
	jb	LBB0_4
## %bb.2:
	andq	$-4, %r8
	negq	%r8
	movl	$2, %ecx
	movq	_READMARK_NOT_USED@GOTPCREL(%rip), %rsi
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rsi), %rdi
	movq	(%rbx), %rdx
	movq	%rdi, (%rdx,%rcx,8)
	movq	(%rsi), %rdx
	movq	(%rbx), %rdi
	movq	%rdx, 8(%rdi,%rcx,8)
	movq	(%rsi), %rdx
	movq	(%rbx), %rdi
	movq	%rdx, 16(%rdi,%rcx,8)
	movq	(%rsi), %rdx
	movq	(%rbx), %rdi
	movq	%rdx, 24(%rdi,%rcx,8)
	leaq	(%r8,%rcx), %rdx
	addq	$4, %rdx
	addq	$4, %rcx
	cmpq	$2, %rdx
	jne	LBB0_3
LBB0_4:
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	movq	_READMARK_NOT_USED@GOTPCREL(%rip), %rdx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rdx), %rsi
	movq	(%rbx), %rdi
	movq	%rsi, (%rdi,%rcx,8)
	incq	%rcx
	decq	%rax
	jne	LBB0_6
LBB0_7:
	movq	(%rbx), %rax
	xorl	%edi, %edi
	cmpq	$0, (%rax)
	sete	%dil
	callq	_assert
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WAL_NREADER,4,2                ## @WAL_NREADER
	.comm	_READMARK_NOT_USED,8,3          ## @READMARK_NOT_USED
	.no_dead_strip	_walRestartHdr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function walRestartHdr
_walRestartHdr:                         ; @walRestartHdr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x0
	str	w1, [sp, #12]
	bl	_walCkptInfo
	mov	x19, x0
	ldr	x21, [x20]
	ldr	w8, [x20, #16]
	add	w8, w8, #1
	str	w8, [x20, #16]
	str	xzr, [x20, #8]
	mov	x0, x21
	bl	_sqlite3Get4byte
	add	x1, x0, #1
	mov	x0, x21
	bl	_sqlite3Put4byte
	ldr	x8, [x20]
	add	x0, x8, #4
	add	x1, sp, #12
	mov	w2, #4
	bl	_memcpy
	mov	x0, x20
	bl	_walIndexWriteHdr
	str	xzr, [x19, #16]
	str	xzr, [x19, #8]
	ldr	x8, [x19]
	str	xzr, [x8, #8]
Lloh0:
	adrp	x8, _WAL_NREADER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WAL_NREADER@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #3
	b.lt	LBB0_3
; %bb.1:
	lsl	x8, x8, #3
	mov	w9, #16
Lloh3:
	adrp	x10, _READMARK_NOT_USED@GOTPAGE
Lloh4:
	ldr	x10, [x10, _READMARK_NOT_USED@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x10]
	ldr	x12, [x19]
	str	x11, [x12, x9]
	add	x9, x9, #8
	cmp	x8, x9
	b.ne	LBB0_2
LBB0_3:
	ldr	x8, [x19]
	ldr	x8, [x8]
	cmp	x8, #0
	cset	w0, eq
	bl	_assert
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_WAL_NREADER,4,2                ; @WAL_NREADER
	.comm	_READMARK_NOT_USED,8,3          ; @READMARK_NOT_USED
	.no_dead_strip	_walRestartHdr
.subsections_via_symbols
