	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fdopen                         ## -- Begin function fdopen
	.p2align	4, 0x90
_fdopen:                                ## @fdopen
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_SHRT_MAX@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	jge	LBB0_3
## %bb.1:
	movq	_EMFILE@GOTPCREL(%rip), %rax
LBB0_2:
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_19
LBB0_3:
	movl	%edi, %r14d
	leaq	-36(%rbp), %rax
	movq	%rsi, %rdi
	movq	%rax, %rsi
	callq	___sflags
	testl	%eax, %eax
	je	LBB0_19
## %bb.4:
	movl	%eax, %r15d
	movq	_F_GETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	__fcntl
	testl	%eax, %eax
	js	LBB0_20
## %bb.5:
	movl	%eax, %r12d
	movq	_O_ACCMODE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_O_EXEC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%eax, %ecx
	andl	%r12d, %ecx
	movq	_O_RDWR@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	je	LBB0_7
## %bb.6:
	andl	-36(%rbp), %eax
	cmpl	%eax, %ecx
	jne	LBB0_14
LBB0_7:
	xorl	%eax, %eax
	callq	___sfp
	testq	%rax, %rax
	je	LBB0_19
## %bb.8:
	movq	%rax, %rbx
	movq	_O_CLOEXEC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -36(%rbp)
	je	LBB0_10
## %bb.9:
	movq	_F_SETFD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_FD_CLOEXEC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %edi
	callq	__fcntl
	cmpl	$-1, %eax
	je	LBB0_18
LBB0_10:
	movl	%r15d, (%rbx)
	movq	_O_APPEND@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%r12d, %eax
	je	LBB0_15
## %bb.11:
	movq	___S2OAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 32(%rbx)
	jmp	LBB0_17
LBB0_14:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_15:
	testl	%eax, -36(%rbp)
	je	LBB0_17
## %bb.16:
	movq	___SAPP@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movl	%r15d, (%rbx)
LBB0_17:
	movl	%r14d, 4(%rbx)
	movq	%rbx, 24(%rbx)
	movq	___sread@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	___swrite@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	___sseek@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	movq	___sclose@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	jmp	LBB0_20
LBB0_18:
	movl	$0, (%rbx)
LBB0_19:
	xorl	%ebx, %ebx
LBB0_20:
	movq	%rbx, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SHRT_MAX,4,2                   ## @SHRT_MAX
	.comm	_EMFILE,4,2                     ## @EMFILE
	.comm	_errno,4,2                      ## @errno
	.comm	_F_GETFL,4,2                    ## @F_GETFL
	.comm	_O_ACCMODE,4,2                  ## @O_ACCMODE
	.comm	_O_EXEC,4,2                     ## @O_EXEC
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_O_CLOEXEC,4,2                  ## @O_CLOEXEC
	.comm	_F_SETFD,4,2                    ## @F_SETFD
	.comm	_FD_CLOEXEC,4,2                 ## @FD_CLOEXEC
	.comm	_O_APPEND,4,2                   ## @O_APPEND
	.comm	___S2OAP,4,2                    ## @__S2OAP
	.comm	___SAPP,4,2                     ## @__SAPP
	.comm	___sread,4,2                    ## @__sread
	.comm	___swrite,4,2                   ## @__swrite
	.comm	___sseek,4,2                    ## @__sseek
	.comm	___sclose,4,2                   ## @__sclose
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fdopen                         ; -- Begin function fdopen
	.p2align	2
_fdopen:                                ; @fdopen
	.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
Lloh0:
	adrp	x9, _SHRT_MAX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SHRT_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w9, w0
	b.ge	LBB0_3
; %bb.1:
	mov	x20, #0
Lloh3:
	adrp	x8, _EMFILE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EMFILE@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _errno@GOTPAGE
Lloh6:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh7:
	str	w8, [x9]
	b	LBB0_18
LBB0_3:
	mov	x8, x1
	mov	x19, x0
	add	x1, sp, #12
	mov	x0, x8
	bl	___sflags
	cbz	w0, LBB0_17
; %bb.4:
	mov	x21, x0
Lloh8:
	adrp	x8, _F_GETFL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _F_GETFL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	__fcntl
	tbnz	w0, #31, LBB0_17
; %bb.5:
	mov	x22, x0
Lloh11:
	adrp	x8, _O_ACCMODE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _O_ACCMODE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _O_EXEC@GOTPAGE
Lloh15:
	ldr	x9, [x9, _O_EXEC@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w9, w9, w8
	and	w9, w9, w0
Lloh17:
	adrp	x10, _O_RDWR@GOTPAGE
Lloh18:
	ldr	x10, [x10, _O_RDWR@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	cmp	w9, w10
	b.eq	LBB0_7
; %bb.6:
	ldr	w10, [sp, #12]
	and	w8, w10, w8
	cmp	w9, w8
	b.ne	LBB0_12
LBB0_7:
	bl	___sfp
	mov	x20, x0
	cbz	x0, LBB0_18
; %bb.8:
	ldr	w8, [sp, #12]
Lloh20:
	adrp	x9, _O_CLOEXEC@GOTPAGE
Lloh21:
	ldr	x9, [x9, _O_CLOEXEC@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
Lloh23:
	adrp	x8, _F_SETFD@GOTPAGE
Lloh24:
	ldr	x8, [x8, _F_SETFD@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
Lloh26:
	adrp	x8, _FD_CLOEXEC@GOTPAGE
Lloh27:
	ldr	x8, [x8, _FD_CLOEXEC@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	mov	x0, x19
	bl	__fcntl
	cmn	w0, #1
	b.eq	LBB0_16
LBB0_10:
	str	w21, [x20]
Lloh29:
	adrp	x8, _O_APPEND@GOTPAGE
Lloh30:
	ldr	x8, [x8, _O_APPEND@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_13
; %bb.11:
Lloh32:
	adrp	x8, ___S2OAP@GOTPAGE
Lloh33:
	ldr	x8, [x8, ___S2OAP@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	ldr	w9, [x20, #32]
	orr	w8, w9, w8
	str	w8, [x20, #32]
	b	LBB0_15
LBB0_12:
	mov	x20, #0
Lloh35:
	adrp	x8, _EINVAL@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_2
LBB0_13:
	ldr	w9, [sp, #12]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.14:
Lloh37:
	adrp	x8, ___SAPP@GOTPAGE
Lloh38:
	ldr	x8, [x8, ___SAPP@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	orr	w8, w8, w21
	str	w8, [x20]
LBB0_15:
	str	x20, [x20, #24]
Lloh40:
	adrp	x8, ___sread@GOTPAGE
Lloh41:
	ldr	x8, [x8, ___sread@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
Lloh43:
	adrp	x9, ___swrite@GOTPAGE
Lloh44:
	ldr	x9, [x9, ___swrite@GOTPAGEOFF]
	str	w8, [x20, #20]
Lloh45:
	ldr	w8, [x9]
Lloh46:
	adrp	x9, ___sseek@GOTPAGE
Lloh47:
	ldr	x9, [x9, ___sseek@GOTPAGEOFF]
Lloh48:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #12]
Lloh49:
	adrp	x8, ___sclose@GOTPAGE
Lloh50:
	ldr	x8, [x8, ___sclose@GOTPAGEOFF]
Lloh51:
	ldr	w8, [x8]
	stp	w19, w8, [x20, #4]
	b	LBB0_18
LBB0_16:
	str	wzr, [x20]
LBB0_17:
	mov	x20, #0
LBB0_18:
	mov	x0, x20
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_SHRT_MAX,4,2                   ; @SHRT_MAX
	.comm	_EMFILE,4,2                     ; @EMFILE
	.comm	_errno,4,2                      ; @errno
	.comm	_F_GETFL,4,2                    ; @F_GETFL
	.comm	_O_ACCMODE,4,2                  ; @O_ACCMODE
	.comm	_O_EXEC,4,2                     ; @O_EXEC
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_O_CLOEXEC,4,2                  ; @O_CLOEXEC
	.comm	_F_SETFD,4,2                    ; @F_SETFD
	.comm	_FD_CLOEXEC,4,2                 ; @FD_CLOEXEC
	.comm	_O_APPEND,4,2                   ; @O_APPEND
	.comm	___S2OAP,4,2                    ; @__S2OAP
	.comm	___SAPP,4,2                     ; @__SAPP
	.comm	___sread,4,2                    ; @__sread
	.comm	___swrite,4,2                   ; @__swrite
	.comm	___sseek,4,2                    ; @__sseek
	.comm	___sclose,4,2                   ; @__sclose
.subsections_via_symbols
