	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function writefileFunc
_writefileFunc:                         ## @writefileFunc
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	leal	-5(%rbx), %eax
	cmpl	$-4, %eax
	ja	LBB0_1
## %bb.20:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	$-1, %edx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sqlite3_result_error           ## TAILCALL
LBB0_1:
	movq	%rdx, %r13
	movq	(%rdx), %rdi
	callq	_sqlite3_value_text
	testq	%rax, %rax
	je	LBB0_19
## %bb.2:
	movq	%rax, %r14
	movl	$-1, %eax
	cmpl	$3, %ebx
	jb	LBB0_3
## %bb.4:
	movq	16(%r13), %rdi
	callq	_sqlite3_value_int
	movq	%rax, %r12
	cmpl	$4, %ebx
	jne	LBB0_5
## %bb.6:
	movq	24(%r13), %rdi
	callq	_sqlite3_value_int64
	jmp	LBB0_7
LBB0_3:
	xorl	%r12d, %r12d
	jmp	LBB0_7
LBB0_5:
	movl	$-1, %eax
LBB0_7:
	movq	8(%r13), %rdx
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, %rcx
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%eax, %r8d
	callq	_writeFile
	movl	%eax, %r12d
	cmpl	$1, %eax
	jne	LBB0_11
## %bb.8:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	movl	$1, %r12d
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.9:
	movq	%r14, %rdi
	callq	_makeDirectory
	movq	_SQLITE_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.10:
	movq	8(%r13), %rdx
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	callq	_writeFile
	movl	%eax, %r12d
LBB0_11:
	cmpl	$3, %ebx
	jb	LBB0_19
## %bb.12:
	testl	%r12d, %r12d
	je	LBB0_19
## %bb.13:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_S_ISLNK
	testq	%rax, %rax
	je	LBB0_16
## %bb.14:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_15
LBB0_19:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	%rbx, %rdi
	callq	_S_ISDIR
	testq	%rax, %rax
	je	LBB0_18
## %bb.17:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_15
LBB0_18:
	leaq	L_.str.3(%rip), %rsi
LBB0_15:
	movq	%r15, %rdi
	movq	%r14, %rdx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ctxErrorMsg                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wrong number of arguments to function writefile()"

	.comm	_errno,8,3                      ## @errno
	.comm	_ENOENT,8,3                     ## @ENOENT
	.comm	_SQLITE_OK,8,3                  ## @SQLITE_OK
L_.str.1:                               ## @.str.1
	.asciz	"failed to create symlink: %s"

L_.str.2:                               ## @.str.2
	.asciz	"failed to create directory: %s"

L_.str.3:                               ## @.str.3
	.asciz	"failed to write file: %s"

	.no_dead_strip	_writefileFunc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function writefileFunc
_writefileFunc:                         ; @writefileFunc
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	sub	w8, w1, #5
	cmn	w8, #4
	b.hi	LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	w2, #-1
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_sqlite3_result_error
LBB0_2:
	mov	x23, x2
	mov	x21, x1
	ldr	x0, [x2]
	bl	_sqlite3_value_text
	cbz	x0, LBB0_20
; %bb.3:
	mov	x20, x0
	cmp	w21, #3
	b.lo	LBB0_6
; %bb.4:
	ldr	x0, [x23, #16]
	bl	_sqlite3_value_int
	mov	x22, x0
	cmp	w21, #4
	b.ne	LBB0_7
; %bb.5:
	ldr	x0, [x23, #24]
	bl	_sqlite3_value_int64
	mov	x24, x0
	b	LBB0_8
LBB0_6:
	mov	x22, #0
LBB0_7:
	mov	w24, #-1
LBB0_8:
	ldr	x2, [x23, #8]
	mov	x0, x19
	mov	x1, x20
	mov	x3, x22
	mov	x4, x24
	bl	_writeFile
	cmp	w0, #1
	b.ne	LBB0_13
; %bb.9:
Lloh2:
	adrp	x8, _errno@GOTPAGE
Lloh3:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
Lloh5:
	adrp	x9, _ENOENT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ENOENT@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.10:
	mov	x0, x20
	bl	_makeDirectory
Lloh8:
	adrp	x8, _SQLITE_OK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SQLITE_OK@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_19
; %bb.11:
	ldr	x2, [x23, #8]
	mov	x0, x19
	mov	x1, x20
	mov	x3, x22
	mov	x4, x24
	bl	_writeFile
	cmp	w21, #3
	b.hs	LBB0_14
	b	LBB0_20
LBB0_12:
	mov	w0, #1
LBB0_13:
	cmp	w21, #3
	b.lo	LBB0_20
LBB0_14:
	cbz	w0, LBB0_20
; %bb.15:
	mov	x0, x22
	bl	_S_ISLNK
	cbz	x0, LBB0_17
; %bb.16:
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_22
LBB0_17:
	mov	x0, x22
	bl	_S_ISDIR
	cbz	x0, LBB0_21
; %bb.18:
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_22
LBB0_19:
	mov	w0, #1
	cmp	w21, #3
	b.hs	LBB0_14
LBB0_20:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_21:
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_22:
	mov	x0, x19
	mov	x2, 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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_ctxErrorMsg
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wrong number of arguments to function writefile()"

	.comm	_errno,8,3                      ; @errno
	.comm	_ENOENT,8,3                     ; @ENOENT
	.comm	_SQLITE_OK,8,3                  ; @SQLITE_OK
l_.str.1:                               ; @.str.1
	.asciz	"failed to create symlink: %s"

l_.str.2:                               ; @.str.2
	.asciz	"failed to create directory: %s"

l_.str.3:                               ; @.str.3
	.asciz	"failed to write file: %s"

	.no_dead_strip	_writefileFunc
.subsections_via_symbols
