	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function apndOpen
_apndOpen:                              ## @apndOpen
	.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	%r8, %rbx
	movl	%ecx, %r12d
	movq	%rdx, %r14
	movq	%rsi, %r15
	callq	_ORIGVFS
	movq	%rax, %r13
	movq	_SQLITE_OPEN_MAIN_DB@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_14
## %bb.1:
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movq	%r14, %rdi
	callq	_ORIGFILE
	movq	_apnd_io_methods@GOTPCREL(%rip), %rcx
	movq	%rcx, 16(%r14)
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	%rax, %r15
	movq	%rax, %rdx
	movl	%r12d, %ecx
	movq	%rbx, %r8
	callq	*(%r13)
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.2:
	movq	(%r15), %rax
	leaq	-44(%rbp), %rsi
	movq	%r15, %rdi
	callq	*(%rax)
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movl	%eax, %ebx
	movq	(%r15), %rax
	movq	%r15, %rdi
	callq	*8(%rax)
LBB0_4:
	movq	$0, (%r14)
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	(%r13), %rax
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	%r12d, %ecx
	movq	%rbx, %r8
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
LBB0_5:
	movl	-44(%rbp), %edi
	movq	%r15, %rsi
	callq	_apndIsOrdinaryDatabaseFile
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	8(%r13), %edx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_memmove
	jmp	LBB0_8
LBB0_7:
	movq	$0, 8(%r14)
	movl	-44(%rbp), %edi
	movq	%r14, %rsi
	callq	_apndReadMark
	movl	%eax, (%r14)
	testl	%eax, %eax
	jle	LBB0_9
LBB0_8:
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_13
LBB0_9:
	movq	_SQLITE_OPEN_CREATE@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_11
## %bb.10:
	movl	$4095, %eax                     ## imm = 0xFFF
	addl	-44(%rbp), %eax
	andl	$-4096, %eax                    ## imm = 0xF000
	movl	%eax, (%r14)
	jmp	LBB0_12
LBB0_11:
	movq	(%r15), %rax
	movq	%r15, %rdi
	callq	*8(%rax)
	movq	_SQLITE_CANTOPEN@GOTPCREL(%rip), %rax
	movl	$4095, %ecx                     ## imm = 0xFFF
	addl	-44(%rbp), %ecx
	movl	(%rax), %ebx
	andl	$-4096, %ecx                    ## imm = 0xF000
	movl	%ecx, (%r14)
	testl	%ebx, %ebx
	jne	LBB0_4
LBB0_12:
	xorl	%ebx, %ebx
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_SQLITE_OPEN_MAIN_DB,4,2        ## @SQLITE_OPEN_MAIN_DB
	.comm	_apnd_io_methods,4,2            ## @apnd_io_methods
	.comm	_SQLITE_OK,4,2                  ## @SQLITE_OK
	.comm	_SQLITE_OPEN_CREATE,4,2         ## @SQLITE_OPEN_CREATE
	.comm	_SQLITE_CANTOPEN,4,2            ## @SQLITE_CANTOPEN
	.no_dead_strip	_apndOpen
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function apndOpen
_apndOpen:                              ; @apndOpen
	.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
	mov	x23, x4
	mov	x20, x3
	mov	x19, x2
	mov	x24, x1
	bl	_ORIGVFS
	mov	x22, x0
Lloh0:
	adrp	x8, _SQLITE_OPEN_MAIN_DB@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SQLITE_OPEN_MAIN_DB@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_6
; %bb.1:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	mov	x0, x19
	bl	_ORIGFILE
	mov	x21, x0
Lloh3:
	adrp	x8, _apnd_io_methods@GOTPAGE
Lloh4:
	ldr	x8, [x8, _apnd_io_methods@GOTPAGEOFF]
	str	x8, [x19, #16]
	ldr	x8, [x22]
	mov	x0, x22
	mov	x1, x24
	mov	x2, x21
	mov	x3, x20
	mov	x4, x23
	blr	x8
	mov	x23, x0
	cbnz	w0, LBB0_4
; %bb.2:
	ldr	x8, [x21]
	ldr	x8, [x8]
	add	x1, sp, #12
	mov	x0, x21
	blr	x8
	cbz	w0, LBB0_7
; %bb.3:
	mov	x23, x0
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	mov	x0, x21
	blr	x8
LBB0_4:
	str	xzr, [x19]
LBB0_5:
	mov	x0, x23
	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
LBB0_6:
	ldr	x5, [x22]
	mov	x0, x22
	mov	x1, x24
	mov	x2, x19
	mov	x3, x20
	mov	x4, x23
	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
	br	x5
LBB0_7:
	ldr	w0, [sp, #12]
	mov	x1, x21
	bl	_apndIsOrdinaryDatabaseFile
	cbz	x0, LBB0_9
; %bb.8:
	ldr	w2, [x22, #8]
	mov	x0, x19
	mov	x1, x21
	bl	_memmove
	b	LBB0_10
LBB0_9:
	str	xzr, [x19, #8]
	ldr	w0, [sp, #12]
	mov	x1, x19
	bl	_apndReadMark
	str	w0, [x19]
	cmp	w0, #1
	b.lt	LBB0_11
LBB0_10:
Lloh5:
	adrp	x8, _SQLITE_OK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SQLITE_OK@GOTPAGEOFF]
Lloh7:
	ldr	w23, [x8]
	b	LBB0_5
LBB0_11:
Lloh8:
	adrp	x8, _SQLITE_OPEN_CREATE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SQLITE_OPEN_CREATE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_13
; %bb.12:
	mov	w23, #0
	ldr	w8, [sp, #12]
	add	w8, w8, #4095
	and	w8, w8, #0xfffff000
	str	w8, [x19]
	b	LBB0_5
LBB0_13:
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	mov	x0, x21
	blr	x8
Lloh11:
	adrp	x8, _SQLITE_CANTOPEN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SQLITE_CANTOPEN@GOTPAGEOFF]
Lloh13:
	ldr	w23, [x8]
	ldr	w8, [sp, #12]
	add	w8, w8, #4095
	and	w8, w8, #0xfffff000
	str	w8, [x19]
	cbnz	w23, LBB0_4
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_OPEN_MAIN_DB,4,2        ; @SQLITE_OPEN_MAIN_DB
	.comm	_apnd_io_methods,4,2            ; @apnd_io_methods
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.comm	_SQLITE_OPEN_CREATE,4,2         ; @SQLITE_OPEN_CREATE
	.comm	_SQLITE_CANTOPEN,4,2            ; @SQLITE_CANTOPEN
	.no_dead_strip	_apndOpen
.subsections_via_symbols
