	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function create_bbt
_create_bbt:                            ## @create_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movq	%rdx, %r14
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	addq	$4, %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_nanddev_target_size
	movl	%eax, %r13d
	movq	%r12, %rdi
	callq	_nand_to_mtd
	movq	%rax, %rbx
	leaq	L_.str(%rip), %rdi
	callq	_pr_info
	cmpl	$-1, %r15d
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_1
## %bb.2:
	movslq	%r15d, %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_nanddev_ntargets
	cmpq	-48(%rbp), %rax                 ## 8-byte Folded Reload
	jbe	LBB0_3
## %bb.4:
	movb	(%r12), %cl
	sarl	%cl, %r13d
	imull	%r13d, %r15d
	addl	%r15d, %r13d
	movl	%r15d, %ebx
	shll	%cl, %ebx
	jmp	LBB0_5
LBB0_1:
	movq	%rbx, %rax
	movl	(%rbx), %r13d
	movb	(%r12), %cl
	sarl	%cl, %r13d
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
LBB0_5:
	xorl	%eax, %eax
	cmpl	%r13d, %r15d
	jl	LBB0_6
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	movzbl	(%r12), %ecx
	movl	$1, %eax
	shll	%cl, %eax
	addl	%eax, %ebx
	incl	%r15d
	cmpl	%r15d, %r13d
	je	LBB0_10
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	_NAND_BBT_NO_OOB@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	andl	(%r14), %edi
	callq	_BUG_ON
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%ebx, %edx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	callq	_scan_block_fast
	testl	%eax, %eax
	js	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	_BBT_BLOCK_FACTORY_BAD@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_bbt_mark_entry
	movslq	%ebx, %rdx
	leaq	L_.str.2(%rip), %rdi
	movl	%r15d, %esi
	callq	_pr_warn
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	incl	4(%rax)
	jmp	LBB0_9
LBB0_3:
	incl	%r15d
	movq	%rbx, %rdi
	callq	_nanddev_ntargets
	leaq	L_.str.1(%rip), %rdi
	movl	%r15d, %esi
	movq	%rax, %rdx
	callq	_pr_warn
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_11
LBB0_10:
	xorl	%eax, %eax
LBB0_11:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Scanning device for bad blocks\n"

L_.str.1:                               ## @.str.1
	.asciz	"create_bbt(): chipnr (%d) > available chips (%d)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NAND_BBT_NO_OOB,4,2            ## @NAND_BBT_NO_OOB
	.comm	_BBT_BLOCK_FACTORY_BAD,4,2      ## @BBT_BLOCK_FACTORY_BAD
L_.str.2:                               ## @.str.2
	.asciz	"Bad eraseblock %d at 0x%012llx\n"

	.no_dead_strip	_create_bbt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function create_bbt
_create_bbt:                            ; @create_bbt
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	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
	.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	x23, x3
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	add	x24, x0, #4
	mov	x0, x24
	bl	_nanddev_target_size
	mov	x25, x0
	mov	x0, x21
	bl	_nand_to_mtd
	mov	x22, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
	cmn	w23, #1
	b.eq	LBB0_3
; %bb.1:
	mov	x0, x24
	bl	_nanddev_ntargets
	cmp	x0, w23, sxtw
	b.ls	LBB0_10
; %bb.2:
	ldr	w8, [x21]
	asr	w9, w25, w8
	mul	w23, w9, w23
	add	w26, w23, w9
	lsl	w24, w23, w8
	cmp	w23, w26
	b.lt	LBB0_4
	b	LBB0_9
LBB0_3:
	mov	w23, #0
	mov	w24, #0
	ldr	w8, [x22]
	ldr	w9, [x21]
	asr	w26, w8, w9
	cmp	w23, w26
	b.ge	LBB0_9
LBB0_4:
Lloh2:
	adrp	x27, _NAND_BBT_NO_OOB@GOTPAGE
Lloh3:
	ldr	x27, [x27, _NAND_BBT_NO_OOB@GOTPAGEOFF]
	mov	w28, #1
Lloh4:
	adrp	x25, l_.str.2@PAGE
Lloh5:
	add	x25, x25, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x21]
	lsl	w8, w28, w8
	add	w24, w8, w24
	add	w23, w23, #1
	cmp	w26, w23
	b.eq	LBB0_9
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x19]
	ldr	w9, [x27]
	and	w0, w9, w8
	bl	_BUG_ON
	mov	x0, x21
	mov	x1, x19
	mov	x2, x24
	mov	x3, x20
	bl	_scan_block_fast
	tbnz	w0, #31, LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	cbz	w0, LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
Lloh6:
	adrp	x8, _BBT_BLOCK_FACTORY_BAD@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BBT_BLOCK_FACTORY_BAD@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x1, x23
	bl	_bbt_mark_entry
	sxtw	x2, w24
	mov	x0, x25
	mov	x1, x23
	bl	_pr_warn
	ldr	w8, [x22, #4]
	add	w8, w8, #1
	str	w8, [x22, #4]
	b	LBB0_5
LBB0_9:
	mov	w0, #0
	b	LBB0_11
LBB0_10:
	add	w19, w23, #1
	mov	x0, x24
	bl	_nanddev_ntargets
	mov	x2, x0
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_pr_warn
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Scanning device for bad blocks\n"

l_.str.1:                               ; @.str.1
	.asciz	"create_bbt(): chipnr (%d) > available chips (%d)\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NAND_BBT_NO_OOB,4,2            ; @NAND_BBT_NO_OOB
	.comm	_BBT_BLOCK_FACTORY_BAD,4,2      ; @BBT_BLOCK_FACTORY_BAD
l_.str.2:                               ; @.str.2
	.asciz	"Bad eraseblock %d at 0x%012llx\n"

	.no_dead_strip	_create_bbt
.subsections_via_symbols
