	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function openfile
_openfile:                              ## @openfile
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_O_RDWR@GOTPCREL(%rip), %r15
	movq	_O_CREAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	(%r15), %esi
	movl	$420, %edx                      ## imm = 0x1A4
	xorl	%eax, %eax
	callq	_open
	movl	%eax, %ebx
	cmpl	$-1, %eax
	jne	LBB0_3
## %bb.1:
	movl	(%r15), %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_open
	movl	%eax, %ebx
	cmpl	$-1, %eax
	je	LBB0_2
LBB0_3:
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_ftruncate
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	callq	_eprintf
LBB0_5:
	movl	$1, %edi
	callq	_close
	movl	%ebx, %edi
	movl	$1, %esi
	callq	_dup2
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	$-1, %ebx
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not resize\n"

	.no_dead_strip	_openfile
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function openfile
_openfile:                              ; @openfile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x0
Lloh0:
	adrp	x21, _O_RDWR@GOTPAGE
Lloh1:
	ldr	x21, [x21, _O_RDWR@GOTPAGEOFF]
	ldr	w8, [x21]
Lloh2:
	adrp	x9, _O_CREAT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _O_CREAT@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	w8, #420
	str	x8, [sp]
	bl	_open
	mov	x19, x0
	cmn	w0, #1
	b.ne	LBB0_2
; %bb.1:
	ldr	w1, [x21]
	mov	x0, x20
	bl	_open
	mov	x19, x0
	cmn	w0, #1
	b.eq	LBB0_5
LBB0_2:
	mov	x0, x19
	mov	w1, #0
	bl	_ftruncate
	cbz	w0, LBB0_4
; %bb.3:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_eprintf
LBB0_4:
	mov	w0, #1
	bl	_close
	mov	x0, x19
	mov	w1, #1
	bl	_dup2
LBB0_5:
	mov	x0, x19
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not resize\n"

	.no_dead_strip	_openfile
.subsections_via_symbols
