	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_opendir                        ## -- Begin function opendir
	.p2align	4, 0x90
_opendir:                               ## @opendir
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	_MAX_PATH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	$2, %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_xutftowcs_path
	xorl	%ebx, %ebx
	testl	%eax, %eax
	js	LBB0_10
## %bb.1:
	je	LBB0_4
## %bb.2:
	movl	%eax, %r15d
	leal	-1(%r15), %eax
	movsbl	(%r14,%rax), %edi
	callq	_is_dir_sep
	movl	%r15d, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movl	%r15d, %eax
	incl	%r15d
	movb	$47, (%r14,%rax)
	movl	%r15d, %ebx
LBB0_4:
	movl	%ebx, %eax
	movw	$42, (%r14,%rax)
	leaq	-36(%rbp), %rsi
	movq	%r14, %rdi
	callq	_FindFirstFileW
	movq	%rax, %r14
	movq	_INVALID_HANDLE_VALUE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	jne	LBB0_9
## %bb.5:
	xorl	%eax, %eax
	callq	_GetLastError
	movq	_ERROR_DIRECTORY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.6:
	movq	_ENOTDIR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_8
LBB0_9:
	movl	$24, %edi
	callq	_xmalloc
	movq	%rax, %rbx
	movq	%r14, 16(%rax)
	movq	$0, 8(%rax)
	leaq	-36(%rbp), %rsi
	movq	%rax, %rdi
	callq	_finddata2dirent
	jmp	LBB0_10
LBB0_7:
	movq	%rax, %rdi
	callq	_err_win_to_posix
LBB0_8:
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	xorl	%ebx, %ebx
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	movq	%rbx, %rax
	leaq	-24(%rbp), %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_PATH,4,2                   ## @MAX_PATH
	.comm	_INVALID_HANDLE_VALUE,8,3       ## @INVALID_HANDLE_VALUE
	.comm	_ERROR_DIRECTORY,8,3            ## @ERROR_DIRECTORY
	.comm	_ENOTDIR,4,2                    ## @ENOTDIR
	.comm	_errno,4,2                      ## @errno
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_opendir                        ; -- Begin function opendir
	.p2align	2
_opendir:                               ; @opendir
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	sub	sp, sp, #16
	mov	x1, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
Lloh3:
	adrp	x8, _MAX_PATH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_PATH@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	add	w8, w8, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x19, x9, x8
	mov	sp, x19
	mov	x0, x19
	bl	_xutftowcs_path
	tbnz	w0, #31, LBB0_7
; %bb.1:
	mov	x20, x0
	cbz	w0, LBB0_4
; %bb.2:
	sub	w8, w20, #1
	ldrsb	w0, [x19, w8, uxtw]
	bl	_is_dir_sep
	cbnz	w0, LBB0_4
; %bb.3:
	mov	w8, #47
	strb	w8, [x19, w20, uxtw]
	add	w20, w20, #1
LBB0_4:
	mov	w8, #42
	strh	w8, [x19, w20, uxtw]
	sub	x1, x29, #28
	mov	x0, x19
	bl	_FindFirstFileW
Lloh8:
	adrp	x8, _INVALID_HANDLE_VALUE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _INVALID_HANDLE_VALUE@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.5:
	bl	_GetLastError
Lloh11:
	adrp	x8, _ERROR_DIRECTORY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ERROR_DIRECTORY@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.6:
Lloh14:
	adrp	x8, _ENOTDIR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOTDIR@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	b	LBB0_10
LBB0_7:
	mov	x19, #0
	b	LBB0_11
LBB0_8:
	mov	x20, x0
	mov	w0, #24
	bl	_xmalloc
	mov	x19, x0
	stp	xzr, x20, [x0, #8]
	sub	x1, x29, #28
	bl	_finddata2dirent
	b	LBB0_11
LBB0_9:
	bl	_err_win_to_posix
LBB0_10:
	mov	x19, #0
Lloh17:
	adrp	x8, _errno@GOTPAGE
Lloh18:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh19:
	str	w0, [x8]
LBB0_11:
	ldur	x8, [x29, #-24]
Lloh20:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh21:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x19
	sub	sp, x29, #16
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotStr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_PATH,4,2                   ; @MAX_PATH
	.comm	_INVALID_HANDLE_VALUE,8,3       ; @INVALID_HANDLE_VALUE
	.comm	_ERROR_DIRECTORY,8,3            ; @ERROR_DIRECTORY
	.comm	_ENOTDIR,4,2                    ; @ENOTDIR
	.comm	_errno,4,2                      ; @errno
.subsections_via_symbols
