	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nanddev_bbt_get_block_status   ## -- Begin function nanddev_bbt_get_block_status
	.p2align	4, 0x90
_nanddev_bbt_get_block_status:          ## @nanddev_bbt_get_block_status
	.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
	movl	%esi, %r13d
	movq	%rdi, %r12
	movq	_NAND_BBT_BLOCK_NUM_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_fls
	movl	%eax, %r14d
	movq	(%r12), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%r14d, %eax
	imull	%r13d, %eax
	movq	_BITS_PER_LONG@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	divl	(%rcx)
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	%edx, %r15d
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	callq	_nanddev_neraseblocks
	cmpl	%r13d, %eax
	jbe	LBB0_1
## %bb.2:
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	(%rdx,%rsi,8), %rbx
	movl	%r15d, %ecx
	shrq	%cl, %rbx
	leal	(%r15,%r14), %eax
	movq	_BITS_PER_LONG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	jbe	LBB0_4
## %bb.3:
	movq	8(%rdx,%rsi,8), %rax
	subl	%r15d, %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shlq	%cl, %rax
	orq	%rax, %rbx
LBB0_4:
	decl	%r14d
	movl	%r14d, %edi
	xorl	%esi, %esi
	callq	_GENMASK
	andl	%eax, %ebx
	jmp	LBB0_5
LBB0_1:
	movq	_ERANGE@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_BBT_BLOCK_NUM_STATUS,4,2  ## @NAND_BBT_BLOCK_NUM_STATUS
	.comm	_BITS_PER_LONG,4,2              ## @BITS_PER_LONG
	.comm	_ERANGE,4,2                     ## @ERANGE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nanddev_bbt_get_block_status   ; -- Begin function nanddev_bbt_get_block_status
	.p2align	2
_nanddev_bbt_get_block_status:          ; @nanddev_bbt_get_block_status
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _NAND_BBT_BLOCK_NUM_STATUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_BBT_BLOCK_NUM_STATUS@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_fls
	mov	x19, x0
	ldr	x23, [x21]
Lloh3:
	adrp	x22, _BITS_PER_LONG@GOTPAGE
Lloh4:
	ldr	x22, [x22, _BITS_PER_LONG@GOTPAGEOFF]
	ldr	w24, [x22]
	mov	x0, x21
	bl	_nanddev_neraseblocks
	cmp	w0, w20
	b.ls	LBB0_4
; %bb.1:
	mul	w9, w19, w20
	udiv	w10, w9, w24
	add	x8, x23, w10, uxtw #3
	msub	w9, w10, w24, w9
	ldr	x10, [x8]
	lsr	x20, x10, x9
	ldr	w10, [x22]
	add	w11, w9, w19
	cmp	w11, w10
	b.ls	LBB0_3
; %bb.2:
	ldr	x8, [x8, #8]
	sub	w9, w10, w9
	lsl	x8, x8, x9
	orr	x20, x8, x20
LBB0_3:
	sub	w0, w19, #1
	mov	w1, #0
	bl	_GENMASK
	and	w0, w0, w20
	b	LBB0_5
LBB0_4:
Lloh5:
	adrp	x8, _ERANGE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_BBT_BLOCK_NUM_STATUS,4,2  ; @NAND_BBT_BLOCK_NUM_STATUS
	.comm	_BITS_PER_LONG,4,2              ; @BITS_PER_LONG
	.comm	_ERANGE,4,2                     ; @ERANGE
.subsections_via_symbols
