	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun_partition_map_iterate
_sun_partition_map_iterate:             ## @sun_partition_map_iterate
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movl	%edi, %ebx
	movl	$4, %edi
	callq	_grub_zalloc
	testq	%rax, %rax
	je	LBB0_16
## %bb.1:
	movq	%rax, %r13
	movq	_grub_sun_partition_map@GOTPCREL(%rip), %rax
	movq	%rax, 24(%r13)
	leaq	-104(%rbp), %r8
	movl	%ebx, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$32, %ecx
	callq	_grub_disk_read
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%rax, %rbx
	movq	%r13, %rdi
	callq	_grub_free
	jmp	LBB0_17
LBB0_3:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	_GRUB_PARTMAP_SUN_MAGIC@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	-80(%rbp), %edi
	callq	_grub_be_to_cpu16
	cmpl	%eax, %ebx
	jne	LBB0_4
## %bb.6:
	leaq	-104(%rbp), %rdi
	callq	_grub_sun_is_valid
	testl	%eax, %eax
	je	LBB0_18
## %bb.7:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	_GRUB_PARTMAP_SUN_MAX_PARTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_15
## %bb.8:
	xorl	%r15d, %r15d
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%r13, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	*-56(%rbp)                      ## 8-byte Folded Reload
	testl	%eax, %eax
	movq	_GRUB_PARTMAP_SUN_MAX_PARTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmovnel	%eax, %r15d
LBB0_14:                                ##   in Loop: Header=BB0_9 Depth=1
	incl	%r15d
	cmpl	%eax, %r15d
	jge	LBB0_15
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	-88(%rbp), %rcx
	movslq	%r15d, %r12
	movq	(%rcx,%r12,8), %rcx
	testq	%rcx, %rcx
	je	LBB0_14
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_GRUB_PARTMAP_SUN_WHOLE_DISK_ID@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	-96(%rbp), %rbx
	movl	4(%rbx,%r12,8), %edi
	callq	_grub_be_to_cpu32
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	-100(%rbp), %edi
	callq	_grub_be_to_cpu16
	movl	%eax, %r14d
	movl	-104(%rbp), %edi
	callq	_grub_be_to_cpu16
	imull	%r14d, %eax
	imull	-72(%rbp), %eax                 ## 4-byte Folded Reload
	movl	%eax, (%r13)
	movl	(%rbx,%r12,8), %edi
	callq	_grub_be_to_cpu32
	movq	%rax, 16(%r13)
	movl	%r12d, 8(%r13)
	movl	%r12d, 4(%r13)
	testq	%rax, %rax
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_GRUB_PARTMAP_SUN_MAX_PARTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_14
LBB0_4:
	movq	%r13, %rdi
	callq	_grub_free
	movq	_GRUB_ERR_BAD_PART_TABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_5
LBB0_15:
	movq	%r13, %rdi
	callq	_grub_free
LBB0_16:
	movq	_grub_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	jmp	LBB0_17
LBB0_18:
	movq	%r13, %rdi
	callq	_grub_free
	movq	_GRUB_ERR_BAD_PART_TABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_5:
	callq	_grub_error
	movq	%rax, %rbx
LBB0_17:
	movq	%rbx, %rax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_grub_errno,8,3                 ## @grub_errno
	.comm	_grub_sun_partition_map,4,2     ## @grub_sun_partition_map
	.comm	_GRUB_PARTMAP_SUN_MAGIC,4,2     ## @GRUB_PARTMAP_SUN_MAGIC
	.comm	_GRUB_ERR_BAD_PART_TABLE,4,2    ## @GRUB_ERR_BAD_PART_TABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"not a sun partition table"

L_.str.1:                               ## @.str.1
	.asciz	"invalid checksum"

	.comm	_GRUB_PARTMAP_SUN_MAX_PARTS,4,2 ## @GRUB_PARTMAP_SUN_MAX_PARTS
	.comm	_GRUB_PARTMAP_SUN_WHOLE_DISK_ID,8,3 ## @GRUB_PARTMAP_SUN_WHOLE_DISK_ID
	.no_dead_strip	_sun_partition_map_iterate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun_partition_map_iterate
_sun_partition_map_iterate:             ; @sun_partition_map_iterate
	.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	x20, x2
	mov	x21, x1
	mov	x22, x0
	mov	w0, #4
	bl	_grub_zalloc
	cbz	x0, LBB0_14
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _grub_sun_partition_map@GOTPAGE
Lloh1:
	ldr	x8, [x8, _grub_sun_partition_map@GOTPAGEOFF]
	str	x8, [x0, #24]
	mov	x4, sp
	mov	x0, x22
	mov	w1, #0
	mov	w2, #0
	mov	w3, #32
	bl	_grub_disk_read
	cbz	x0, LBB0_3
; %bb.2:
	mov	x23, x0
	mov	x0, x19
	bl	_grub_free
	b	LBB0_17
LBB0_3:
Lloh2:
	adrp	x8, _GRUB_PARTMAP_SUN_MAGIC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GRUB_PARTMAP_SUN_MAGIC@GOTPAGEOFF]
Lloh4:
	ldr	w23, [x8]
	ldr	w0, [sp, #24]
	bl	_grub_be_to_cpu16
	cmp	w23, w0
	b.ne	LBB0_12
; %bb.4:
	mov	x0, sp
	bl	_grub_sun_is_valid
	cbz	w0, LBB0_15
; %bb.5:
Lloh5:
	adrp	x24, _GRUB_PARTMAP_SUN_MAX_PARTS@GOTPAGE
Lloh6:
	ldr	x24, [x24, _GRUB_PARTMAP_SUN_MAX_PARTS@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.6:
	mov	w25, #0
Lloh7:
	adrp	x26, _GRUB_PARTMAP_SUN_WHOLE_DISK_ID@GOTPAGE
Lloh8:
	ldr	x26, [x26, _GRUB_PARTMAP_SUN_WHOLE_DISK_ID@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x22
	mov	x1, x19
	mov	x2, x20
	blr	x21
	ldr	w8, [x24]
	cmp	w0, #0
	csel	w25, w25, w8, eq
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	w25, w25, #1
	cmp	w25, w8
	b.ge	LBB0_13
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [sp, #16]
	ldr	x9, [x9, w25, sxtw #3]
	ldr	x10, [x26]
	cmp	x9, #0
	ccmp	x9, x10, #4, ne
	b.eq	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	sxtw	x8, w25
	ldr	x9, [sp, #8]
	add	x27, x9, x8, lsl #3
	ldr	w0, [x27, #4]
	bl	_grub_be_to_cpu32
	mov	x23, x0
	ldr	w0, [sp, #4]
	bl	_grub_be_to_cpu16
	mul	w23, w0, w23
	ldr	w0, [sp]
	bl	_grub_be_to_cpu16
	mul	w8, w23, w0
	str	w8, [x19]
	ldr	w0, [x27]
	bl	_grub_be_to_cpu32
	str	x0, [x19, #16]
	stp	w25, w25, [x19, #4]
	cbnz	x0, LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w8, [x24]
	b	LBB0_8
LBB0_12:
	mov	x0, x19
	bl	_grub_free
Lloh9:
	adrp	x8, _GRUB_ERR_BAD_PART_TABLE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GRUB_ERR_BAD_PART_TABLE@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_16
LBB0_13:
	mov	x0, x19
	bl	_grub_free
LBB0_14:
Lloh14:
	adrp	x8, _grub_errno@GOTPAGE
Lloh15:
	ldr	x8, [x8, _grub_errno@GOTPAGEOFF]
Lloh16:
	ldr	x23, [x8]
	b	LBB0_17
LBB0_15:
	mov	x0, x19
	bl	_grub_free
Lloh17:
	adrp	x8, _GRUB_ERR_BAD_PART_TABLE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _GRUB_ERR_BAD_PART_TABLE@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_16:
	bl	_grub_error
	mov	x23, x0
LBB0_17:
	mov	x0, x23
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_grub_errno,8,3                 ; @grub_errno
	.comm	_grub_sun_partition_map,4,2     ; @grub_sun_partition_map
	.comm	_GRUB_PARTMAP_SUN_MAGIC,4,2     ; @GRUB_PARTMAP_SUN_MAGIC
	.comm	_GRUB_ERR_BAD_PART_TABLE,4,2    ; @GRUB_ERR_BAD_PART_TABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"not a sun partition table"

l_.str.1:                               ; @.str.1
	.asciz	"invalid checksum"

	.comm	_GRUB_PARTMAP_SUN_MAX_PARTS,4,2 ; @GRUB_PARTMAP_SUN_MAX_PARTS
	.comm	_GRUB_PARTMAP_SUN_WHOLE_DISK_ID,8,3 ; @GRUB_PARTMAP_SUN_WHOLE_DISK_ID
	.no_dead_strip	_sun_partition_map_iterate
.subsections_via_symbols
