	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_bbt_block
_get_bbt_block:                         ## @get_bbt_block
	.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, %r13d
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r15
	movq	%rdi, %r12
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_nanddev_target_size
	movl	%eax, %edi
	movq	(%r15), %rax
	movslq	%r13d, %rdx
	movl	(%rax,%rdx,4), %ebx
	movl	(%r12), %ecx
	cmpl	$-1, %ebx
	je	LBB0_2
## %bb.1:
	subl	4(%r12), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %ebx
	jmp	LBB0_11
LBB0_2:
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %edi
	movl	8(%r15), %esi
	movq	_NAND_BBT_PERCHIP@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	jne	LBB0_4
## %bb.3:
	movl	%edi, %ebx
	movq	%r14, %rdi
	callq	_nanddev_ntargets
	movl	%ebx, %edi
	imull	%eax, %edi
	movl	8(%r15), %esi
LBB0_4:
	movq	_NAND_BBT_LASTBLOCK@GOTPCREL(%rip), %rax
	leal	1(%r13), %ecx
	imull	%edi, %ecx
	decl	%ecx
	imull	%r13d, %edi
	andl	(%rax), %esi
	cmovnel	%ecx, %edi
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	cmpl	$0, 12(%r15)
	jle	LBB0_10
## %bb.5:
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	incl	%r14d
	decl	%r15d
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	cmpl	12(%rax), %r14d
	movl	%r12d, %esi
	movl	%r13d, %edi
	jge	LBB0_10
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	%esi, %r12d
	testl	%esi, %esi
	movl	%r15d, %ebx
	cmovel	%r14d, %ebx
	movl	%edi, %r13d
	addl	%edi, %ebx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	_bbt_get_entry
	andl	$-2, %eax
	cmpl	$128, %eax
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	testq	%rdx, %rdx
	je	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %ecx
	subl	4(%rax), %ecx
	movl	%ebx, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	movq	(%rdx), %rcx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	cmpl	%eax, (%rcx,%rdx,4)
	je	LBB0_9
	jmp	LBB0_11
LBB0_10:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_BBT_PERCHIP,4,2           ## @NAND_BBT_PERCHIP
	.comm	_NAND_BBT_LASTBLOCK,4,2         ## @NAND_BBT_LASTBLOCK
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.no_dead_strip	_get_bbt_block
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_bbt_block
_get_bbt_block:                         ; @get_bbt_block
	.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	x22, x3
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	add	x23, x0, #8
	mov	x0, x23
	bl	_nanddev_target_size
	ldr	x8, [x21]
	ldr	w8, [x8, w22, sxtw #2]
	ldr	w9, [x20]
	cmn	w8, #1
	b.eq	LBB0_2
; %bb.1:
	ldr	w10, [x20, #4]
	sub	w9, w9, w10
	asr	w22, w8, w9
	b	LBB0_11
LBB0_2:
	asr	w24, w0, w9
	ldr	w8, [x21, #8]
Lloh0:
	adrp	x9, _NAND_BBT_PERCHIP@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NAND_BBT_PERCHIP@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_4
; %bb.3:
	mov	x0, x23
	bl	_nanddev_ntargets
	mul	w24, w0, w24
	ldr	w8, [x21, #8]
LBB0_4:
Lloh3:
	adrp	x9, _NAND_BBT_LASTBLOCK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NAND_BBT_LASTBLOCK@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	mul	w10, w24, w22
	add	w11, w24, w10
	sub	w11, w11, #1
	ands	w23, w9, w8
	csel	w24, w10, w11, eq
	ldr	w8, [x21, #12]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.5:
	mov	w25, #0
	mov	w26, #0
	sxtw	x27, w22
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	w26, w26, #1
	ldr	w8, [x21, #12]
	sub	w25, w25, #1
	cmp	w26, w8
	b.ge	LBB0_10
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w23, #0
	csel	w8, w26, w25, eq
	add	w22, w8, w24
	mov	x0, x20
	mov	x1, x22
	bl	_bbt_get_entry
	and	w8, w0, #0xfffffffe
	cmp	w8, #128
	b.eq	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	cbz	x19, LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldp	w8, w9, [x20]
	sub	w8, w8, w9
	lsl	w8, w22, w8
	ldr	x9, [x19]
	ldr	w9, [x9, x27, lsl #2]
	cmp	w9, w8
	b.eq	LBB0_6
	b	LBB0_11
LBB0_10:
Lloh6:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_11:
	mov	x0, x22
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_BBT_PERCHIP,4,2           ; @NAND_BBT_PERCHIP
	.comm	_NAND_BBT_LASTBLOCK,4,2         ; @NAND_BBT_LASTBLOCK
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.no_dead_strip	_get_bbt_block
.subsections_via_symbols
