	.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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rax
	movq	%rdi, %r15
	leaq	-28(%rbp), %rsi
	movq	%rax, %rdi
	callq	___sflags
	testl	%eax, %eax
	je	LBB0_6
## %bb.1:
	movl	%eax, %r14d
	xorl	%eax, %eax
	callq	___sfp
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	movq	%rax, %rbx
	movl	-28(%rbp), %esi
	movq	_DEFFILEMODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	__open
	testl	%eax, %eax
	js	LBB0_7
## %bb.3:
	movq	_SHRT_MAX@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_8
## %bb.4:
	movl	$0, (%rbx)
	movl	%eax, %edi
	callq	__close
	movq	_EMFILE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_6:
	xorl	%ebx, %ebx
LBB0_10:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	$0, (%rbx)
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_8:
	movl	%eax, 4(%rbx)
	movl	%r14d, (%rbx)
	movq	%rbx, 32(%rbx)
	movq	___sread@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	___swrite@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	___sseek@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	___sclose@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	movq	_O_APPEND@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -28(%rbp)
	je	LBB0_10
## %bb.9:
	movq	___S2OAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 8(%rbx)
	movq	_SEEK_END@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	__sseek
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_DEFFILEMODE,4,2                ## @DEFFILEMODE
	.comm	_SHRT_MAX,4,2                   ## @SHRT_MAX
	.comm	_EMFILE,4,2                     ## @EMFILE
	.comm	_errno,4,2                      ## @errno
	.comm	___sread,4,2                    ## @__sread
	.comm	___swrite,4,2                   ## @__swrite
	.comm	___sseek,4,2                    ## @__sseek
	.comm	___sclose,4,2                   ## @__sclose
	.comm	_O_APPEND,4,2                   ## @O_APPEND
	.comm	___S2OAP,4,2                    ## @__S2OAP
	.comm	_SEEK_END,4,2                   ## @SEEK_END
.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, #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	x8, x1
	mov	x21, x0
	add	x1, sp, #12
	mov	x0, x8
	bl	___sflags
	cbz	w0, LBB0_5
; %bb.1:
	mov	x20, x0
	bl	___sfp
	mov	x19, x0
	cbz	x0, LBB0_9
; %bb.2:
	ldr	w1, [sp, #12]
Lloh0:
	adrp	x8, _DEFFILEMODE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DEFFILEMODE@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x21
	bl	__open
	tbnz	w0, #31, LBB0_6
; %bb.3:
Lloh3:
	adrp	x8, _SHRT_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SHRT_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w0, w8
	b.le	LBB0_7
; %bb.4:
	str	wzr, [x19]
	bl	__close
	mov	x19, #0
Lloh6:
	adrp	x8, _EMFILE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EMFILE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _errno@GOTPAGE
Lloh10:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh11:
	str	w8, [x9]
	b	LBB0_9
LBB0_5:
	mov	x19, #0
	b	LBB0_9
LBB0_6:
	str	wzr, [x19]
	mov	x19, #0
	b	LBB0_9
LBB0_7:
	stp	w20, w0, [x19]
	str	x19, [x19, #32]
Lloh12:
	adrp	x8, ___sread@GOTPAGE
Lloh13:
	ldr	x8, [x8, ___sread@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, ___swrite@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___swrite@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
Lloh18:
	adrp	x10, ___sseek@GOTPAGE
Lloh19:
	ldr	x10, [x10, ___sseek@GOTPAGEOFF]
	stp	w9, w8, [x19, #20]
Lloh20:
	ldr	w8, [x10]
Lloh21:
	adrp	x9, ___sclose@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___sclose@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #12]
	ldr	w8, [sp, #12]
Lloh24:
	adrp	x9, _O_APPEND@GOTPAGE
Lloh25:
	ldr	x9, [x9, _O_APPEND@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.8:
Lloh27:
	adrp	x8, ___S2OAP@GOTPAGE
Lloh28:
	ldr	x8, [x8, ___S2OAP@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	orr	w8, w9, w8
	str	w8, [x19, #8]
Lloh30:
	adrp	x8, _SEEK_END@GOTPAGE
Lloh31:
	ldr	x8, [x8, _SEEK_END@GOTPAGEOFF]
Lloh32:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	__sseek
LBB0_9:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotStr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_DEFFILEMODE,4,2                ; @DEFFILEMODE
	.comm	_SHRT_MAX,4,2                   ; @SHRT_MAX
	.comm	_EMFILE,4,2                     ; @EMFILE
	.comm	_errno,4,2                      ; @errno
	.comm	___sread,4,2                    ; @__sread
	.comm	___swrite,4,2                   ; @__swrite
	.comm	___sseek,4,2                    ; @__sseek
	.comm	___sclose,4,2                   ; @__sclose
	.comm	_O_APPEND,4,2                   ; @O_APPEND
	.comm	___S2OAP,4,2                    ; @__S2OAP
	.comm	_SEEK_END,4,2                   ; @SEEK_END
.subsections_via_symbols
