	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function grub_hfs_find_dir
_grub_hfs_find_dir:                     ## @grub_hfs_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rdi), %ebx
	movq	_GRUB_HFS_FILETYPE_DIR@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	%rax, -48(%rbp)
	cmpb	$47, (%rsi)
	jne	LBB0_15
## %bb.1:
	movq	%rcx, %r15
	movq	%rdi, %r13
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rdi
	callq	_grub_strdup
	testq	%rax, %rax
	je	LBB0_25
## %bb.2:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, %r15
	decq	%r15
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpb	$47, 1(%r15)
	leaq	1(%r15), %r15
	je	LBB0_3
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	_grub_errno@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_23
## %bb.5:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	-48(%rbp), %edi
	callq	_grub_be_to_cpu32
	movl	%eax, %ebx
	movq	%r12, %r15
	testq	%r12, %r12
	je	LBB0_16
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
	movq	%r15, %rdi
	callq	_grub_strlen
	testq	%rax, %rax
	je	LBB0_16
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	-48(%rbp), %rax
	cmpq	(%r14), %rax
	jne	LBB0_21
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r15, %rdi
	movl	$47, %esi
	callq	_grub_strchr
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpb	$47, (%rax)
	jne	LBB0_12
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leaq	1(%rax), %r12
	movb	$0, (%rax)
	cmpb	$47, 1(%rax)
	movq	%r12, %rax
	je	LBB0_10
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	xorl	%r12d, %r12d
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	%rax, %r12
LBB0_13:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	%ebx, %edi
	callq	_grub_cpu_to_be32
	movl	%eax, -80(%rbp)
	movq	%r15, %rdi
	callq	_grub_strlen
	movq	%rax, -88(%rbp)
	movq	-96(%rbp), %rdi
	movq	%r15, %rsi
	callq	_grub_strcpy
	movl	4(%r13), %edx
	movq	%r13, %rdi
	leaq	-96(%rbp), %rsi
	xorl	%ecx, %ecx
	leaq	-48(%rbp), %r8
	movl	$8, %r9d
	callq	_grub_hfs_find_node
	testl	%eax, %eax
	jne	LBB0_4
## %bb.14:
	movq	_GRUB_ERR_FILE_NOT_FOUND@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_22
LBB0_15:
	movq	_GRUB_ERR_BAD_FILENAME@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_grub_error
	xorl	%eax, %eax
	jmp	LBB0_26
LBB0_16:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_18
## %bb.17:
	leaq	-48(%rbp), %rsi
	movl	$8, %edx
	callq	_grub_memcpy
LBB0_18:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	je	LBB0_24
## %bb.19:
	movl	%ebx, (%rax)
	jmp	LBB0_24
LBB0_21:
	movq	_GRUB_ERR_BAD_FILE_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_22:
	callq	_grub_error
LBB0_23:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
LBB0_24:
	callq	_grub_free
LBB0_25:
	movq	_grub_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_26:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GRUB_HFS_FILETYPE_DIR,8,3      ## @GRUB_HFS_FILETYPE_DIR
	.comm	_GRUB_ERR_BAD_FILENAME,4,2      ## @GRUB_ERR_BAD_FILENAME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bad filename"

	.comm	_grub_errno,8,3                 ## @grub_errno
	.comm	_GRUB_ERR_BAD_FILE_TYPE,4,2     ## @GRUB_ERR_BAD_FILE_TYPE
L_.str.1:                               ## @.str.1
	.asciz	"not a directory"

	.comm	_GRUB_ERR_FILE_NOT_FOUND,4,2    ## @GRUB_ERR_FILE_NOT_FOUND
L_.str.2:                               ## @.str.2
	.asciz	"file not found"

	.no_dead_strip	_grub_hfs_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_hfs_find_dir
_grub_hfs_find_dir:                     ; @grub_hfs_find_dir
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	w23, [x0]
Lloh0:
	adrp	x26, _GRUB_HFS_FILETYPE_DIR@GOTPAGE
Lloh1:
	ldr	x26, [x26, _GRUB_HFS_FILETYPE_DIR@GOTPAGEOFF]
	ldr	x8, [x26]
	str	x8, [sp, #24]
	ldrb	w8, [x1]
	cmp	w8, #47
	b.ne	LBB0_20
; %bb.1:
	mov	x20, x3
	mov	x21, x2
	mov	x22, x0
	mov	x0, x1
	bl	_grub_strdup
	cbz	x0, LBB0_21
; %bb.2:
	mov	x19, x0
	sub	x24, x0, #1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldrb	w8, [x24, #1]!
	cmp	w8, #47
	b.eq	LBB0_3
; %bb.4:
Lloh2:
	adrp	x25, _grub_errno@GOTPAGE
Lloh3:
	ldr	x25, [x25, _grub_errno@GOTPAGEOFF]
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	mov	x0, x24
	bl	_grub_strlen
	cbz	x0, LBB0_16
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [sp, #24]
	ldr	x9, [x26]
	cmp	x8, x9
	b.ne	LBB0_22
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x24
	mov	w1, #47
	bl	_grub_strchr
	cbz	x0, LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldrb	w8, [x0]
	cmp	w8, #47
	b.ne	LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x27, x0
LBB0_10:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldrb	w8, [x27, #1]!
	strb	wzr, [x0]
	mov	x0, x27
	cmp	w8, #47
	b.eq	LBB0_10
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x27, #0
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x27, x0
LBB0_13:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x23
	bl	_grub_cpu_to_be32
	str	w0, [sp, #16]
	mov	x0, x24
	bl	_grub_strlen
	str	x0, [sp, #8]
	ldr	x0, [sp]
	mov	x1, x24
	bl	_grub_strcpy
	ldr	w2, [x22, #4]
	mov	x1, sp
	add	x4, sp, #24
	mov	x0, x22
	mov	w3, #0
	mov	w5, #8
	bl	_grub_hfs_find_node
	cbz	w0, LBB0_23
; %bb.14:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x25]
	cbnz	x8, LBB0_25
; %bb.15:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [sp, #24]
	bl	_grub_be_to_cpu32
	mov	x23, x0
	mov	x24, x27
	cbnz	x27, LBB0_5
LBB0_16:
	cbz	x21, LBB0_18
; %bb.17:
	add	x1, sp, #24
	mov	x0, x21
	mov	w2, #8
	bl	_grub_memcpy
LBB0_18:
	cbz	x20, LBB0_25
; %bb.19:
	str	w23, [x20]
	b	LBB0_25
LBB0_20:
Lloh4:
	adrp	x8, _GRUB_ERR_BAD_FILENAME@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GRUB_ERR_BAD_FILENAME@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	bl	_grub_error
	mov	x0, #0
	b	LBB0_26
LBB0_21:
Lloh9:
	adrp	x8, _grub_errno@GOTPAGE
Lloh10:
	ldr	x8, [x8, _grub_errno@GOTPAGEOFF]
Lloh11:
	ldr	x0, [x8]
	b	LBB0_26
LBB0_22:
Lloh12:
	adrp	x8, _GRUB_ERR_BAD_FILE_TYPE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GRUB_ERR_BAD_FILE_TYPE@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_24
LBB0_23:
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.2@PAGE
Lloh21:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_24:
	bl	_grub_error
LBB0_25:
	mov	x0, x19
	bl	_grub_free
	ldr	x0, [x25]
LBB0_26:
	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
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_GRUB_HFS_FILETYPE_DIR,8,3      ; @GRUB_HFS_FILETYPE_DIR
	.comm	_GRUB_ERR_BAD_FILENAME,4,2      ; @GRUB_ERR_BAD_FILENAME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bad filename"

	.comm	_grub_errno,8,3                 ; @grub_errno
	.comm	_GRUB_ERR_BAD_FILE_TYPE,4,2     ; @GRUB_ERR_BAD_FILE_TYPE
l_.str.1:                               ; @.str.1
	.asciz	"not a directory"

	.comm	_GRUB_ERR_FILE_NOT_FOUND,4,2    ; @GRUB_ERR_FILE_NOT_FOUND
l_.str.2:                               ; @.str.2
	.asciz	"file not found"

	.no_dead_strip	_grub_hfs_find_dir
.subsections_via_symbols
