	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sm_block_markbad
_sm_block_markbad:                      ## @sm_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	%r12
	pushq	%rbx
	subq	$64, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	callq	_nand_to_mtd
	movq	%rax, %rbx
	movq	_SM_OOB_SIZE@GOTPCREL(%rip), %r12
	movq	(%r12), %rdx
	leaq	-40(%rbp), %r15
	movq	%r15, %rdi
	movl	$-1, %esi
	callq	_memset
	movl	$15, -40(%rbp)
	movq	_MTD_OPS_PLACE_OOB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	$0, -56(%rbp)
	movl	(%rbx), %eax
	movl	%eax, -64(%rbp)
	movq	%r15, -72(%rbp)
	movq	$0, -80(%rbp)
	leaq	-88(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_mtd_write_oob
	testl	%eax, %eax
	js	LBB0_2
## %bb.1:
	movq	-88(%rbp), %rcx
	xorl	%eax, %eax
	cmpq	(%r12), %rcx
	je	LBB0_3
LBB0_2:
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	callq	_pr_notice
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
	addq	$64, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SM_OOB_SIZE,8,3                ## @SM_OOB_SIZE
	.comm	_MTD_OPS_PLACE_OOB,4,2          ## @MTD_OPS_PLACE_OOB
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sm_common: can't mark sector at %i as bad\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_sm_block_markbad
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sm_block_markbad
_sm_block_markbad:                      ; @sm_block_markbad
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x1
	bl	_nand_to_mtd
	mov	x20, x0
Lloh0:
	adrp	x21, _SM_OOB_SIZE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SM_OOB_SIZE@GOTPAGEOFF]
	ldr	x2, [x21]
	add	x22, sp, #8
	add	x0, sp, #8
	mov	w1, #-1
	bl	_memset
	mov	w8, #15
	str	w8, [sp, #8]
Lloh2:
	adrp	x8, _MTD_OPS_PLACE_OOB@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MTD_OPS_PLACE_OOB@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [sp, #56]
	str	xzr, [sp, #48]
	ldr	w8, [x20]
	str	w8, [sp, #40]
	stp	xzr, x22, [sp, #24]
	add	x2, sp, #16
	mov	x0, x20
	mov	x1, x19
	bl	_mtd_write_oob
	tbnz	w0, #31, LBB0_3
; %bb.1:
	ldr	x8, [sp, #16]
	ldr	x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
	mov	w0, #0
	b	LBB0_4
LBB0_3:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_pr_notice
Lloh7:
	adrp	x8, _EIO@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_SM_OOB_SIZE,8,3                ; @SM_OOB_SIZE
	.comm	_MTD_OPS_PLACE_OOB,4,2          ; @MTD_OPS_PLACE_OOB
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sm_common: can't mark sector at %i as bad\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_sm_block_markbad
.subsections_via_symbols
