	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function grub_ufs_find_file
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_grub_ufs_find_file:                    ## @grub_ufs_find_file
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r13
	movq	%rsi, %rdi
	callq	_grub_strlen
	leal	1(%rax), %edi
	callq	_grub_malloc
	movq	%rax, %rbx
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_grub_strcpy
	movq	%rbx, %rdi
	cmpb	$47, (%rbx)
	jne	LBB0_3
## %bb.1:
	cmpb	$0, 1(%rdi)
	je	LBB0_19
## %bb.2:
	movq	%rdi, %rbx
	incq	%rbx
LBB0_3:
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	$47, %esi
	callq	_grub_strchr
	xorl	%r12d, %r12d
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movb	$0, (%rax)
	incq	%rax
	jmp	LBB0_6
LBB0_4:
	xorl	%eax, %eax
LBB0_6:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%r14, %rdi
	callq	_grub_free
	movl	-76(%rbp), %edi
	movl	4(%r13), %esi
	callq	_grub_num_to_cpu16
	addl	%r12d, %eax
	movl	%eax, %r12d
LBB0_27:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%r13, %rdi
	callq	_INODE_SIZE
	cmpl	%eax, %r12d
	jae	LBB0_28
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -80(%rbp)
	movl	$0, -64(%rbp)
	movq	%rbx, %rdi
	callq	_grub_strlen
	testq	%rax, %rax
	je	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%r13, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	%r12d, %ecx
	movl	$20, %r8d
	leaq	-80(%rbp), %r9
	callq	_grub_ufs_read_file
	testq	%rax, %rax
	js	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%rbx, %r15
	movl	-68(%rbp), %edi
	movl	4(%r13), %esi
	callq	_grub_num_to_cpu16
	movl	%eax, %ebx
	leal	1(%rbx), %edi
	callq	_grub_malloc
	movq	%rax, %r14
	leal	20(%r12), %ecx
	movq	%r13, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	%ebx, %r8d
	movq	%rax, %r9
	callq	_grub_ufs_read_file
	testq	%rax, %rax
	js	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_7 Depth=1
	movslq	%ebx, %rax
	movb	$0, (%r14,%rax)
	movq	%r15, %rbx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_grub_strcmp
	testl	%eax, %eax
	jne	LBB0_25
## %bb.15:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	(%r13), %r15d
	movl	4(%r13), %esi
	movl	-72(%rbp), %edi
	callq	_grub_num_to_cpu32
	movq	%r13, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_grub_ufs_read_inode
	movq	%r13, %rdi
	callq	_INODE_MODE
	movq	_GRUB_UFS_ATTR_TYPE@GOTPCREL(%rip), %r12
	andl	(%r12), %eax
	movq	_GRUB_UFS_ATTR_LNK@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_grub_ufs_lookup_symlink
	movq	_grub_errno@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_13
LBB0_17:                                ##   in Loop: Header=BB0_7 Depth=1
	testq	%rbx, %rbx
	je	LBB0_18
## %bb.20:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%rbx, %rdi
	movl	$47, %esi
	callq	_grub_strchr
	testq	%rax, %rax
	je	LBB0_21
## %bb.22:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%rax, %r15
	movb	$0, (%rax)
	incq	%r15
	jmp	LBB0_23
LBB0_21:                                ##   in Loop: Header=BB0_7 Depth=1
	xorl	%r15d, %r15d
LBB0_23:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%r13, %rdi
	callq	_INODE_MODE
	andl	(%r12), %eax
	movq	_GRUB_UFS_ATTR_DIR@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_24
## %bb.26:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%r14, %rdi
	callq	_grub_free
	xorl	%r12d, %r12d
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_27
LBB0_13:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_grub_free
	movq	%r14, %rdi
	callq	_grub_free
	jmp	LBB0_29
LBB0_8:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	_GRUB_ERR_NONE@GOTPCREL(%rip), %rbx
	jmp	LBB0_9
LBB0_11:
	movq	_grub_errno@GOTPCREL(%rip), %rbx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_9:
	callq	_grub_free
	movq	(%rbx), %rax
	jmp	LBB0_30
LBB0_28:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_grub_free
	movq	_GRUB_ERR_FILE_NOT_FOUND@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_grub_error
LBB0_29:
	movq	_grub_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	jmp	LBB0_30
LBB0_18:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_grub_free
	movq	%r14, %rdi
LBB0_19:
	callq	_grub_free
	xorl	%eax, %eax
LBB0_30:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_24:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_grub_free
	movq	%r14, %rdi
	callq	_grub_free
	movq	_GRUB_ERR_BAD_FILE_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_grub_error
	jmp	LBB0_30
	.cfi_endproc
                                        ## -- End function
	.comm	_GRUB_ERR_NONE,8,3              ## @GRUB_ERR_NONE
	.comm	_grub_errno,8,3                 ## @grub_errno
	.comm	_GRUB_UFS_ATTR_TYPE,4,2         ## @GRUB_UFS_ATTR_TYPE
	.comm	_GRUB_UFS_ATTR_LNK,4,2          ## @GRUB_UFS_ATTR_LNK
	.comm	_GRUB_UFS_ATTR_DIR,4,2          ## @GRUB_UFS_ATTR_DIR
	.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_ERR_FILE_NOT_FOUND,4,2    ## @GRUB_ERR_FILE_NOT_FOUND
L_.str.1:                               ## @.str.1
	.asciz	"file not found"

	.no_dead_strip	_grub_ufs_find_file
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function grub_ufs_find_file
_grub_ufs_find_file:                    ; @grub_ufs_find_file
	.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
	mov	x21, x1
	mov	x20, x0
	mov	x0, x1
	bl	_grub_strlen
	add	w0, w0, #1
	bl	_grub_malloc
	mov	x19, x0
	mov	x1, x21
	bl	_grub_strcpy
	ldrb	w8, [x19]
	mov	x22, x19
	cmp	w8, #47
	b.ne	LBB0_2
; %bb.1:
	mov	x22, x19
	ldrb	w8, [x22, #1]!
	cbz	w8, LBB0_18
LBB0_2:
	mov	x0, x22
	mov	w1, #47
	bl	_grub_strchr
	mov	x21, x0
	cbz	x0, LBB0_4
; %bb.3:
	strb	wzr, [x21], #1
LBB0_4:
	mov	w24, #0
Lloh0:
	adrp	x28, _GRUB_UFS_ATTR_TYPE@GOTPAGE
Lloh1:
	ldr	x28, [x28, _GRUB_UFS_ATTR_TYPE@GOTPAGEOFF]
Lloh2:
	adrp	x26, _GRUB_UFS_ATTR_LNK@GOTPAGE
Lloh3:
	ldr	x26, [x26, _GRUB_UFS_ATTR_LNK@GOTPAGEOFF]
Lloh4:
	adrp	x27, _GRUB_UFS_ATTR_DIR@GOTPAGE
Lloh5:
	ldr	x27, [x27, _GRUB_UFS_ATTR_DIR@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x23
	bl	_grub_free
	ldr	w0, [sp, #12]
	ldr	w1, [x20, #4]
	bl	_grub_num_to_cpu16
	add	w24, w0, w24
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x20
	bl	_INODE_SIZE
	cmp	w24, w0
	b.hs	LBB0_23
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	stp	xzr, xzr, [sp, #8]
	str	wzr, [sp, #24]
	mov	x0, x22
	bl	_grub_strlen
	cbz	x0, LBB0_20
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x5, sp, #8
	mov	x0, x20
	mov	w1, #0
	mov	w2, #0
	mov	x3, x24
	mov	w4, #20
	bl	_grub_ufs_read_file
	tbnz	x0, #63, LBB0_21
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [sp, #20]
	ldr	w1, [x20, #4]
	bl	_grub_num_to_cpu16
	mov	x25, x0
	add	w0, w0, #1
	bl	_grub_malloc
	mov	x23, x0
	add	w3, w24, #20
	mov	x0, x20
	mov	w1, #0
	mov	w2, #0
	mov	x4, x25
	mov	x5, x23
	bl	_grub_ufs_read_file
	tbnz	x0, #63, LBB0_19
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	strb	wzr, [x23, w25, sxtw]
	mov	x0, x22
	mov	x1, x23
	bl	_grub_strcmp
	cbnz	w0, LBB0_5
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [sp, #16]
	ldp	w22, w1, [x20]
	bl	_grub_num_to_cpu32
	mov	x1, x0
	mov	x0, x20
	mov	w2, #0
	bl	_grub_ufs_read_inode
	mov	x0, x20
	bl	_INODE_MODE
	ldr	w8, [x28]
	and	w8, w8, w0
	ldr	w9, [x26]
	cmp	w8, w9
	b.ne	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x20
	mov	x1, x22
	bl	_grub_ufs_lookup_symlink
Lloh6:
	adrp	x8, _grub_errno@GOTPAGE
Lloh7:
	ldr	x8, [x8, _grub_errno@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cbnz	x8, LBB0_19
LBB0_13:                                ;   in Loop: Header=BB0_7 Depth=1
	cbz	x21, LBB0_25
; %bb.14:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x21
	mov	w1, #47
	bl	_grub_strchr
	mov	x25, x0
	cbz	x0, LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_7 Depth=1
	strb	wzr, [x25], #1
LBB0_16:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x20
	bl	_INODE_MODE
	ldr	w8, [x28]
	and	w8, w8, w0
	ldr	w9, [x27]
	cmp	w8, w9
	b.ne	LBB0_28
; %bb.17:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x23
	bl	_grub_free
	mov	w24, #0
	mov	x22, x21
	mov	x21, x25
	b	LBB0_6
LBB0_18:
	mov	x0, x19
	b	LBB0_26
LBB0_19:
	mov	x0, x19
	bl	_grub_free
	mov	x0, x23
	bl	_grub_free
	b	LBB0_24
LBB0_20:
Lloh9:
	adrp	x20, _GRUB_ERR_NONE@GOTPAGE
Lloh10:
	ldr	x20, [x20, _GRUB_ERR_NONE@GOTPAGEOFF]
	b	LBB0_22
LBB0_21:
Lloh11:
	adrp	x20, _grub_errno@GOTPAGE
Lloh12:
	ldr	x20, [x20, _grub_errno@GOTPAGEOFF]
LBB0_22:
	mov	x0, x19
	bl	_grub_free
	ldr	x0, [x20]
	b	LBB0_27
LBB0_23:
	mov	x0, x19
	bl	_grub_free
Lloh13:
	adrp	x8, _GRUB_ERR_FILE_NOT_FOUND@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GRUB_ERR_FILE_NOT_FOUND@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_grub_error
LBB0_24:
Lloh18:
	adrp	x8, _grub_errno@GOTPAGE
Lloh19:
	ldr	x8, [x8, _grub_errno@GOTPAGEOFF]
Lloh20:
	ldr	x0, [x8]
	b	LBB0_27
LBB0_25:
	mov	x0, x19
	bl	_grub_free
	mov	x0, x23
LBB0_26:
	bl	_grub_free
	mov	x0, #0
LBB0_27:
	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
LBB0_28:
	mov	x0, x19
	bl	_grub_free
	mov	x0, x23
	bl	_grub_free
Lloh21:
	adrp	x8, _GRUB_ERR_BAD_FILE_TYPE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _GRUB_ERR_BAD_FILE_TYPE@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
Lloh24:
	adrp	x1, l_.str@PAGE
Lloh25:
	add	x1, x1, l_.str@PAGEOFF
	bl	_grub_error
	b	LBB0_27
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_GRUB_ERR_NONE,8,3              ; @GRUB_ERR_NONE
	.comm	_grub_errno,8,3                 ; @grub_errno
	.comm	_GRUB_UFS_ATTR_TYPE,4,2         ; @GRUB_UFS_ATTR_TYPE
	.comm	_GRUB_UFS_ATTR_LNK,4,2          ; @GRUB_UFS_ATTR_LNK
	.comm	_GRUB_UFS_ATTR_DIR,4,2          ; @GRUB_UFS_ATTR_DIR
	.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_ERR_FILE_NOT_FOUND,4,2    ; @GRUB_ERR_FILE_NOT_FOUND
l_.str.1:                               ; @.str.1
	.asciz	"file not found"

	.no_dead_strip	_grub_ufs_find_file
.subsections_via_symbols
