	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___opendir2                     ## -- Begin function __opendir2
	.p2align	4, 0x90
___opendir2:                            ## @__opendir2
	.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	___DTF_READALL@GOTPCREL(%rip), %rax
	movq	___DTF_SKIPREAD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	testl	%esi, %ecx
	je	LBB0_1
LBB0_4:
	xorl	%eax, %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	%esi, %ebx
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_O_DIRECTORY@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_O_CLOEXEC@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	callq	__open
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.2:
	movl	%eax, %r14d
	movl	%eax, %edi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	___opendir_common
	testq	%rax, %rax
	jne	LBB0_5
## %bb.3:
	movq	_errno@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	movl	%r14d, %edi
	callq	__close
	movl	%ebx, (%r15)
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	___DTF_READALL,4,2              ## @__DTF_READALL
	.comm	___DTF_SKIPREAD,4,2             ## @__DTF_SKIPREAD
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_O_DIRECTORY,4,2                ## @O_DIRECTORY
	.comm	_O_CLOEXEC,4,2                  ## @O_CLOEXEC
	.comm	_errno,4,2                      ## @errno
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___opendir2                     ; -- Begin function __opendir2
	.p2align	2
___opendir2:                            ; @__opendir2
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
Lloh0:
	adrp	x8, ___DTF_READALL@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___DTF_READALL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, ___DTF_SKIPREAD@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___DTF_SKIPREAD@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
	tst	w8, w1
	b.eq	LBB0_3
LBB0_1:
	mov	x0, #0
LBB0_2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_3:
	mov	x19, x1
Lloh6:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _O_NONBLOCK@GOTPAGE
Lloh10:
	ldr	x9, [x9, _O_NONBLOCK@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh12:
	adrp	x9, _O_DIRECTORY@GOTPAGE
Lloh13:
	ldr	x9, [x9, _O_DIRECTORY@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh15:
	adrp	x9, _O_CLOEXEC@GOTPAGE
Lloh16:
	ldr	x9, [x9, _O_CLOEXEC@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w1, w8, w9
	bl	__open
	cmn	w0, #1
	b.eq	LBB0_1
; %bb.4:
	mov	x20, x0
	mov	x1, x19
	mov	w2, #0
	bl	___opendir_common
	cbnz	x0, LBB0_2
; %bb.5:
Lloh18:
	adrp	x19, _errno@GOTPAGE
Lloh19:
	ldr	x19, [x19, _errno@GOTPAGEOFF]
	ldr	w21, [x19]
	mov	x0, x20
	bl	__close
	mov	x0, #0
	str	w21, [x19]
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	___DTF_READALL,4,2              ; @__DTF_READALL
	.comm	___DTF_SKIPREAD,4,2             ; @__DTF_SKIPREAD
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_O_DIRECTORY,4,2                ; @O_DIRECTORY
	.comm	_O_CLOEXEC,4,2                  ; @O_CLOEXEC
	.comm	_errno,4,2                      ; @errno
.subsections_via_symbols
