	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pagerOpenWalIfPresent
_pagerOpenWalIfPresent:                 ## @pagerOpenWalIfPresent
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_SQLITE_OK@GOTPCREL(%rip), %r15
	movl	(%r15), %r14d
	movq	(%rdi), %rax
	movq	_PAGER_OPEN@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_assert
	movq	8(%rbx), %rax
	movq	_SHARED_LOCK@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setge	%dil
	callq	_assert
	cmpl	$0, 36(%rbx)
	jne	LBB0_10
## %bb.1:
	movl	28(%rbx), %esi
	movl	32(%rbx), %edi
	movq	_SQLITE_ACCESS_EXISTS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-28(%rbp), %rcx
	callq	_sqlite3OsAccess
	movl	%eax, %r14d
	cmpl	(%r15), %eax
	jne	LBB0_10
## %bb.2:
	cmpl	$0, -28(%rbp)
	je	LBB0_6
## %bb.3:
	leaq	-40(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_pagerPagecount
	testl	%eax, %eax
	jne	LBB0_9
## %bb.4:
	cmpq	$0, -40(%rbp)
	je	LBB0_5
## %bb.8:
	movl	24(%rbx), %edi
	callq	_sqlite3PcachePagecount
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_testcase
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_sqlite3PagerOpenWal
	jmp	LBB0_9
LBB0_6:
	movq	16(%rbx), %rax
	movq	_PAGER_JOURNALMODE_WAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.7:
	movq	_PAGER_JOURNALMODE_DELETE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rbx)
	jmp	LBB0_10
LBB0_5:
	movl	28(%rbx), %esi
	movl	32(%rbx), %edi
	xorl	%edx, %edx
	callq	_sqlite3OsDelete
LBB0_9:
	movl	%eax, %r14d
LBB0_10:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SQLITE_OK,4,2                  ## @SQLITE_OK
	.comm	_PAGER_OPEN,8,3                 ## @PAGER_OPEN
	.comm	_SHARED_LOCK,8,3                ## @SHARED_LOCK
	.comm	_SQLITE_ACCESS_EXISTS,4,2       ## @SQLITE_ACCESS_EXISTS
	.comm	_PAGER_JOURNALMODE_WAL,8,3      ## @PAGER_JOURNALMODE_WAL
	.comm	_PAGER_JOURNALMODE_DELETE,8,3   ## @PAGER_JOURNALMODE_DELETE
	.no_dead_strip	_pagerOpenWalIfPresent
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pagerOpenWalIfPresent
_pagerOpenWalIfPresent:                 ; @pagerOpenWalIfPresent
	.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	x19, x0
Lloh0:
	adrp	x21, _SQLITE_OK@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SQLITE_OK@GOTPAGEOFF]
	ldr	w20, [x21]
	ldr	x8, [x0]
Lloh2:
	adrp	x9, _PAGER_OPEN@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PAGER_OPEN@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_assert
	ldr	x8, [x19, #8]
Lloh5:
	adrp	x9, _SHARED_LOCK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SHARED_LOCK@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, ge
	bl	_assert
	ldr	w8, [x19, #36]
	cbnz	w8, LBB0_10
; %bb.1:
	ldp	w1, w0, [x19, #28]
Lloh8:
	adrp	x8, _SQLITE_ACCESS_EXISTS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SQLITE_ACCESS_EXISTS@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	add	x3, sp, #12
	bl	_sqlite3OsAccess
	mov	x20, x0
	ldr	w8, [x21]
	cmp	w0, w8
	b.ne	LBB0_10
; %bb.2:
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_6
; %bb.3:
	mov	x1, sp
	mov	x0, x19
	bl	_pagerPagecount
	cbnz	w0, LBB0_9
; %bb.4:
	ldr	x8, [sp]
	cbz	x8, LBB0_8
; %bb.5:
	ldr	w0, [x19, #24]
	bl	_sqlite3PcachePagecount
	cmp	x0, #0
	cset	w0, eq
	bl	_testcase
	mov	x0, x19
	mov	w1, #0
	bl	_sqlite3PagerOpenWal
	b	LBB0_9
LBB0_6:
	ldr	x8, [x19, #16]
Lloh11:
	adrp	x9, _PAGER_JOURNALMODE_WAL@GOTPAGE
Lloh12:
	ldr	x9, [x9, _PAGER_JOURNALMODE_WAL@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.7:
Lloh14:
	adrp	x8, _PAGER_JOURNALMODE_DELETE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PAGER_JOURNALMODE_DELETE@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	str	x8, [x19, #16]
	b	LBB0_10
LBB0_8:
	ldp	w1, w0, [x19, #28]
	mov	w2, #0
	bl	_sqlite3OsDelete
LBB0_9:
	mov	x20, x0
LBB0_10:
	mov	x0, x20
	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	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.comm	_PAGER_OPEN,8,3                 ; @PAGER_OPEN
	.comm	_SHARED_LOCK,8,3                ; @SHARED_LOCK
	.comm	_SQLITE_ACCESS_EXISTS,4,2       ; @SQLITE_ACCESS_EXISTS
	.comm	_PAGER_JOURNALMODE_WAL,8,3      ; @PAGER_JOURNALMODE_WAL
	.comm	_PAGER_JOURNALMODE_DELETE,8,3   ; @PAGER_JOURNALMODE_DELETE
	.no_dead_strip	_pagerOpenWalIfPresent
.subsections_via_symbols
