	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function writeFile
_writeFile:                             ## @writeFile
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r14
	movl	%ecx, %r13d
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	%ecx, %edi
	callq	_S_ISLNK
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%rbx, %rdi
	callq	_sqlite3_value_text
	movq	%rax, %rdi
	movq	%r15, %rsi
	callq	_symlink
	testq	%rax, %rax
	js	LBB0_10
LBB0_2:
	testq	%r14, %r14
	js	LBB0_4
## %bb.3:
	movq	$0, -56(%rbp)
	movq	$0, -72(%rbp)
	xorl	%edi, %edi
	callq	_time
	movq	%rax, -80(%rbp)
	movq	%r14, -64(%rbp)
	leaq	-80(%rbp), %rsi
	movq	%r15, %rdi
	callq	_utimes
	movq	%rax, %rcx
	movl	$1, %eax
	testq	%rcx, %rcx
	jne	LBB0_11
LBB0_4:
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_5:
	movl	%r13d, %edi
	callq	_S_ISDIR
	testq	%rax, %rax
	je	LBB0_13
## %bb.6:
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_mkdir
	testq	%rax, %rax
	je	LBB0_2
## %bb.7:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EEXIST@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.8:
	leaq	-80(%rbp), %rsi
	movq	%r15, %rdi
	callq	_fileStat
	testq	%rax, %rax
	jne	LBB0_10
## %bb.22:
	movl	-80(%rbp), %edi
	callq	_S_ISDIR
	testq	%rax, %rax
	je	LBB0_10
## %bb.23:
	movl	$511, %eax                      ## imm = 0x1FF
	andl	-80(%rbp), %eax
	andl	$511, %r13d                     ## imm = 0x1FF
	cmpl	%r13d, %eax
	je	LBB0_2
## %bb.24:
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_chmod
	testq	%rax, %rax
	jne	LBB0_10
	jmp	LBB0_2
LBB0_13:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_10
## %bb.14:
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_sqlite3_value_blob
	testq	%rax, %rax
	je	LBB0_19
## %bb.15:
	movq	%rbx, %rdi
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	callq	_sqlite3_value_bytes
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movl	$1, %esi
	movq	%rax, %rdx
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	callq	_fwrite
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_sqlite3_value_bytes
	movq	%rax, %rbx
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	callq	_fclose
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	testl	%r13d, %r13d
	je	LBB0_17
## %bb.16:
	cmpq	%rcx, %rbx
	je	LBB0_20
LBB0_17:
	movl	$2, %eax
	cmpq	%rcx, %rbx
	jne	LBB0_11
	jmp	LBB0_21
LBB0_10:
	movl	$1, %eax
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_25
## %bb.12:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	callq	_fclose
	xorl	%ebx, %ebx
	testl	%r13d, %r13d
	je	LBB0_21
LBB0_20:
	andl	$511, %r13d                     ## imm = 0x1FF
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_chmod
	movq	%rax, %rcx
	movl	$2, %eax
	testq	%rcx, %rcx
	jne	LBB0_11
LBB0_21:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_sqlite3_result_int64
	jmp	LBB0_2
LBB0_25:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,8,3                      ## @errno
	.comm	_EEXIST,8,3                     ## @EEXIST
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wb"

	.comm	_AT_FDCWD,4,2                   ## @AT_FDCWD
	.comm	_AT_SYMLINK_NOFOLLOW,4,2        ## @AT_SYMLINK_NOFOLLOW
	.comm	_FILE_FLAG_BACKUP_SEMANTICS,4,2 ## @FILE_FLAG_BACKUP_SEMANTICS
	.comm	_FILE_WRITE_ATTRIBUTES,4,2      ## @FILE_WRITE_ATTRIBUTES
	.comm	_INVALID_HANDLE_VALUE,8,3       ## @INVALID_HANDLE_VALUE
	.comm	_OPEN_EXISTING,4,2              ## @OPEN_EXISTING
	.no_dead_strip	_writeFile
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function writeFile
_writeFile:                             ; @writeFile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x4
	mov	x21, x3
	mov	x23, x2
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	mov	x0, x3
	bl	_S_ISLNK
	cbz	x0, LBB0_5
; %bb.1:
	mov	x0, x23
	bl	_sqlite3_value_text
	mov	x1, x19
	bl	_symlink
	tbnz	x0, #63, LBB0_17
LBB0_2:
	tbnz	x20, #63, LBB0_4
; %bb.3:
	str	xzr, [sp, #32]
	str	xzr, [sp, #16]
	mov	w0, #0
	bl	_time
	str	x0, [sp, #8]
	str	x20, [sp, #24]
	add	x1, sp, #8
	mov	x0, x19
	bl	_utimes
	cbnz	x0, LBB0_17
LBB0_4:
	mov	w0, #0
	b	LBB0_18
LBB0_5:
	mov	x0, x21
	bl	_S_ISDIR
	cbz	x0, LBB0_12
; %bb.6:
	mov	x0, x19
	mov	x1, x21
	bl	_mkdir
	cbz	x0, LBB0_2
; %bb.7:
Lloh3:
	adrp	x8, _errno@GOTPAGE
Lloh4:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
Lloh6:
	adrp	x9, _EEXIST@GOTPAGE
Lloh7:
	ldr	x9, [x9, _EEXIST@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_17
; %bb.8:
	add	x1, sp, #8
	mov	x0, x19
	bl	_fileStat
	cbnz	x0, LBB0_17
; %bb.9:
	ldr	w0, [sp, #8]
	bl	_S_ISDIR
	cbz	x0, LBB0_17
; %bb.10:
	ldr	w8, [sp, #8]
	and	w8, w8, #0x1ff
	and	w1, w21, #0x1ff
	cmp	w8, w1
	b.eq	LBB0_2
; %bb.11:
	mov	x0, x19
	bl	_chmod
	cbnz	x0, LBB0_17
	b	LBB0_2
LBB0_12:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_fopen
	cbz	x0, LBB0_17
; %bb.13:
	mov	x24, x0
	mov	x0, x23
	bl	_sqlite3_value_blob
	cbz	x0, LBB0_20
; %bb.14:
	mov	x25, x0
	mov	x0, x23
	bl	_sqlite3_value_bytes
	mov	x2, x0
	mov	x0, x25
	mov	w1, #1
	mov	x3, x24
	bl	_fwrite
	mov	x25, x0
	mov	x0, x23
	bl	_sqlite3_value_bytes
	mov	x23, x0
	mov	x0, x24
	bl	_fclose
	cbz	w21, LBB0_16
; %bb.15:
	cmp	x23, x25
	b.eq	LBB0_21
LBB0_16:
	cmp	x23, x25
	b.eq	LBB0_23
	b	LBB0_22
LBB0_17:
	mov	w0, #1
LBB0_18:
	ldr	x8, [sp, #40]
Lloh11:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_24
; %bb.19:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_20:
	mov	x0, x24
	bl	_fclose
	mov	x23, #0
	cbz	w21, LBB0_23
LBB0_21:
	and	w1, w21, #0x1ff
	mov	x0, x19
	bl	_chmod
	cbz	x0, LBB0_23
LBB0_22:
	mov	w0, #2
	b	LBB0_18
LBB0_23:
	mov	x0, x22
	mov	x1, x23
	bl	_sqlite3_result_int64
	b	LBB0_2
LBB0_24:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,8,3                      ; @errno
	.comm	_EEXIST,8,3                     ; @EEXIST
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wb"

	.comm	_AT_FDCWD,4,2                   ; @AT_FDCWD
	.comm	_AT_SYMLINK_NOFOLLOW,4,2        ; @AT_SYMLINK_NOFOLLOW
	.comm	_FILE_FLAG_BACKUP_SEMANTICS,4,2 ; @FILE_FLAG_BACKUP_SEMANTICS
	.comm	_FILE_WRITE_ATTRIBUTES,4,2      ; @FILE_WRITE_ATTRIBUTES
	.comm	_INVALID_HANDLE_VALUE,8,3       ; @INVALID_HANDLE_VALUE
	.comm	_OPEN_EXISTING,4,2              ; @OPEN_EXISTING
	.no_dead_strip	_writeFile
.subsections_via_symbols
