	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fopen                          ## -- Begin function fopen
	.p2align	4, 0x90
_fopen:                                 ## @fopen
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	xorl	%ebx, %ebx
	testq	%rsi, %rsi
	je	LBB0_13
## %bb.1:
	movsbl	(%rsi), %eax
	cmpl	$114, %eax
	je	LBB0_4
## %bb.2:
	cmpl	$119, %eax
	jne	LBB0_13
## %bb.3:
	movq	_O_CREAT@GOTPCREL(%rip), %rax
	movq	_O_TRUNC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rax), %ebx
	movq	_O_WRONLY@GOTPCREL(%rip), %rax
	cmpb	$43, 1(%rsi)
	je	LBB0_5
	jmp	LBB0_6
LBB0_4:
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	cmpb	$43, 1(%rsi)
	jne	LBB0_6
LBB0_5:
	movq	_O_RDWR@GOTPCREL(%rip), %rax
LBB0_6:
	orl	(%rax), %ebx
	movl	%ebx, %esi
	callq	_open
	testl	%eax, %eax
	js	LBB0_11
## %bb.7:
	movl	%eax, %r14d
	movl	$16, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	movq	%rax, %rbx
	leaq	-24(%rbp), %rsi
	movl	%r14d, %edi
	callq	_fstat
	testq	%rax, %rax
	je	LBB0_12
## %bb.9:
	movq	%rbx, %rdi
	callq	_free
LBB0_10:
	movl	%r14d, %edi
	callq	_close
LBB0_11:
	xorl	%ebx, %ebx
LBB0_13:
	movq	%rbx, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_12:
	movl	%r14d, (%rbx)
	movq	$0, 8(%rbx)
	movl	-24(%rbp), %eax
	movl	%eax, 4(%rbx)
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_TRUNC,4,2                    ## @O_TRUNC
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_VE_GUESS,4,2                   ## @VE_GUESS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fopen                          ; -- Begin function fopen
	.p2align	2
_fopen:                                 ; @fopen
	.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	x1, LBB0_9
; %bb.1:
	ldrsb	w8, [x1]
	cmp	w8, #114
	b.eq	LBB0_4
; %bb.2:
	cmp	w8, #119
	b.ne	LBB0_9
; %bb.3:
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]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _O_WRONLY@GOTPAGE
Lloh7:
	ldr	x9, [x9, _O_WRONLY@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
	mov	w8, #0
Lloh8:
	adrp	x9, _O_RDONLY@GOTPAGE
Lloh9:
	ldr	x9, [x9, _O_RDONLY@GOTPAGEOFF]
LBB0_5:
	ldrb	w10, [x1, #1]
Lloh10:
	adrp	x11, _O_RDWR@GOTPAGE
Lloh11:
	ldr	x11, [x11, _O_RDWR@GOTPAGEOFF]
	cmp	w10, #43
	csel	x9, x11, x9, eq
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_open
	tbnz	w0, #31, LBB0_9
; %bb.6:
	mov	x19, x0
	mov	w0, #16
	bl	_malloc
	mov	x20, x0
	cbz	x0, LBB0_11
; %bb.7:
	add	x1, sp, #8
	mov	x0, x19
	bl	_fstat
	cbz	x0, LBB0_12
; %bb.8:
	mov	x0, x20
	bl	_free
	mov	x0, x19
	bl	_close
LBB0_9:
	mov	x20, #0
LBB0_10:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_11:
	mov	x0, x19
	bl	_close
	b	LBB0_10
LBB0_12:
	str	xzr, [x20, #8]
	ldr	w8, [sp, #8]
	stp	w19, w8, [x20]
	b	LBB0_10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_TRUNC,4,2                    ; @O_TRUNC
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_VE_GUESS,4,2                   ; @VE_GUESS
.subsections_via_symbols
