	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function walRestartLog
_walRestartLog:                         ## @walRestartLog
	.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
	movq	_SQLITE_OK@GOTPCREL(%rip), %r12
	cmpl	$0, (%rdi)
	je	LBB0_2
## %bb.1:
	movl	(%r12), %r15d
	jmp	LBB0_9
LBB0_2:
	movq	%rdi, %r14
	callq	_walCkptInfo
	movq	%rax, %rbx
	movq	(%rax), %rax
	xorl	%edi, %edi
	cmpq	8(%r14), %rax
	sete	%dil
	callq	_assert
	cmpq	$0, (%rbx)
	jle	LBB0_6
## %bb.3:
	leaq	-44(%rbp), %rsi
	movl	$4, %edi
	callq	_sqlite3_randomness
	movl	$1, %edi
	callq	_WAL_READ_LOCK
	movq	_WAL_NREADER@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdx
	decq	%rdx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_walLockExclusive
	cmpl	(%r12), %eax
	jne	LBB0_5
## %bb.4:
	movl	-44(%rbp), %esi
	movq	%r14, %rdi
	callq	_walRestartHdr
	movl	$1, %edi
	callq	_WAL_READ_LOCK
	movq	(%rbx), %rdx
	decq	%rdx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_walUnlockExclusive
	jmp	LBB0_6
LBB0_5:
	movl	%eax, %r15d
	movq	_SQLITE_BUSY@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jne	LBB0_9
LBB0_6:
	xorl	%edi, %edi
	callq	_WAL_READ_LOCK
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_walUnlockShared
	movl	$-1, (%r14)
	movl	$1, %ebx
	leaq	-48(%rbp), %r12
	movq	_WAL_RETRY@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	$1, %edx
	movl	%ebx, %ecx
	callq	_walTryBeginRead
	incl	%ebx
	cmpl	(%r13), %eax
	je	LBB0_7
## %bb.8:
	movl	%eax, %r15d
	movzbl	%r15b, %ebx
	movq	_SQLITE_BUSY@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpl	(%rax), %ebx
	setne	%dil
	callq	_assert
	movq	_SQLITE_IOERR@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpl	(%rax), %ebx
	sete	%dil
	callq	_testcase
	movq	_SQLITE_PROTOCOL@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpl	(%rax), %r15d
	sete	%dil
	callq	_testcase
	xorl	%edi, %edi
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	sete	%dil
	callq	_testcase
LBB0_9:
	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	_WAL_NREADER,8,3                ## @WAL_NREADER
	.comm	_SQLITE_BUSY,4,2                ## @SQLITE_BUSY
	.comm	_WAL_RETRY,4,2                  ## @WAL_RETRY
	.comm	_SQLITE_IOERR,4,2               ## @SQLITE_IOERR
	.comm	_SQLITE_PROTOCOL,4,2            ## @SQLITE_PROTOCOL
	.no_dead_strip	_walRestartLog
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function walRestartLog
_walRestartLog:                         ; @walRestartLog
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
Lloh0:
	adrp	x22, _SQLITE_OK@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SQLITE_OK@GOTPAGEOFF]
	ldr	w8, [x0]
	cbz	w8, LBB0_2
; %bb.1:
	ldr	w20, [x22]
	b	LBB0_9
LBB0_2:
	mov	x19, x0
	bl	_walCkptInfo
	mov	x20, x0
	ldr	x8, [x0]
	ldr	x9, [x19, #8]
	cmp	x8, x9
	cset	w0, eq
	bl	_assert
	ldr	x8, [x20]
Lloh2:
	adrp	x23, _SQLITE_BUSY@GOTPAGE
Lloh3:
	ldr	x23, [x23, _SQLITE_BUSY@GOTPAGEOFF]
	cmp	x8, #1
	b.lt	LBB0_6
; %bb.3:
	add	x1, sp, #12
	mov	w0, #4
	bl	_sqlite3_randomness
	mov	w0, #1
	bl	_WAL_READ_LOCK
	mov	x1, x0
Lloh4:
	adrp	x21, _WAL_NREADER@GOTPAGE
Lloh5:
	ldr	x21, [x21, _WAL_NREADER@GOTPAGEOFF]
	ldr	x8, [x21]
	sub	x2, x8, #1
	mov	x0, x19
	bl	_walLockExclusive
	ldr	w8, [x22]
	cmp	w0, w8
	b.ne	LBB0_5
; %bb.4:
	ldr	w1, [sp, #12]
	mov	x0, x19
	bl	_walRestartHdr
	mov	w0, #1
	bl	_WAL_READ_LOCK
	mov	x1, x0
	ldr	x8, [x21]
	sub	x2, x8, #1
	mov	x0, x19
	bl	_walUnlockExclusive
	b	LBB0_6
LBB0_5:
	mov	x20, x0
	ldr	w8, [x23]
	cmp	w0, w8
	b.ne	LBB0_9
LBB0_6:
	mov	w0, #0
	bl	_WAL_READ_LOCK
	mov	x1, x0
	mov	x0, x19
	bl	_walUnlockShared
	mov	w8, #-1
	str	w8, [x19]
	mov	w21, #1
Lloh6:
	adrp	x24, _WAL_RETRY@GOTPAGE
Lloh7:
	ldr	x24, [x24, _WAL_RETRY@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #1
	mov	x3, x21
	bl	_walTryBeginRead
	ldr	w8, [x24]
	add	w21, w21, #1
	cmp	w0, w8
	b.eq	LBB0_7
; %bb.8:
	mov	x20, x0
	and	w19, w0, #0xff
	ldr	w8, [x23]
	cmp	w19, w8
	cset	w0, ne
	bl	_assert
Lloh8:
	adrp	x8, _SQLITE_IOERR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SQLITE_IOERR@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w19, w8
	cset	w0, eq
	bl	_testcase
Lloh11:
	adrp	x8, _SQLITE_PROTOCOL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SQLITE_PROTOCOL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w20, w8
	cset	w0, eq
	bl	_testcase
	ldr	w8, [x22]
	cmp	w20, w8
	cset	w0, eq
	bl	_testcase
LBB0_9:
	mov	x0, x20
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.comm	_WAL_NREADER,8,3                ; @WAL_NREADER
	.comm	_SQLITE_BUSY,4,2                ; @SQLITE_BUSY
	.comm	_WAL_RETRY,4,2                  ; @WAL_RETRY
	.comm	_SQLITE_IOERR,4,2               ; @SQLITE_IOERR
	.comm	_SQLITE_PROTOCOL,4,2            ; @SQLITE_PROTOCOL
	.no_dead_strip	_walRestartLog
.subsections_via_symbols
