	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function grub_ufs_mount
_grub_ufs_mount:                        ## @grub_ufs_mount
	.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
	movl	%edi, %r15d
	movq	_sblocklist@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	$24, %edi
	callq	_grub_malloc
	testq	%rax, %rax
	je	LBB0_13
## %bb.1:
	movq	%rax, %r14
	movl	%r15d, 16(%rax)
	movq	$0, 8(%rax)
	movl	(%rbx), %esi
	cmpl	$-1, %esi
	je	LBB0_9
## %bb.2:
	movq	%r14, %r12
	addq	$4, %r12
	addq	$4, %rbx
	movq	_GRUB_UFS_MAGIC@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %edi
	xorl	%edx, %edx
	movl	$4, %ecx
	movq	%r12, %r8
	callq	_grub_disk_read
	movq	_grub_errno@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r12), %edi
	callq	_grub_le_to_cpu32
	cmpq	(%r13), %rax
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r12), %edi
	callq	_grub_be_to_cpu32
	cmpq	(%r13), %rax
	je	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%rbx), %esi
	addq	$4, %rbx
	cmpl	$-1, %esi
	jne	LBB0_4
LBB0_9:
	movq	_grub_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_GRUB_ERR_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_11
## %bb.10:
	movq	_GRUB_ERR_OUT_OF_RANGE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
LBB0_11:
	movq	_GRUB_ERR_BAD_FS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_grub_error
LBB0_12:
	movq	%r14, %rdi
	callq	_grub_free
LBB0_13:
	xorl	%r14d, %r14d
LBB0_14:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	$0, (%r14)
	jmp	LBB0_14
LBB0_8:
	movl	$1, (%r14)
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_sblocklist,8,3                 ## @sblocklist
	.comm	_grub_errno,8,3                 ## @grub_errno
	.comm	_GRUB_UFS_MAGIC,8,3             ## @GRUB_UFS_MAGIC
	.comm	_GRUB_ERR_NONE,8,3              ## @GRUB_ERR_NONE
	.comm	_GRUB_ERR_OUT_OF_RANGE,8,3      ## @GRUB_ERR_OUT_OF_RANGE
	.comm	_GRUB_ERR_BAD_FS,4,2            ## @GRUB_ERR_BAD_FS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"not an ufs1 filesystem"

	.no_dead_strip	_grub_ufs_mount
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function grub_ufs_mount
_grub_ufs_mount:                        ; @grub_ufs_mount
	.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	x20, x0
Lloh0:
	adrp	x8, _sblocklist@GOTPAGE
Lloh1:
	ldr	x8, [x8, _sblocklist@GOTPAGEOFF]
Lloh2:
	ldr	x23, [x8]
	mov	w0, #24
	bl	_grub_malloc
	mov	x19, x0
	cbz	x0, LBB0_10
; %bb.1:
	str	w20, [x19, #16]
	str	xzr, [x19, #8]
	ldr	w1, [x23]
Lloh3:
	adrp	x22, _grub_errno@GOTPAGE
Lloh4:
	ldr	x22, [x22, _grub_errno@GOTPAGEOFF]
	cmn	w1, #1
	b.eq	LBB0_7
; %bb.2:
	add	x21, x19, #4
	add	x23, x23, #4
Lloh5:
	adrp	x24, _GRUB_UFS_MAGIC@GOTPAGE
Lloh6:
	ldr	x24, [x24, _GRUB_UFS_MAGIC@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	w2, #0
	mov	w3, #4
	mov	x4, x21
	bl	_grub_disk_read
	ldr	x8, [x22]
	cbnz	x8, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x21]
	bl	_grub_le_to_cpu32
	ldr	x8, [x24]
	cmp	x0, x8
	b.eq	LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x21]
	bl	_grub_be_to_cpu32
	ldr	x8, [x24]
	cmp	x0, x8
	b.eq	LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w1, [x23], #4
	cmn	w1, #1
	b.ne	LBB0_3
LBB0_7:
	ldr	x8, [x22]
Lloh7:
	adrp	x9, _GRUB_ERR_NONE@GOTPAGE
Lloh8:
	ldr	x9, [x9, _GRUB_ERR_NONE@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
Lloh10:
	adrp	x10, _GRUB_ERR_OUT_OF_RANGE@GOTPAGE
Lloh11:
	ldr	x10, [x10, _GRUB_ERR_OUT_OF_RANGE@GOTPAGEOFF]
Lloh12:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_9
; %bb.8:
Lloh13:
	adrp	x8, _GRUB_ERR_BAD_FS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GRUB_ERR_BAD_FS@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	bl	_grub_error
LBB0_9:
	mov	x0, x19
	bl	_grub_free
	mov	x19, #0
LBB0_10:
	mov	x0, x19
	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_11:
	str	wzr, [x19]
	b	LBB0_10
LBB0_12:
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_sblocklist,8,3                 ; @sblocklist
	.comm	_grub_errno,8,3                 ; @grub_errno
	.comm	_GRUB_UFS_MAGIC,8,3             ; @GRUB_UFS_MAGIC
	.comm	_GRUB_ERR_NONE,8,3              ; @GRUB_ERR_NONE
	.comm	_GRUB_ERR_OUT_OF_RANGE,8,3      ; @GRUB_ERR_OUT_OF_RANGE
	.comm	_GRUB_ERR_BAD_FS,4,2            ; @GRUB_ERR_BAD_FS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"not an ufs1 filesystem"

	.no_dead_strip	_grub_ufs_mount
.subsections_via_symbols
