	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nand_default_block_markbad
_nand_default_block_markbad:            ## @nand_default_block_markbad
	.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
	movq	%rsi, %r14
	movq	%rdi, %r12
	callq	_nand_to_mtd
	movq	%rax, %r15
	movq	$0, -72(%rbp)
	leaq	-64(%rbp), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	leaq	-72(%rbp), %rax
	movq	%rax, -48(%rbp)
	movl	(%r12), %eax
	movl	%eax, -64(%rbp)
	movq	_NAND_BUSWIDTH_16@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 4(%r12)
	je	LBB0_1
## %bb.2:
	andl	$-2, %eax
	movl	%eax, -64(%rbp)
	movl	$2, %eax
	jmp	LBB0_3
LBB0_1:
	movl	$1, %eax
LBB0_3:
	movl	%eax, -56(%rbp)
	movl	%eax, -60(%rbp)
	movq	_MTD_OPS_PLACE_OOB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_nand_bbm_get_next_page
	testl	%eax, %eax
	js	LBB0_6
## %bb.4:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%r15), %rsi
	movslq	%eax, %r13
	imulq	%r13, %rsi
	addq	%r14, %rsi
	movq	%r12, %rdi
	leaq	-64(%rbp), %rdx
	callq	_nand_do_write_oob
	testl	%ebx, %ebx
	cmovel	%eax, %ebx
	incl	%r13d
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_nand_bbm_get_next_page
	testl	%eax, %eax
	jns	LBB0_5
LBB0_6:
	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_BUSWIDTH_16,4,2           ## @NAND_BUSWIDTH_16
	.comm	_MTD_OPS_PLACE_OOB,4,2          ## @MTD_OPS_PLACE_OOB
	.no_dead_strip	_nand_default_block_markbad
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nand_default_block_markbad
_nand_default_block_markbad:            ; @nand_default_block_markbad
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x1
	mov	x20, x0
	bl	_nand_to_mtd
	mov	x21, x0
	str	xzr, [sp]
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	mov	x8, sp
	str	x8, [sp, #24]
	ldp	w8, w9, [x20]
	str	w8, [sp, #8]
Lloh0:
	adrp	x10, _NAND_BUSWIDTH_16@GOTPAGE
Lloh1:
	ldr	x10, [x10, _NAND_BUSWIDTH_16@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_2
; %bb.1:
	and	w8, w8, #0xfffffffe
	str	w8, [sp, #8]
	mov	w8, #2
	b	LBB0_3
LBB0_2:
	mov	w8, #1
LBB0_3:
	stp	w8, w8, [sp, #12]
Lloh3:
	adrp	x8, _MTD_OPS_PLACE_OOB@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MTD_OPS_PLACE_OOB@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [sp, #20]
	mov	x0, x20
	mov	w1, #0
	bl	_nand_bbm_get_next_page
	tbnz	w0, #31, LBB0_6
; %bb.4:
	mov	x23, x0
	mov	w22, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldrsw	x8, [x21]
	sxtw	x9, w23
	madd	x1, x8, x9, x19
	add	x2, sp, #8
	mov	x0, x20
	bl	_nand_do_write_oob
	cmp	w22, #0
	csel	w22, w0, w22, eq
	add	w1, w23, #1
	mov	x0, x20
	bl	_nand_bbm_get_next_page
	mov	x23, x0
	tbz	w0, #31, LBB0_5
	b	LBB0_7
LBB0_6:
	mov	w22, #0
LBB0_7:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_BUSWIDTH_16,4,2           ; @NAND_BUSWIDTH_16
	.comm	_MTD_OPS_PLACE_OOB,4,2          ; @MTD_OPS_PLACE_OOB
	.no_dead_strip	_nand_default_block_markbad
.subsections_via_symbols
