	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msb_read_bad_block_table
_msb_read_bad_block_table:              ## @msb_read_bad_block_table
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	xorl	%edi, %edi
	cmpl	$2, %esi
	setge	%dil
	callq	_BUG_ON
	movslq	%ebx, %rax
	movq	(%r15), %rcx
	movq	(%rcx,%rax,8), %rdx
	movq	_MS_BLOCK_INVALID@GOTPCREL(%rip), %rcx
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	cmpq	(%rcx), %rdx
	jne	LBB0_3
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_24
LBB0_3:
	movq	32(%r15), %rcx
	movslq	(%rcx,%rax,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.5:
	movl	4(%rcx,%rax,8), %r12d
	addl	$8, %r12d
	movl	8(%r15), %esi
	movl	%r12d, %eax
	cltd
	idivl	%esi
	movl	%eax, %r13d
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	addl	%edx, %edi
	callq	_DIV_ROUND_UP
	movl	%eax, %ebx
	imull	8(%r15), %ebx
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	%r12d, %edx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%eax, %eax
	callq	_dbg
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	leaq	-48(%rbp), %rdi
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, %rsi
	movl	%ebx, %edx
	callq	_sg_init_one
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%ebx, %r14d
	jge	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	%r15, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	%r13d, %edx
	xorl	%ecx, %ecx
	leaq	-48(%rbp), %r8
	movl	%r14d, %r9d
	callq	_msb_read_page
	testl	%eax, %eax
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	incl	%r13d
	addl	8(%r15), %r14d
	cmpl	12(%r15), %r13d
	jne	LBB0_8
## %bb.12:
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_err
LBB0_13:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	shrq	$3, %rax
	movslq	-80(%rbp), %r13                 ## 4-byte Folded Reload
	xorl	%r12d, %r12d
	cmpq	%r13, %rax
	jbe	LBB0_23
## %bb.14:
	leaq	L_.str.2(%rip), %r14
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_15 Depth=1
	movq	%r14, %rdi
LBB0_17:                                ##   in Loop: Header=BB0_15 Depth=1
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_dbg
LBB0_21:                                ##   in Loop: Header=BB0_15 Depth=1
	movq	%r12, %rax
	incq	%r13
	cmpq	%r13, %r12
	jbe	LBB0_22
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	%rax, %r12
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax,%r13,8), %rdi
	callq	_be16_to_cpu
	movq	%rax, %rbx
	cmpq	16(%r15), %rax
	jge	LBB0_16
## %bb.18:                              ##   in Loop: Header=BB0_15 Depth=1
	movl	24(%r15), %esi
	movq	%rbx, %rdi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_15 Depth=1
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_17
LBB0_20:                                ##   in Loop: Header=BB0_15 Depth=1
	leaq	L_.str.4(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_dbg
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_msb_mark_block_used
	jmp	LBB0_21
LBB0_4:
	xorl	%r12d, %r12d
	jmp	LBB0_24
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_10:
	movl	%eax, %r12d
	jmp	LBB0_23
LBB0_22:
	xorl	%r12d, %r12d
LBB0_23:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfree
LBB0_24:
	movl	%r12d, %eax
	addq	$40, %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
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reading bad block of boot block at pba %d, offset %d len %d"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"bad block table extends beyond the boot block"

L_.str.2:                               ## @.str.2
	.asciz	"bad block table contains invalid block %d"

L_.str.3:                               ## @.str.3
	.asciz	"duplicate bad block %d in the table"

L_.str.4:                               ## @.str.4
	.asciz	"block %d is marked as factory bad"

	.no_dead_strip	_msb_read_bad_block_table
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msb_read_bad_block_table
_msb_read_bad_block_table:              ; @msb_read_bad_block_table
	.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, x1
	mov	x19, x0
	cmp	w1, #1
	cset	w0, gt
	bl	_BUG_ON
	ldr	x8, [x19]
	ldr	x21, [x8, w20, sxtw #3]
Lloh0:
	adrp	x8, _MS_BLOCK_INVALID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MS_BLOCK_INVALID@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x21, x8
	b.ne	LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_24
LBB0_3:
	sxtw	x8, w20
	ldr	x9, [x19, #32]
	lsl	x10, x8, #3
	ldrsw	x26, [x9, x10]
	cbz	w26, LBB0_19
; %bb.4:
	add	x8, x9, x8, lsl #3
	ldr	w8, [x8, #4]
	add	w20, w8, #8
	ldr	w1, [x19, #8]
	sdiv	w22, w20, w1
	msub	w27, w22, w1, w20
	add	w0, w27, w26
	bl	_DIV_ROUND_UP
	ldr	w8, [x19, #8]
	mul	w23, w8, w0
	stp	x20, x26, [sp]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_dbg
Lloh7:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_kzalloc
	cbz	x0, LBB0_21
; %bb.5:
	mov	x20, x0
	add	x0, sp, #24
	mov	x1, x20
	mov	x2, x23
	bl	_sg_init_one
	mov	w24, #0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w24, w23
	b.ge	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x4, sp, #24
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	mov	x3, #0
	mov	x5, x24
	bl	_msb_read_page
	cbnz	w0, LBB0_22
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	add	w22, w22, #1
	ldp	w8, w9, [x19, #8]
	add	w24, w8, w24
	cmp	w22, w9
	b.ne	LBB0_6
; %bb.9:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
LBB0_10:
	lsr	x25, x26, #3
	sxtw	x26, w27
	cmp	x25, x26
	b.ls	LBB0_20
; %bb.11:
Lloh12:
	adrp	x21, l_.str.4@PAGE
Lloh13:
	add	x21, x21, l_.str.4@PAGEOFF
Lloh14:
	adrp	x22, l_.str.3@PAGE
Lloh15:
	add	x22, x22, l_.str.3@PAGEOFF
Lloh16:
	adrp	x23, l_.str.2@PAGE
Lloh17:
	add	x23, x23, l_.str.2@PAGEOFF
	b	LBB0_15
LBB0_12:                                ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x23
LBB0_13:                                ;   in Loop: Header=BB0_15 Depth=1
	mov	x1, x24
	bl	_dbg
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x26, x26, #1
	cmp	x25, x26
	b.ls	LBB0_20
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x20, x26, lsl #3]
	bl	_be16_to_cpu
	mov	x24, x0
	ldr	x8, [x19, #16]
	cmp	x0, x8
	b.ge	LBB0_12
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w1, [x19, #24]
	mov	x0, x24
	bl	_test_bit
	cbz	x0, LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x22
	b	LBB0_13
LBB0_18:                                ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x21
	mov	x1, x24
	bl	_dbg
	mov	x0, x19
	mov	x1, x24
	bl	_msb_mark_block_used
	b	LBB0_14
LBB0_19:
	mov	w25, #0
	b	LBB0_24
LBB0_20:
	mov	w25, #0
	b	LBB0_23
LBB0_21:
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_2
LBB0_22:
	mov	x25, x0
LBB0_23:
	mov	x0, x20
	bl	_kfree
LBB0_24:
	mov	x0, x25
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_MS_BLOCK_INVALID,8,3           ; @MS_BLOCK_INVALID
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reading bad block of boot block at pba %d, offset %d len %d"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"bad block table extends beyond the boot block"

l_.str.2:                               ; @.str.2
	.asciz	"bad block table contains invalid block %d"

l_.str.3:                               ; @.str.3
	.asciz	"duplicate bad block %d in the table"

l_.str.4:                               ; @.str.4
	.asciz	"block %d is marked as factory bad"

	.no_dead_strip	_msb_read_bad_block_table
.subsections_via_symbols
