	.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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.1:
	movq	%rdi, %rbx
	movl	12(%rdi), %esi
	testl	%esi, %esi
	je	LBB0_5
## %bb.2:
	leaq	L_.str.1(%rip), %rdi
	callq	_DBG
	movl	12(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_fopen
	movl	12(%rbx), %esi
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	%rax, %r14
	leaq	L_.str.4(%rip), %rdi
	callq	_DBG
	movl	8(%rbx), %edi
	movq	(%rbx), %rdx
	movl	$1, %esi
	movq	%r14, %rcx
	callq	_fwrite
	cmpq	(%rbx), %rax
	jne	LBB0_7
## %bb.4:
	movq	%r14, %rdi
	callq	_fclose
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_5:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_ERR
	jmp	LBB0_8
LBB0_6:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_ERR
	jmp	LBB0_8
LBB0_7:
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_ERR
	movq	%r14, %rdi
	callq	_fclose
LBB0_8:
	movl	$-1, %eax
LBB0_9:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid pointer provided!\n"

L_.str.1:                               ## @.str.1
	.asciz	"Opening file: %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"w"

L_.str.3:                               ## @.str.3
	.asciz	"Error opening file: %s\n"

L_.str.4:                               ## @.str.4
	.asciz	"Writing file: %s\n"

L_.str.5:                               ## @.str.5
	.asciz	"Wanted to write, but something went wrong!\n"

	.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, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
	ldr	w1, [x0, #12]
	cbz	w1, LBB0_5
; %bb.2:
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DBG
	ldr	w0, [x19, #12]
Lloh2:
	adrp	x1, l_.str.2@PAGE
Lloh3:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_fopen
	ldr	w1, [x19, #12]
	cbz	x0, LBB0_6
; %bb.3:
	mov	x20, x0
Lloh4:
	adrp	x0, l_.str.4@PAGE
Lloh5:
	add	x0, x0, l_.str.4@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_DBG
	ldr	w0, [x19, #8]
	ldr	x2, [x19]
	mov	w1, #1
	mov	x3, x20
	bl	_fwrite
	ldr	x8, [x19]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.4:
	mov	x0, x20
	bl	_fclose
	mov	w0, #0
	b	LBB0_9
LBB0_5:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_7
LBB0_6:
	str	x1, [sp]
Lloh8:
	adrp	x0, l_.str.3@PAGE
Lloh9:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_7:
	bl	_ERR
LBB0_8:
	mov	w0, #-1
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_10:
Lloh10:
	adrp	x0, l_.str.5@PAGE
Lloh11:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_ERR
	mov	x0, x20
	bl	_fclose
	b	LBB0_8
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid pointer provided!\n"

l_.str.1:                               ; @.str.1
	.asciz	"Opening file: %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"w"

l_.str.3:                               ; @.str.3
	.asciz	"Error opening file: %s\n"

l_.str.4:                               ; @.str.4
	.asciz	"Writing file: %s\n"

l_.str.5:                               ; @.str.5
	.asciz	"Wanted to write, but something went wrong!\n"

	.no_dead_strip	_writeFile
.subsections_via_symbols
