	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sd_fat_diropen_r
_sd_fat_diropen_r:                      ## @sd_fat_diropen_r
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	%rdx, %rdi
	callq	_sd_fat_get_device_data
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	%rax, %rbx
	movq	(%r15), %r13
	movl	(%rax), %edi
	callq	_OSLockMutex
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_sd_fat_real_path
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	movq	%rax, %r12
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movl	4(%rbx), %esi
	movl	8(%rbx), %edi
	leaq	-44(%rbp), %rcx
	movq	%rax, %rdx
	movl	$-1, %r8d
	callq	_FSOpenDir
	movl	%eax, %r13d
	movq	%r12, %rdi
	callq	_free
	movl	(%rbx), %edi
	callq	_OSUnlockMutex
	testl	%r13d, %r13d
	js	LBB0_6
## %bb.3:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rbx, 8(%rcx)
	movl	-44(%rbp), %eax
	movl	%eax, (%rcx)
	jmp	LBB0_8
LBB0_4:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	jmp	LBB0_7
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movl	(%rbx), %edi
	callq	_OSUnlockMutex
	jmp	LBB0_7
LBB0_6:
	movl	%r13d, (%r14)
LBB0_7:
	xorl	%r15d, %r15d
LBB0_8:
	movq	%r15, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_sd_fat_diropen_r
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sd_fat_diropen_r
_sd_fat_diropen_r:                      ; @sd_fat_diropen_r
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
	mov	x0, x2
	bl	_sd_fat_get_device_data
	cbz	x0, LBB0_4
; %bb.1:
	mov	x21, x0
	ldr	x24, [x19]
	ldr	w0, [x0]
	bl	_OSLockMutex
	mov	x0, x22
	mov	x1, x21
	bl	_sd_fat_real_path
	cbz	x0, LBB0_5
; %bb.2:
	mov	x22, x0
	ldp	w1, w0, [x21, #4]
	add	x3, sp, #12
	mov	x2, x22
	mov	w4, #-1
	bl	_FSOpenDir
	mov	x23, x0
	mov	x0, x22
	bl	_free
	ldr	w0, [x21]
	bl	_OSUnlockMutex
	tbnz	w23, #31, LBB0_6
; %bb.3:
	str	x21, [x24, #8]
	ldr	w8, [sp, #12]
	str	w8, [x24]
	b	LBB0_7
LBB0_4:
	mov	x19, #0
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x20]
	b	LBB0_7
LBB0_5:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x20]
	ldr	w0, [x21]
	bl	_OSUnlockMutex
	mov	x19, #0
	b	LBB0_7
LBB0_6:
	mov	x19, #0
	str	w23, [x20]
LBB0_7:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_sd_fat_diropen_r
.subsections_via_symbols
