	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___dup3                         ## -- Begin function __dup3
	.p2align	4, 0x90
___dup3:                                ## @__dup3
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	cmpl	%esi, %edi
	je	LBB0_6
## %bb.1:
	movl	%esi, %eax
	movq	_O_CLOEXEC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %esi
	notl	%esi
	testl	%edx, %esi
	je	LBB0_2
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	$-1, %eax
	popq	%rbp
	retq
LBB0_2:
	testl	%edx, %ecx
	jne	LBB0_3
## %bb.4:
	movq	_F_DUP2FD@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_3:
	movq	_F_DUP2FD_CLOEXEC@GOTPCREL(%rip), %rcx
LBB0_5:
	movl	(%rcx), %esi
	movl	%eax, %edx
	popq	%rbp
	jmp	__fcntl                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
	.comm	_O_CLOEXEC,4,2                  ## @O_CLOEXEC
	.comm	_F_DUP2FD_CLOEXEC,4,2           ## @F_DUP2FD_CLOEXEC
	.comm	_F_DUP2FD,4,2                   ## @F_DUP2FD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___dup3                         ; -- Begin function __dup3
	.p2align	2
___dup3:                                ; @__dup3
	.cfi_startproc
; %bb.0:
	cmp	w0, w1
	b.eq	LBB0_2
; %bb.1:
Lloh0:
	adrp	x9, _O_CLOEXEC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _O_CLOEXEC@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	bics	wzr, w2, w9
	b.eq	LBB0_3
LBB0_2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _errno@GOTPAGE
Lloh7:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh8:
	str	w8, [x9]
	mov	w0, #-1
	ret
LBB0_3:
	mov	x8, x1
Lloh9:
	adrp	x10, _F_DUP2FD_CLOEXEC@GOTPAGE
Lloh10:
	ldr	x10, [x10, _F_DUP2FD_CLOEXEC@GOTPAGEOFF]
Lloh11:
	adrp	x11, _F_DUP2FD@GOTPAGE
Lloh12:
	ldr	x11, [x11, _F_DUP2FD@GOTPAGEOFF]
	tst	w9, w2
	csel	x9, x11, x10, eq
	ldr	w1, [x9]
	mov	x2, x8
	b	__fcntl
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
	.comm	_O_CLOEXEC,4,2                  ; @O_CLOEXEC
	.comm	_F_DUP2FD_CLOEXEC,4,2           ; @F_DUP2FD_CLOEXEC
	.comm	_F_DUP2FD,4,2                   ; @F_DUP2FD
.subsections_via_symbols
