	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function grub_fat_find_dir
_grub_fat_find_dir:                     ## @grub_fat_find_dir
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_GRUB_FAT_ATTR_DIRECTORY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rsi)
	je	LBB0_6
## %bb.1:
	movq	%rdx, %r13
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	leaq	-1(%rdx), %r12
	leal	-2(%rdx), %ebx
	decl	%r13d
	movq	%r12, %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	incq	%r12
	incq	%rbx
	incq	%r13
	cmpb	$47, 1(%r14)
	leaq	1(%r14), %r14
	je	LBB0_2
## %bb.3:
	movq	%r14, %rdi
	movl	$47, %esi
	callq	_grub_strchr
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:
	movl	%r15d, %edi
	subl	%ebx, %edi
	callq	_grub_malloc
	testq	%rax, %rax
	je	LBB0_13
## %bb.5:
	movq	%rax, %rbx
	movq	%r15, %rax
	subq	%r12, %rax
	movq	%rax, %r12
	movq	%r15, %rdx
	subq	%r13, %rdx
	movq	%rbx, %rdi
	movq	%r14, %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_grub_memcpy
	movl	%r12d, %eax
	movb	$0, (%rbx,%rax)
	jmp	LBB0_8
LBB0_6:
	movq	_GRUB_ERR_BAD_FILE_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_grub_error
LBB0_13:
	xorl	%r15d, %r15d
	jmp	LBB0_14
LBB0_7:
	movq	%r14, %rdi
	callq	_grub_strdup
	movq	%rax, %rbx
LBB0_8:
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	testq	%r15, %r15
	sete	%al
	movq	%rsi, -80(%rbp)
	movq	%rcx, -120(%rbp)
	movq	%rdx, -88(%rbp)
	movq	%rbx, -112(%rbp)
	movq	$0, -104(%rbp)
	testq	%rcx, %rcx
	setne	%cl
	andb	%al, %cl
	movzbl	%cl, %eax
	movl	%eax, -96(%rbp)
	movq	_grub_fat_find_dir_hook@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-120(%rbp), %rcx
	callq	_grub_fat_iterate_dir
	movq	_grub_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_GRUB_ERR_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.9:
	cmpq	$0, -104(%rbp)
	jne	LBB0_12
## %bb.10:
	cmpl	$0, -96(%rbp)
	jne	LBB0_12
## %bb.11:
	movq	_GRUB_ERR_FILE_NOT_FOUND@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_grub_error
LBB0_12:
	movq	%rbx, %rdi
	callq	_grub_free
	movq	-104(%rbp), %rax
	testq	%rax, %rax
	cmoveq	%rax, %r15
LBB0_14:
	movq	%r15, %rax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GRUB_FAT_ATTR_DIRECTORY,4,2    ## @GRUB_FAT_ATTR_DIRECTORY
	.comm	_GRUB_ERR_BAD_FILE_TYPE,4,2     ## @GRUB_ERR_BAD_FILE_TYPE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"not a directory"

	.comm	_grub_fat_find_dir_hook,4,2     ## @grub_fat_find_dir_hook
	.comm	_grub_errno,8,3                 ## @grub_errno
	.comm	_GRUB_ERR_NONE,8,3              ## @GRUB_ERR_NONE
	.comm	_GRUB_ERR_FILE_NOT_FOUND,4,2    ## @GRUB_ERR_FILE_NOT_FOUND
L_.str.1:                               ## @.str.1
	.asciz	"file not found"

	.no_dead_strip	_grub_fat_find_dir
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function grub_fat_find_dir
_grub_fat_find_dir:                     ; @grub_fat_find_dir
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	w8, [x1]
Lloh0:
	adrp	x9, _GRUB_FAT_ATTR_DIRECTORY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _GRUB_FAT_ATTR_DIRECTORY@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.1:
	mov	x23, x4
	mov	x22, x3
	mov	x24, x2
	mov	x19, x1
	mov	x20, x0
	sub	x25, x2, #1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldrb	w8, [x25, #1]!
	add	x24, x24, #1
	cmp	w8, #47
	b.eq	LBB0_2
; %bb.3:
	mov	x0, x25
	mov	w1, #47
	bl	_grub_strchr
	mov	x21, x0
	cbz	x0, LBB0_7
; %bb.4:
	sub	x26, x21, x24
	add	w0, w26, #2
	bl	_grub_malloc
	cbz	x0, LBB0_11
; %bb.5:
	mov	x24, x0
	add	x26, x26, #1
	mov	x1, x25
	mov	x2, x26
	bl	_grub_memcpy
	strb	wzr, [x24, w26, uxtw]
	b	LBB0_8
LBB0_6:
Lloh3:
	adrp	x8, _GRUB_ERR_BAD_FILE_TYPE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GRUB_ERR_BAD_FILE_TYPE@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_grub_error
	mov	x0, #0
	b	LBB0_11
LBB0_7:
	mov	x0, x25
	bl	_grub_strdup
	mov	x24, x0
LBB0_8:
	stp	x23, x19, [sp, #32]
	stp	x22, x24, [sp]
	str	xzr, [sp, #16]
	cmp	x22, #0
	ccmp	x21, #0, #0, ne
	cset	w8, eq
	str	w8, [sp, #24]
Lloh8:
	adrp	x8, _grub_fat_find_dir_hook@GOTPAGE
Lloh9:
	ldr	x8, [x8, _grub_fat_find_dir_hook@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x3, sp
	mov	x0, x20
	mov	x1, x19
	bl	_grub_fat_iterate_dir
Lloh11:
	adrp	x8, _grub_errno@GOTPAGE
Lloh12:
	ldr	x8, [x8, _grub_errno@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
Lloh14:
	adrp	x9, _GRUB_ERR_NONE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _GRUB_ERR_NONE@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	ldr	x10, [sp, #16]
	ldr	w11, [sp, #24]
	cmp	x8, x9
	ccmp	x10, #0, #0, eq
	ccmp	w11, #0, #0, eq
	b.ne	LBB0_10
; %bb.9:
Lloh17:
	adrp	x8, _GRUB_ERR_FILE_NOT_FOUND@GOTPAGE
Lloh18:
	ldr	x8, [x8, _GRUB_ERR_FILE_NOT_FOUND@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_grub_error
LBB0_10:
	mov	x0, x24
	bl	_grub_free
	ldr	x8, [sp, #16]
	cmp	x8, #0
	csel	x0, xzr, x21, eq
LBB0_11:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_GRUB_FAT_ATTR_DIRECTORY,4,2    ; @GRUB_FAT_ATTR_DIRECTORY
	.comm	_GRUB_ERR_BAD_FILE_TYPE,4,2     ; @GRUB_ERR_BAD_FILE_TYPE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"not a directory"

	.comm	_grub_fat_find_dir_hook,4,2     ; @grub_fat_find_dir_hook
	.comm	_grub_errno,8,3                 ; @grub_errno
	.comm	_GRUB_ERR_NONE,8,3              ; @GRUB_ERR_NONE
	.comm	_GRUB_ERR_FILE_NOT_FOUND,4,2    ; @GRUB_ERR_FILE_NOT_FOUND
l_.str.1:                               ; @.str.1
	.asciz	"file not found"

	.no_dead_strip	_grub_fat_find_dir
.subsections_via_symbols
