	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function grub_fat_open
_grub_fat_open:                         ## @grub_fat_open
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_my_mod@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_grub_dl_ref
	movq	16(%r14), %rax
	movl	(%rax), %edi
	callq	_grub_fat_mount
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	_grub_errno@GOTPCREL(%rip), %r13
	movq	_GRUB_ERR_NONE@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r14), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_grub_fat_find_dir
	movq	%rax, %rbx
	movq	(%r13), %rax
	cmpq	(%r12), %rax
	jne	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	testq	%rbx, %rbx
	jne	LBB0_2
## %bb.4:
	movq	_GRUB_FAT_ATTR_DIRECTORY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%r15)
	je	LBB0_8
## %bb.5:
	movq	_GRUB_ERR_BAD_FILE_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_grub_error
LBB0_6:
	movq	%r15, %rdi
	callq	_grub_free
	movq	_my_mod@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_grub_dl_unref
	movq	_grub_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%r15, 8(%r14)
	movl	4(%r15), %ecx
	movl	%ecx, (%r14)
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_my_mod,4,2                     ## @my_mod
	.comm	_grub_errno,8,3                 ## @grub_errno
	.comm	_GRUB_ERR_NONE,8,3              ## @GRUB_ERR_NONE
	.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 file"

	.no_dead_strip	_grub_fat_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function grub_fat_open
_grub_fat_open:                         ; @grub_fat_open
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x22, _my_mod@GOTPAGE
Lloh1:
	ldr	x22, [x22, _my_mod@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_grub_dl_ref
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
	bl	_grub_fat_mount
	mov	x20, x0
Lloh2:
	adrp	x23, _grub_errno@GOTPAGE
Lloh3:
	ldr	x23, [x23, _grub_errno@GOTPAGEOFF]
	cbz	x0, LBB0_6
; %bb.1:
Lloh4:
	adrp	x24, _GRUB_ERR_NONE@GOTPAGE
Lloh5:
	ldr	x24, [x24, _GRUB_ERR_NONE@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
	mov	x1, x20
	mov	x2, x21
	mov	w3, #0
	mov	w4, #0
	bl	_grub_fat_find_dir
	mov	x21, x0
	ldr	x0, [x23]
	ldr	x8, [x24]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	cbnz	x21, LBB0_2
; %bb.4:
	ldr	w8, [x20]
Lloh6:
	adrp	x9, _GRUB_FAT_ATTR_DIRECTORY@GOTPAGE
Lloh7:
	ldr	x9, [x9, _GRUB_FAT_ATTR_DIRECTORY@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.5:
Lloh9:
	adrp	x8, _GRUB_ERR_BAD_FILE_TYPE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GRUB_ERR_BAD_FILE_TYPE@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_grub_error
LBB0_6:
	mov	x0, x20
	bl	_grub_free
	ldr	w0, [x22]
	bl	_grub_dl_unref
	ldr	x0, [x23]
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_8:
	str	x20, [x19, #8]
	ldr	w8, [x20, #4]
	str	w8, [x19]
	b	LBB0_7
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_my_mod,4,2                     ; @my_mod
	.comm	_grub_errno,8,3                 ; @grub_errno
	.comm	_GRUB_ERR_NONE,8,3              ; @GRUB_ERR_NONE
	.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 file"

	.no_dead_strip	_grub_fat_open
.subsections_via_symbols
