	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function grub_ufs_open
_grub_ufs_open:                         ## @grub_ufs_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	16(%rdi), %rax
	movl	(%rax), %edi
	callq	_grub_ufs_mount
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%rax, %rdi
	movl	$2, %esi
	xorl	%edx, %edx
	callq	_grub_ufs_read_inode
	movq	_grub_errno@GOTPCREL(%rip), %r12
	cmpq	$0, (%r12)
	je	LBB0_4
LBB0_3:
	movq	%rbx, %rdi
	callq	_grub_free
	jmp	LBB0_9
LBB0_1:
	movq	_grub_errno@GOTPCREL(%rip), %r12
	jmp	LBB0_9
LBB0_4:
	testq	%r15, %r15
	je	LBB0_6
## %bb.5:
	cmpb	$47, (%r15)
	jne	LBB0_6
## %bb.7:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_grub_ufs_find_file
	movq	_grub_errno@GOTPCREL(%rip), %r12
	cmpq	$0, (%r12)
	jne	LBB0_3
## %bb.8:
	movq	%rbx, 8(%r14)
	movq	%rbx, %rdi
	callq	_INODE_SIZE
	movl	%eax, (%r14)
	movq	_GRUB_ERR_NONE@GOTPCREL(%rip), %r12
	jmp	LBB0_9
LBB0_6:
	movq	_GRUB_ERR_BAD_FILENAME@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_grub_error
LBB0_9:
	movq	(%r12), %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_grub_errno,8,3                 ## @grub_errno
	.comm	_GRUB_ERR_BAD_FILENAME,4,2      ## @GRUB_ERR_BAD_FILENAME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bad filename"

	.comm	_GRUB_ERR_NONE,8,3              ## @GRUB_ERR_NONE
	.no_dead_strip	_grub_ufs_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function grub_ufs_open
_grub_ufs_open:                         ; @grub_ufs_open
	.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	x21, x1
	mov	x19, x0
	ldr	x8, [x0, #16]
	ldr	w0, [x8]
	bl	_grub_ufs_mount
Lloh0:
	adrp	x22, _grub_errno@GOTPAGE
Lloh1:
	ldr	x22, [x22, _grub_errno@GOTPAGEOFF]
	cbz	x0, LBB0_9
; %bb.1:
	mov	x20, x0
	mov	w1, #2
	mov	w2, #0
	bl	_grub_ufs_read_inode
	ldr	x8, [x22]
	cbz	x8, LBB0_3
LBB0_2:
	mov	x0, x20
	bl	_grub_free
	b	LBB0_8
LBB0_3:
	cbz	x21, LBB0_7
; %bb.4:
	ldrb	w8, [x21]
	cmp	w8, #47
	b.ne	LBB0_7
; %bb.5:
	mov	x0, x20
	mov	x1, x21
	bl	_grub_ufs_find_file
	ldr	x8, [x22]
	cbnz	x8, LBB0_2
; %bb.6:
	str	x20, [x19, #8]
	mov	x0, x20
	bl	_INODE_SIZE
	str	w0, [x19]
Lloh2:
	adrp	x22, _GRUB_ERR_NONE@GOTPAGE
Lloh3:
	ldr	x22, [x22, _GRUB_ERR_NONE@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
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
LBB0_8:
Lloh9:
	adrp	x22, _grub_errno@GOTPAGE
Lloh10:
	ldr	x22, [x22, _grub_errno@GOTPAGEOFF]
LBB0_9:
	ldr	x0, [x22]
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_grub_errno,8,3                 ; @grub_errno
	.comm	_GRUB_ERR_BAD_FILENAME,4,2      ; @GRUB_ERR_BAD_FILENAME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bad filename"

	.comm	_GRUB_ERR_NONE,8,3              ; @GRUB_ERR_NONE
	.no_dead_strip	_grub_ufs_open
.subsections_via_symbols
