	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__FAT_dirnext_r                 ## -- Begin function _FAT_dirnext_r
	.p2align	4, 0x90
__FAT_dirnext_r:                        ## @_FAT_dirnext_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movq	%rdx, %r12
	movq	%rdi, %r14
	movq	(%rsi), %rbx
	movq	(%rbx), %rdi
	callq	__FAT_lock
	cmpl	$0, 24(%rbx)
	je	LBB0_5
## %bb.1:
	cmpq	$0, 16(%rbx)
	je	LBB0_6
## %bb.2:
	leaq	8(%rbx), %r14
	movl	8(%rbx), %esi
	movq	_NAME_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_strncpy
	testq	%r15, %r15
	je	LBB0_4
## %bb.3:
	movq	(%rbx), %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	__FAT_directory_entryStat
LBB0_4:
	movq	(%rbx), %rdi
	movq	%r14, %rsi
	callq	__FAT_directory_getNextEntry
	movq	%rax, 16(%rbx)
	movq	(%rbx), %rdi
	callq	__FAT_unlock
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_5:
	movq	(%rbx), %rdi
	callq	__FAT_unlock
	movq	_EBADF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	jmp	LBB0_7
LBB0_6:
	movq	(%rbx), %rdi
	callq	__FAT_unlock
LBB0_7:
	movl	$-1, %eax
LBB0_8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBADF,4,2                      ## @EBADF
	.comm	_NAME_MAX,4,2                   ## @NAME_MAX
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__FAT_dirnext_r                 ; -- Begin function _FAT_dirnext_r
	.p2align	2
__FAT_dirnext_r:                        ; @_FAT_dirnext_r
	.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
	mov	x19, x3
	mov	x21, x2
	mov	x20, x0
	ldr	x22, [x1]
	ldr	x0, [x22]
	bl	__FAT_lock
	ldr	w8, [x22, #24]
	cbz	w8, LBB0_5
; %bb.1:
	ldr	x8, [x22, #16]
	cbz	x8, LBB0_6
; %bb.2:
	mov	x20, x22
	ldr	w1, [x20, #8]!
Lloh0:
	adrp	x8, _NAME_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAME_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x21
	bl	_strncpy
	cbz	x19, LBB0_4
; %bb.3:
	ldr	x0, [x22]
	mov	x1, x20
	mov	x2, x19
	bl	__FAT_directory_entryStat
LBB0_4:
	ldr	x0, [x22]
	mov	x1, x20
	bl	__FAT_directory_getNextEntry
	str	x0, [x22, #16]
	ldr	x0, [x22]
	bl	__FAT_unlock
	mov	w0, #0
	b	LBB0_8
LBB0_5:
	ldr	x0, [x22]
	bl	__FAT_unlock
Lloh3:
	adrp	x8, _EBADF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBADF@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x20]
	b	LBB0_7
LBB0_6:
	ldr	x0, [x22]
	bl	__FAT_unlock
LBB0_7:
	mov	w0, #-1
LBB0_8:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EBADF,4,2                      ; @EBADF
	.comm	_NAME_MAX,4,2                   ; @NAME_MAX
.subsections_via_symbols
