	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sm_mark_block_bad
_sm_mark_block_bad:                     ## @sm_mark_block_bad
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %r12
	movq	_SM_OOB_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rdi
	movl	$255, %esi
	callq	_memset
	movl	$240, -48(%rbp)
	cmpq	$0, 8(%r12)
	jne	LBB0_5
## %bb.1:
	movq	%r12, %rdi
	callq	_sm_recheck_media
	testq	%rax, %rax
	jne	LBB0_5
## %bb.2:
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	callq	_sm_printk
	cmpl	$0, (%r12)
	jle	LBB0_5
## %bb.3:
	xorl	%ebx, %ebx
	movq	_SM_SECTOR_SIZE@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%r14d, %edx
	movl	%ebx, %ecx
	xorl	%r8d, %r8d
	leaq	-48(%rbp), %r9
	callq	_sm_write_sector
	addl	(%r13), %ebx
	cmpl	(%r12), %ebx
	jl	LBB0_4
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SM_OOB_SIZE,4,2                ## @SM_OOB_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"marking block %d of zone %d as bad"

	.comm	_SM_SECTOR_SIZE,8,3             ## @SM_SECTOR_SIZE
	.no_dead_strip	_sm_mark_block_bad
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sm_mark_block_bad
_sm_mark_block_bad:                     ; @sm_mark_block_bad
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _SM_OOB_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SM_OOB_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	add	x0, sp, #8
	mov	w1, #255
	bl	_memset
	mov	w8, #240
	str	w8, [sp, #8]
	ldr	x8, [x21, #8]
	cbnz	x8, LBB0_5
; %bb.1:
	mov	x0, x21
	bl	_sm_recheck_media
	cbnz	x0, LBB0_5
; %bb.2:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	mov	x2, x20
	bl	_sm_printk
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.3:
	mov	w22, #0
Lloh5:
	adrp	x23, _SM_SECTOR_SIZE@GOTPAGE
Lloh6:
	ldr	x23, [x23, _SM_SECTOR_SIZE@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x5, sp, #8
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	mov	x3, x22
	mov	x4, #0
	bl	_sm_write_sector
	ldr	w8, [x23]
	ldr	w9, [x21]
	add	w22, w22, w8
	cmp	w22, w9
	b.lt	LBB0_4
LBB0_5:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_SM_OOB_SIZE,4,2                ; @SM_OOB_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"marking block %d of zone %d as bad"

	.comm	_SM_SECTOR_SIZE,8,3             ; @SM_SECTOR_SIZE
	.no_dead_strip	_sm_mark_block_bad
.subsections_via_symbols
