	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_bbt
_read_bbt:                              ## @read_bbt
	.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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $r9d killed $r9d def $r9
	movq	%r9, -96(%rbp)                  ## 8-byte Spill
	movq	%r8, %r14
	movl	%ecx, %ebx
	movl	%edx, %r15d
	movq	%rsi, -120(%rbp)                ## 8-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_nand_to_mtd
	movq	_NAND_BBT_NRBITS_MSK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%r14), %ecx
	movl	$-1, %edx
	shll	%cl, %edx
	movl	%edx, -68(%rbp)                 ## 4-byte Spill
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	4(%r14), %eax
	movl	%eax, -100(%rbp)                ## 4-byte Spill
	movl	%ecx, -104(%rbp)                ## 4-byte Spill
	imull	%ecx, %ebx
	movq	%r14, %rdi
	callq	_add_marker_len
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	cmpl	$8, %ebx
	jae	LBB0_1
LBB0_20:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rax, %r14
	notl	-68(%rbp)                       ## 4-byte Folded Spill
	movslq	%r15d, %r15
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movb	(%rax), %cl
	shlq	%cl, %r15
	sarl	$3, %ebx
	movslq	%ebx, %rbx
	movslq	-96(%rbp), %rax                 ## 4-byte Folded Reload
	movq	%rax, -144(%rbp)                ## 8-byte Spill
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%r13d, %r13d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	addq	-112(%rbp), %r15                ## 8-byte Folded Reload
	movl	$0, %r14d
	movq	-136(%rbp), %rbx                ## 8-byte Reload
	subq	-128(%rbp), %rbx                ## 8-byte Folded Reload
	je	LBB0_20
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
                                        ##       Child Loop BB0_10 Depth 3
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movb	8(%rax), %cl
	movl	$1, %eax
	shll	%cl, %eax
	movslq	%eax, %rsi
	movq	%rbx, %rdi
	callq	_min
	movq	%rax, %r12
	movq	%rax, %rdx
	subq	%r14, %rdx
	leaq	(%r14,%r15), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	movq	%rdx, -128(%rbp)                ## 8-byte Spill
	leaq	-152(%rbp), %rcx
	movq	-120(%rbp), %r8                 ## 8-byte Reload
	callq	_mtd_read
	testl	%eax, %eax
	movq	%r12, -112(%rbp)                ## 8-byte Spill
	jns	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %ecx
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movl	%eax, %r14d
	movl	%ecx, %edi
	callq	_mtd_is_eccerr
	testq	%rax, %rax
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%r14d, %edi
	callq	_mtd_is_bitflip
	testq	%rax, %rax
	je	LBB0_21
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	notq	%rax
	movq	%r12, %rsi
	andq	%rax, %rsi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_info
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movq	-112(%rbp), %r12                ## 8-byte Reload
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, -136(%rbp)                ## 8-byte Spill
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	cmpq	%r14, %r12
	je	LBB0_19
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%ecx, %ecx
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_9 Depth=2
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	incq	%rcx
	cmpq	-128(%rbp), %rcx                ## 8-byte Folded Reload
	je	LBB0_19
LBB0_9:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_10 Depth 3
	movq	-120(%rbp), %rax                ## 8-byte Reload
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movl	(%rax,%rcx,4), %r15d
	movslq	%r13d, %rbx
	addq	-144(%rbp), %rbx                ## 8-byte Folded Reload
	xorl	%r14d, %r14d
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_10 Depth=3
	movl	(%rax), %edx
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	leal	(%rax,%r13), %esi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_bbt_mark_entry
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	incl	8(%rax)
LBB0_17:                                ##   in Loop: Header=BB0_10 Depth=3
	addl	-104(%rbp), %r14d               ## 4-byte Folded Reload
	incl	%r13d
	incq	%rbx
	cmpl	$8, %r14d
	jge	LBB0_18
LBB0_10:                                ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_9 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movl	%r15d, %r12d
	movl	%r14d, %ecx
	sarl	%cl, %r12d
	movl	-68(%rbp), %eax                 ## 4-byte Reload
	andl	%eax, %r12d
	cmpl	%eax, %r12d
	je	LBB0_17
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=3
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movzbl	8(%rax), %ecx
	movq	%rbx, %rsi
	shlq	%cl, %rsi
	movl	-100(%rbp), %eax                ## 4-byte Reload
	testl	%eax, %eax
	je	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=3
	cmpl	%eax, %r12d
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=3
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_info
	movq	_BBT_BLOCK_RESERVED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	leal	(%rax,%r13), %esi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_bbt_mark_entry
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	incl	12(%rax)
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_10 Depth=3
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_info
	movq	_BBT_BLOCK_WORN@GOTPCREL(%rip), %rax
	testl	%r12d, %r12d
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_10 Depth=3
	movq	_BBT_BLOCK_FACTORY_BAD@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_4:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	notq	%rax
	movq	%r12, %rsi
	andq	%rax, %rsi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_info
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	jmp	LBB0_20
LBB0_21:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_info
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_BBT_NRBITS_MSK,4,2        ## @NAND_BBT_NRBITS_MSK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"nand_bbt: ECC error in BBT at 0x%012llx\n"

L_.str.1:                               ## @.str.1
	.asciz	"nand_bbt: corrected error in BBT at 0x%012llx\n"

L_.str.2:                               ## @.str.2
	.asciz	"nand_bbt: error reading BBT\n"

L_.str.3:                               ## @.str.3
	.asciz	"nand_read_bbt: reserved block at 0x%012llx\n"

	.comm	_BBT_BLOCK_RESERVED,4,2         ## @BBT_BLOCK_RESERVED
L_.str.4:                               ## @.str.4
	.asciz	"nand_read_bbt: bad block at 0x%012llx\n"

	.comm	_BBT_BLOCK_FACTORY_BAD,4,2      ## @BBT_BLOCK_FACTORY_BAD
	.comm	_BBT_BLOCK_WORN,4,2             ## @BBT_BLOCK_WORN
	.no_dead_strip	_read_bbt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_bbt
_read_bbt:                              ; @read_bbt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x28, x27, [sp, #96]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #112]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #128]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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, x5
	mov	x24, x4
	mov	x27, x3
	mov	x26, x2
	mov	x28, x1
	mov	x21, x0
	bl	_nand_to_mtd
	mov	x22, x0
Lloh0:
	adrp	x8, _NAND_BBT_NRBITS_MSK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_BBT_NRBITS_MSK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldp	w9, w23, [x24]
	and	w25, w8, w9
	mul	w19, w25, w27
	mov	x0, x24
	bl	_add_marker_len
	cmp	w19, #8
	b.hs	LBB0_2
; %bb.1:
	str	wzr, [sp, #20]                  ; 4-byte Folded Spill
	b	LBB0_21
LBB0_2:
	mov	x27, x0
	str	wzr, [sp, #20]                  ; 4-byte Folded Spill
	mov	w24, #0
	mov	w8, #-1
	lsl	w8, w8, w25
	mov	x10, x20
	mvn	w20, w8
	sbfx	x19, x19, #3, #29
	sxtw	x8, w26
	ldr	x9, [x21]
	lsl	x9, x8, x9
	str	x10, [sp, #80]                  ; 8-byte Folded Spill
	sxtw	x8, w10
	stp	x8, x28, [sp, #48]              ; 16-byte Folded Spill
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x27, #0
	ldp	x19, x9, [sp, #32]              ; 16-byte Folded Reload
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	add	x9, x8, x9
	ldr	x8, [sp, #64]                   ; 8-byte Folded Reload
	subs	x19, x19, x8
	b.eq	LBB0_21
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
                                        ;       Child Loop BB0_14 Depth 3
	str	x9, [sp, #40]                   ; 8-byte Folded Spill
	ldr	w8, [x21, #8]
	mov	w9, #1
	lsl	w8, w9, w8
	sxtw	x1, w8
	mov	x0, x19
	bl	_min
	mov	x26, x0
	sub	x2, x0, x27
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	add	x1, x27, x8
	add	x3, sp, #88
	mov	x0, x22
	stp	x2, x1, [sp, #64]               ; 16-byte Folded Spill
	mov	x4, x28
	bl	_mtd_read
	tbz	w0, #31, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	str	x27, [sp, #32]                  ; 8-byte Folded Spill
	mov	x27, x0
	bl	_mtd_is_eccerr
	cbnz	x0, LBB0_18
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x27
	bl	_mtd_is_bitflip
	cbz	x0, LBB0_19
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x22]
	ldr	x9, [sp, #72]                   ; 8-byte Folded Reload
	bic	x8, x9, x8
	str	x8, [sp]
Lloh3:
	adrp	x0, l_.str.1@PAGE
Lloh4:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_info
	str	w27, [sp, #20]                  ; 4-byte Folded Spill
	ldr	x27, [sp, #32]                  ; 8-byte Folded Reload
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	stp	x26, x19, [sp, #24]             ; 16-byte Folded Spill
	cmp	x26, x27
	b.eq	LBB0_3
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x9, #0
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=2
	ldp	x8, x9, [sp, #64]               ; 16-byte Folded Reload
	add	x9, x9, #1
	cmp	x9, x8
	ldr	x28, [sp, #56]                  ; 8-byte Folded Reload
	b.eq	LBB0_3
LBB0_11:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_14 Depth 3
	mov	w26, #0
	str	x9, [sp, #72]                   ; 8-byte Folded Spill
	ldr	w27, [x28, x9, lsl #2]
	ldr	x8, [sp, #48]                   ; 8-byte Folded Reload
	add	x19, x8, w24, sxtw
	b	LBB0_14
LBB0_12:                                ;   in Loop: Header=BB0_14 Depth=3
	str	x8, [sp]
Lloh5:
	adrp	x0, l_.str.4@PAGE
Lloh6:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_info
	cmp	w28, #0
Lloh7:
	adrp	x8, _BBT_BLOCK_FACTORY_BAD@GOTPAGE
Lloh8:
	ldr	x8, [x8, _BBT_BLOCK_FACTORY_BAD@GOTPAGEOFF]
Lloh9:
	adrp	x9, _BBT_BLOCK_WORN@GOTPAGE
Lloh10:
	ldr	x9, [x9, _BBT_BLOCK_WORN@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w2, [x8]
	ldr	x8, [sp, #80]                   ; 8-byte Folded Reload
	add	w1, w8, w24
	mov	x0, x21
	bl	_bbt_mark_entry
	ldr	w8, [x22, #8]
	add	w8, w8, #1
	str	w8, [x22, #8]
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=3
	add	w26, w26, w25
	add	w24, w24, #1
	add	x19, x19, #1
	cmp	w26, #8
	b.ge	LBB0_10
LBB0_14:                                ;   Parent Loop BB0_4 Depth=1
                                        ;     Parent Loop BB0_11 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	asr	w8, w27, w26
	and	w28, w8, w20
	cmp	w28, w20
	b.eq	LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=3
	ldr	w8, [x21, #8]
	lsl	x8, x19, x8
	cbz	w23, LBB0_12
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=3
	cmp	w28, w23
	b.ne	LBB0_12
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=3
	str	x8, [sp]
Lloh11:
	adrp	x0, l_.str.3@PAGE
Lloh12:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_info
Lloh13:
	adrp	x8, _BBT_BLOCK_RESERVED@GOTPAGE
Lloh14:
	ldr	x8, [x8, _BBT_BLOCK_RESERVED@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	ldr	x8, [sp, #80]                   ; 8-byte Folded Reload
	add	w1, w8, w24
	mov	x0, x21
	bl	_bbt_mark_entry
	ldr	w8, [x22, #12]
	add	w8, w8, #1
	str	w8, [x22, #12]
	b	LBB0_13
LBB0_18:
	ldr	x8, [x22]
	ldr	x9, [sp, #72]                   ; 8-byte Folded Reload
	bic	x8, x9, x8
	str	x8, [sp]
Lloh16:
	adrp	x0, l_.str@PAGE
Lloh17:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_20
LBB0_19:
Lloh18:
	adrp	x0, l_.str.2@PAGE
Lloh19:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_20:
	bl	_pr_info
	str	w27, [sp, #20]                  ; 4-byte Folded Spill
LBB0_21:
	ldr	w0, [sp, #20]                   ; 4-byte Folded Reload
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #128]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #112]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_BBT_NRBITS_MSK,4,2        ; @NAND_BBT_NRBITS_MSK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"nand_bbt: ECC error in BBT at 0x%012llx\n"

l_.str.1:                               ; @.str.1
	.asciz	"nand_bbt: corrected error in BBT at 0x%012llx\n"

l_.str.2:                               ; @.str.2
	.asciz	"nand_bbt: error reading BBT\n"

l_.str.3:                               ; @.str.3
	.asciz	"nand_read_bbt: reserved block at 0x%012llx\n"

	.comm	_BBT_BLOCK_RESERVED,4,2         ; @BBT_BLOCK_RESERVED
l_.str.4:                               ; @.str.4
	.asciz	"nand_read_bbt: bad block at 0x%012llx\n"

	.comm	_BBT_BLOCK_FACTORY_BAD,4,2      ; @BBT_BLOCK_FACTORY_BAD
	.comm	_BBT_BLOCK_WORN,4,2             ; @BBT_BLOCK_WORN
	.no_dead_strip	_read_bbt
.subsections_via_symbols
