	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_prepareFile                    ## -- Begin function prepareFile
	.p2align	4, 0x90
_prepareFile:                           ## @prepareFile
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	_O_CREAT@GOTPCREL(%rip), %rax
	movq	_O_TRUNC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_S_IRWXU@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_open
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.2:
	movl	%eax, %r15d
	movq	_wbuffer@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_FILESIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movl	%r15d, %edi
	callq	_write
	testl	%eax, %eax
	js	LBB0_3
## %bb.5:
	movl	%r15d, %edi
	callq	_fsync
	testl	%eax, %eax
	jne	LBB0_6
## %bb.7:
	movl	(%r12), %esi
	movq	_PROT_READ@GOTPCREL(%rip), %rax
	movq	_PROT_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_MAP_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%edi, %edi
	movl	%r15d, %r8d
	xorl	%r9d, %r9d
	callq	_mmap
	movq	%rax, %rbx
	movq	_MAP_FAILED@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	je	LBB0_8
## %bb.9:
	movl	(%r12), %esi
	movq	_MS_INVALIDATE@GOTPCREL(%rip), %rax
	movq	_MS_SYNC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_msync
	testl	%eax, %eax
	jne	LBB0_10
## %bb.11:
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_munmap
	movl	%r15d, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_perror
	movl	$-1, %eax
	jmp	LBB0_12
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_4
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_4
LBB0_8:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_4
LBB0_10:
	leaq	L_.str.4(%rip), %rdi
LBB0_4:
	callq	_perror
	movl	$1, %eax
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_TRUNC,4,2                    ## @O_TRUNC
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_S_IRWXU,4,2                    ## @S_IRWXU
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Creating file"

	.comm	_wbuffer,4,2                    ## @wbuffer
	.comm	_FILESIZE,4,2                   ## @FILESIZE
L_.str.1:                               ## @.str.1
	.asciz	"Write failed"

L_.str.2:                               ## @.str.2
	.asciz	"fsync failed"

	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_PROT_WRITE,4,2                 ## @PROT_WRITE
	.comm	_MAP_SHARED,4,2                 ## @MAP_SHARED
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
L_.str.3:                               ## @.str.3
	.asciz	"Mmap failed"

	.comm	_MS_INVALIDATE,4,2              ## @MS_INVALIDATE
	.comm	_MS_SYNC,4,2                    ## @MS_SYNC
L_.str.4:                               ## @.str.4
	.asciz	"Msync failed"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_prepareFile                    ; -- Begin function prepareFile
	.p2align	2
_prepareFile:                           ; @prepareFile
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x1
Lloh0:
	adrp	x8, _O_CREAT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_CREAT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _O_TRUNC@GOTPAGE
Lloh4:
	ldr	x9, [x9, _O_TRUNC@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _O_RDWR@GOTPAGE
Lloh7:
	ldr	x10, [x10, _O_RDWR@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh8:
	ldr	w9, [x10]
	orr	w1, w8, w9
Lloh9:
	adrp	x8, _S_IRWXU@GOTPAGE
Lloh10:
	ldr	x8, [x8, _S_IRWXU@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	bl	_open
	cmn	w0, #1
	b.eq	LBB0_6
; %bb.1:
	mov	x20, x0
Lloh12:
	adrp	x8, _wbuffer@GOTPAGE
Lloh13:
	ldr	x8, [x8, _wbuffer@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x22, _FILESIZE@GOTPAGE
Lloh16:
	ldr	x22, [x22, _FILESIZE@GOTPAGEOFF]
	ldr	w2, [x22]
	bl	_write
	tbnz	w0, #31, LBB0_7
; %bb.2:
	mov	x0, x20
	bl	_fsync
	cbnz	w0, LBB0_8
; %bb.3:
	ldr	w1, [x22]
Lloh17:
	adrp	x8, _PROT_READ@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PROT_READ@GOTPAGEOFF]
Lloh19:
	adrp	x9, _PROT_WRITE@GOTPAGE
Lloh20:
	ldr	x9, [x9, _PROT_WRITE@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
Lloh22:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh23:
	adrp	x8, _MAP_SHARED@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MAP_SHARED@GOTPAGEOFF]
Lloh25:
	ldr	w3, [x8]
	mov	x0, #0
	mov	x4, x20
	mov	w5, #0
	bl	_mmap
Lloh26:
	adrp	x8, _MAP_FAILED@GOTPAGE
Lloh27:
	ldr	x8, [x8, _MAP_FAILED@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_9
; %bb.4:
	mov	x21, x0
Lloh29:
	adrp	x8, _MS_INVALIDATE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _MS_INVALIDATE@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh31:
	ldr	w8, [x8]
Lloh32:
	adrp	x9, _MS_SYNC@GOTPAGE
Lloh33:
	ldr	x9, [x9, _MS_SYNC@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	orr	w2, w9, w8
	bl	_msync
	cbnz	w0, LBB0_10
; %bb.5:
	ldr	w1, [x22]
	mov	x0, x21
	bl	_munmap
	mov	w0, #0
	str	w20, [x19]
	b	LBB0_12
LBB0_6:
Lloh35:
	adrp	x0, l_.str@PAGE
Lloh36:
	add	x0, x0, l_.str@PAGEOFF
	bl	_perror
	mov	w0, #-1
	b	LBB0_12
LBB0_7:
Lloh37:
	adrp	x0, l_.str.1@PAGE
Lloh38:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_11
LBB0_8:
Lloh39:
	adrp	x0, l_.str.2@PAGE
Lloh40:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_11
LBB0_9:
Lloh41:
	adrp	x0, l_.str.3@PAGE
Lloh42:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_11
LBB0_10:
Lloh43:
	adrp	x0, l_.str.4@PAGE
Lloh44:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_11:
	bl	_perror
	mov	w0, #1
LBB0_12:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh21
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpAdd	Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_TRUNC,4,2                    ; @O_TRUNC
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_S_IRWXU,4,2                    ; @S_IRWXU
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Creating file"

	.comm	_wbuffer,4,2                    ; @wbuffer
	.comm	_FILESIZE,4,2                   ; @FILESIZE
l_.str.1:                               ; @.str.1
	.asciz	"Write failed"

l_.str.2:                               ; @.str.2
	.asciz	"fsync failed"

	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_PROT_WRITE,4,2                 ; @PROT_WRITE
	.comm	_MAP_SHARED,4,2                 ; @MAP_SHARED
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
l_.str.3:                               ; @.str.3
	.asciz	"Mmap failed"

	.comm	_MS_INVALIDATE,4,2              ; @MS_INVALIDATE
	.comm	_MS_SYNC,4,2                    ; @MS_SYNC
l_.str.4:                               ; @.str.4
	.asciz	"Msync failed"

.subsections_via_symbols
