	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msb_read_boot_blocks
_msb_read_boot_blocks:                  ## @msb_read_boot_blocks
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_MS_BLOCK_INVALID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%rdi), %rcx
	movl	%eax, (%rcx)
	movl	%eax, 4(%rcx)
	movq	$0, 8(%rdi)
	leaq	L_.str(%rip), %rdi
	callq	_dbg_verbose
	movq	24(%r14), %r15
	testq	%r15, %r15
	jne	LBB0_5
## %bb.1:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$2, %edi
	movl	$4, %esi
	callq	_kmalloc_array
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movq	%rax, %r15
	movq	%rax, 24(%r14)
LBB0_5:
	movq	_MS_BLOCK_MAX_BOOT_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r14)
	testl	%eax, %eax
	jle	LBB0_14
## %bb.6:
	xorl	%ebx, %ebx
	leaq	-56(%rbp), %r12
	leaq	L_.str.1(%rip), %r13
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	$4, %edx
	callq	_sg_init_one
	movq	%r14, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	leaq	-48(%rbp), %rcx
	movq	%r12, %r8
	xorl	%r9d, %r9d
	callq	_msb_read_page
	movq	%r13, %rdi
	testq	%rax, %rax
	jne	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	_MEMSTICK_MANAGEMENT_SYSFLG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	L_.str.2(%rip), %rdi
	testl	%eax, -48(%rbp)
	jne	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r15), %edi
	callq	_be16_to_cpu
	leaq	L_.str.3(%rip), %rdi
	movq	_MS_BLOCK_BOOT_ID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%r15, %rdi
	callq	_msb_fix_boot_page_endianness
	movq	(%r14), %rax
	movq	8(%r14), %rcx
	movl	%ebx, (%rax,%rcx,4)
	incq	%rcx
	movq	%rcx, 8(%r14)
	cmpq	$2, %rcx
	je	LBB0_16
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	addq	$4, %r15
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	%ebx, %esi
	callq	_dbg
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=1
	incl	%ebx
	movq	_MS_BLOCK_MAX_BOOT_ADDR@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jl	LBB0_7
LBB0_14:
	cmpq	$0, 8(%r14)
	je	LBB0_15
LBB0_16:
	leaq	L_.str.5(%rip), %rdi
	callq	_dbg_verbose
	xorl	%eax, %eax
	jmp	LBB0_17
LBB0_15:
	leaq	L_.str.4(%rip), %rdi
	callq	_pr_err
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_17:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MS_BLOCK_INVALID,8,3           ## @MS_BLOCK_INVALID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Start of a scan for the boot blocks"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MS_BLOCK_MAX_BOOT_ADDR,4,2     ## @MS_BLOCK_MAX_BOOT_ADDR
L_.str.1:                               ## @.str.1
	.asciz	"boot scan: can't read pba %d"

	.comm	_MEMSTICK_MANAGEMENT_SYSFLG,4,2 ## @MEMSTICK_MANAGEMENT_SYSFLG
L_.str.2:                               ## @.str.2
	.asciz	"management flag doesn't indicate boot block %d"

	.comm	_MS_BLOCK_BOOT_ID,8,3           ## @MS_BLOCK_BOOT_ID
L_.str.3:                               ## @.str.3
	.asciz	"the pba at %d doesn' contain boot block ID"

L_.str.4:                               ## @.str.4
	.asciz	"media doesn't contain master page, aborting"

	.comm	_EIO,4,2                        ## @EIO
L_.str.5:                               ## @.str.5
	.asciz	"End of scan for boot blocks"

	.no_dead_strip	_msb_read_boot_blocks
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msb_read_boot_blocks
_msb_read_boot_blocks:                  ; @msb_read_boot_blocks
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x0
Lloh0:
	adrp	x8, _MS_BLOCK_INVALID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MS_BLOCK_INVALID@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	x9, [x0]
	stp	w8, w8, [x9]
	str	xzr, [x0, #8]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dbg_verbose
	ldr	x20, [x19, #24]
	cbnz	x20, LBB0_3
; %bb.1:
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	w0, #2
	mov	w1, #4
	bl	_kmalloc_array
	cbz	x0, LBB0_15
; %bb.2:
	mov	x20, x0
	str	x0, [x19, #24]
LBB0_3:
Lloh8:
	adrp	x22, _MS_BLOCK_MAX_BOOT_ADDR@GOTPAGE
Lloh9:
	ldr	x22, [x22, _MS_BLOCK_MAX_BOOT_ADDR@GOTPAGEOFF]
	ldr	w8, [x22]
	str	w8, [x19, #16]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.4:
	mov	w21, #0
Lloh10:
	adrp	x23, l_.str.1@PAGE
Lloh11:
	add	x23, x23, l_.str.1@PAGEOFF
Lloh12:
	adrp	x24, _MEMSTICK_MANAGEMENT_SYSFLG@GOTPAGE
Lloh13:
	ldr	x24, [x24, _MEMSTICK_MANAGEMENT_SYSFLG@GOTPAGEOFF]
Lloh14:
	adrp	x25, l_.str.2@PAGE
Lloh15:
	add	x25, x25, l_.str.2@PAGEOFF
Lloh16:
	adrp	x26, _MS_BLOCK_BOOT_ID@GOTPAGE
Lloh17:
	ldr	x26, [x26, _MS_BLOCK_BOOT_ID@GOTPAGEOFF]
Lloh18:
	adrp	x27, l_.str.3@PAGE
Lloh19:
	add	x27, x27, l_.str.3@PAGEOFF
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #8
	mov	x1, x20
	mov	w2, #4
	bl	_sg_init_one
	mov	x3, sp
	add	x4, sp, #8
	mov	x0, x19
	mov	x1, x21
	mov	w2, #0
	mov	w5, #0
	bl	_msb_read_page
	mov	x8, x0
	mov	x0, x23
	cbnz	x8, LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [sp]
	ldr	w9, [x24]
	mov	x0, x25
	tst	w9, w8
	b.ne	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x20]
	bl	_be16_to_cpu
	mov	x8, x0
	ldr	x9, [x26]
	mov	x0, x27
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	bl	_msb_fix_boot_page_endianness
	ldp	x8, x9, [x19]
	str	w21, [x8, x9, lsl #2]
	add	x8, x9, #1
	str	x8, [x19, #8]
	cmp	x8, #2
	b.eq	LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x20, x20, #4
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x1, x21
	bl	_dbg
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
	add	w21, w21, #1
	ldr	w8, [x22]
	cmp	w21, w8
	b.lt	LBB0_5
LBB0_12:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_14
LBB0_13:
Lloh20:
	adrp	x0, l_.str.5@PAGE
Lloh21:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_dbg_verbose
	mov	w0, #0
	b	LBB0_17
LBB0_14:
Lloh22:
	adrp	x0, l_.str.4@PAGE
Lloh23:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_err
Lloh24:
	adrp	x8, _EIO@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_16
LBB0_15:
Lloh26:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_17:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_MS_BLOCK_INVALID,8,3           ; @MS_BLOCK_INVALID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Start of a scan for the boot blocks"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MS_BLOCK_MAX_BOOT_ADDR,4,2     ; @MS_BLOCK_MAX_BOOT_ADDR
l_.str.1:                               ; @.str.1
	.asciz	"boot scan: can't read pba %d"

	.comm	_MEMSTICK_MANAGEMENT_SYSFLG,4,2 ; @MEMSTICK_MANAGEMENT_SYSFLG
l_.str.2:                               ; @.str.2
	.asciz	"management flag doesn't indicate boot block %d"

	.comm	_MS_BLOCK_BOOT_ID,8,3           ; @MS_BLOCK_BOOT_ID
l_.str.3:                               ; @.str.3
	.asciz	"the pba at %d doesn' contain boot block ID"

l_.str.4:                               ; @.str.4
	.asciz	"media doesn't contain master page, aborting"

	.comm	_EIO,4,2                        ; @EIO
l_.str.5:                               ; @.str.5
	.asciz	"End of scan for boot blocks"

	.no_dead_strip	_msb_read_boot_blocks
.subsections_via_symbols
