	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function acorn_partition_map_find
_acorn_partition_map_find:              ## @acorn_partition_map_find
	.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
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r14
	movl	%edi, %r12d
	movq	_GRUB_DISK_SECTOR_SIZE@GOTPCREL(%rip), %rcx
	movl	$3072, %eax                     ## imm = 0xC00
	xorl	%edx, %edx
	idivl	(%rcx)
	leaq	-72(%rbp), %r8
	movl	%eax, %esi
	xorl	%edx, %edx
	movl	$40, %ecx
	callq	_grub_disk_read
	testq	%rax, %rax
	jne	LBB0_8
## %bb.1:
	movq	_NONADFS_PARTITION_TYPE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	-72(%rbp), %eax
	movq	_NONADFS_PARTITION_TYPE_LINUX@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_7
## %bb.2:
	xorl	%eax, %eax
	movl	$3, %ecx
	movq	-64(%rbp), %rdx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movzbl	%al, %esi
	shrl	$8, %eax
	addl	%esi, %eax
	addl	-12(%rdx,%rcx,4), %eax
	movzbl	%al, %esi
	shrl	$8, %eax
	addl	%esi, %eax
	addl	-8(%rdx,%rcx,4), %eax
	movzbl	%al, %esi
	shrl	$8, %eax
	addl	%esi, %eax
	addl	-4(%rdx,%rcx,4), %eax
	cmpq	$511, %rcx                      ## imm = 0x1FF
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movzbl	%al, %esi
	shrl	$8, %eax
	addl	%esi, %eax
	addl	(%rdx,%rcx,4), %eax
	addq	$4, %rcx
	jmp	LBB0_3
LBB0_5:
	movl	%eax, %eax
	cmpq	%rax, -56(%rbp)
	jne	LBB0_7
## %bb.6:
	movl	-48(%rbp), %edi
	movl	-44(%rbp), %ebx
	btl	$6, -40(%rbp)
	adcl	$0, %ebx
	imull	-36(%rbp), %ebx
	callq	_grub_le_to_cpu16
	imull	%eax, %ebx
	movl	%ebx, (%r15)
	movq	_LINUX_MAP_ENTRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shll	$3, %eax
	leal	(%rax,%rax,4), %ecx
	movl	%r12d, %edi
	movl	%ebx, %esi
	xorl	%edx, %edx
	movq	%r14, %r8
	callq	_grub_disk_read
	jmp	LBB0_8
LBB0_7:
	movq	_GRUB_ERR_BAD_PART_TABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_grub_error
LBB0_8:
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GRUB_DISK_SECTOR_SIZE,4,2      ## @GRUB_DISK_SECTOR_SIZE
	.comm	_NONADFS_PARTITION_TYPE_MASK,4,2 ## @NONADFS_PARTITION_TYPE_MASK
	.comm	_NONADFS_PARTITION_TYPE_LINUX,4,2 ## @NONADFS_PARTITION_TYPE_LINUX
	.comm	_LINUX_MAP_ENTRIES,4,2          ## @LINUX_MAP_ENTRIES
	.comm	_GRUB_ERR_BAD_PART_TABLE,4,2    ## @GRUB_ERR_BAD_PART_TABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Linux/ADFS partition map not found"

	.no_dead_strip	_acorn_partition_map_find
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function acorn_partition_map_find
_acorn_partition_map_find:              ; @acorn_partition_map_find
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _GRUB_DISK_SECTOR_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GRUB_DISK_SECTOR_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mov	w9, #3072
	sdiv	w1, w9, w8
	add	x4, sp, #8
	mov	w2, #0
	mov	w3, #40
	bl	_grub_disk_read
	cbnz	x0, LBB0_7
; %bb.1:
	ldr	w8, [sp, #8]
Lloh3:
	adrp	x9, _NONADFS_PARTITION_TYPE_MASK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NONADFS_PARTITION_TYPE_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh6:
	adrp	x9, _NONADFS_PARTITION_TYPE_LINUX@GOTPAGE
Lloh7:
	ldr	x9, [x9, _NONADFS_PARTITION_TYPE_LINUX@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.2:
	mov	x8, #0
	mov	w9, #0
	ldr	x10, [sp, #16]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	lsr	w11, w9, #8
	add	w9, w11, w9, uxtb
	ldr	w11, [x10, x8]
	add	w9, w9, w11
	add	x8, x8, #4
	cmp	x8, #2044
	b.ne	LBB0_3
; %bb.4:
	ldr	x8, [sp, #24]
	cmp	x8, w9, uxtw
	b.ne	LBB0_6
; %bb.5:
	ldp	w8, w9, [sp, #40]
	ubfx	w8, w8, #6, #1
	ldp	w0, w10, [sp, #32]
	add	w8, w8, w10
	mul	w22, w8, w9
	bl	_grub_le_to_cpu16
	mul	w1, w22, w0
	str	w1, [x21]
Lloh9:
	adrp	x8, _LINUX_MAP_ENTRIES@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LINUX_MAP_ENTRIES@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	add	w8, w8, w8, lsl #2
	lsl	w3, w8, #3
	mov	x0, x20
	mov	w2, #0
	mov	x4, x19
	bl	_grub_disk_read
	b	LBB0_7
LBB0_6:
Lloh12:
	adrp	x8, _GRUB_ERR_BAD_PART_TABLE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GRUB_ERR_BAD_PART_TABLE@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_grub_error
LBB0_7:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_GRUB_DISK_SECTOR_SIZE,4,2      ; @GRUB_DISK_SECTOR_SIZE
	.comm	_NONADFS_PARTITION_TYPE_MASK,4,2 ; @NONADFS_PARTITION_TYPE_MASK
	.comm	_NONADFS_PARTITION_TYPE_LINUX,4,2 ; @NONADFS_PARTITION_TYPE_LINUX
	.comm	_LINUX_MAP_ENTRIES,4,2          ; @LINUX_MAP_ENTRIES
	.comm	_GRUB_ERR_BAD_PART_TABLE,4,2    ; @GRUB_ERR_BAD_PART_TABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Linux/ADFS partition map not found"

	.no_dead_strip	_acorn_partition_map_find
.subsections_via_symbols
