	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nanddev_isbad                  ## -- Begin function nanddev_isbad
	.p2align	4, 0x90
_nanddev_isbad:                         ## @nanddev_isbad
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r12
	callq	_nanddev_bbt_is_initialized
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_nanddev_bbt_pos_to_entry
	movl	%eax, %r15d
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_nanddev_bbt_get_block_status
	movl	%eax, %ebx
	movq	_NAND_BBT_BLOCK_STATUS_UNKNOWN@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_6
## %bb.2:
	movq	(%r12), %rax
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	*(%rax)
	testl	%eax, %eax
	jne	LBB0_3
## %bb.4:
	movq	_NAND_BBT_BLOCK_GOOD@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_7:
	movq	(%r12), %rax
	movq	(%rax), %rax
	movq	%r12, %rdi
	movq	%r14, %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
LBB0_3:
	movq	_NAND_BBT_BLOCK_FACTORY_BAD@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %ebx
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	callq	_nanddev_bbt_set_block_status
LBB0_6:
	movq	_NAND_BBT_BLOCK_WORN@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	sete	%al
	movq	_NAND_BBT_BLOCK_FACTORY_BAD@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	sete	%cl
	orb	%al, %cl
	movzbl	%cl, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_BBT_BLOCK_STATUS_UNKNOWN,4,2 ## @NAND_BBT_BLOCK_STATUS_UNKNOWN
	.comm	_NAND_BBT_BLOCK_FACTORY_BAD,4,2 ## @NAND_BBT_BLOCK_FACTORY_BAD
	.comm	_NAND_BBT_BLOCK_GOOD,4,2        ## @NAND_BBT_BLOCK_GOOD
	.comm	_NAND_BBT_BLOCK_WORN,4,2        ## @NAND_BBT_BLOCK_WORN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nanddev_isbad                  ; -- Begin function nanddev_isbad
	.p2align	2
_nanddev_isbad:                         ; @nanddev_isbad
	.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	x19, x0
	bl	_nanddev_bbt_is_initialized
	cbz	x0, LBB0_4
; %bb.1:
	mov	x0, x19
	mov	x1, x20
	bl	_nanddev_bbt_pos_to_entry
	mov	x21, x0
	mov	x0, x19
	mov	x1, x21
	bl	_nanddev_bbt_get_block_status
	mov	x22, x0
Lloh0:
	adrp	x8, _NAND_BBT_BLOCK_STATUS_UNKNOWN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_BBT_BLOCK_STATUS_UNKNOWN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x23, _NAND_BBT_BLOCK_FACTORY_BAD@GOTPAGE
Lloh4:
	ldr	x23, [x23, _NAND_BBT_BLOCK_FACTORY_BAD@GOTPAGEOFF]
	cmp	w0, w8
	b.ne	LBB0_3
; %bb.2:
	ldr	x8, [x19]
	ldr	x8, [x8]
	mov	x0, x19
	mov	x1, x20
	blr	x8
Lloh5:
	adrp	x8, _NAND_BBT_BLOCK_GOOD@GOTPAGE
Lloh6:
	ldr	x8, [x8, _NAND_BBT_BLOCK_GOOD@GOTPAGEOFF]
	cmp	w0, #0
	csel	x8, x8, x23, eq
	ldr	w22, [x8]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	bl	_nanddev_bbt_set_block_status
LBB0_3:
Lloh7:
	adrp	x8, _NAND_BBT_BLOCK_WORN@GOTPAGE
Lloh8:
	ldr	x8, [x8, _NAND_BBT_BLOCK_WORN@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cmp	w22, w8
	ldr	w8, [x23]
	ccmp	w22, w8, #4, ne
	cset	w0, eq
	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
LBB0_4:
	ldr	x8, [x19]
	ldr	x2, [x8]
	mov	x0, x19
	mov	x1, x20
	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
	br	x2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_BBT_BLOCK_STATUS_UNKNOWN,4,2 ; @NAND_BBT_BLOCK_STATUS_UNKNOWN
	.comm	_NAND_BBT_BLOCK_FACTORY_BAD,4,2 ; @NAND_BBT_BLOCK_FACTORY_BAD
	.comm	_NAND_BBT_BLOCK_GOOD,4,2        ; @NAND_BBT_BLOCK_GOOD
	.comm	_NAND_BBT_BLOCK_WORN,4,2        ; @NAND_BBT_BLOCK_WORN
.subsections_via_symbols
