	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sm_write_sector
_sm_write_sector:                       ## @sm_write_sector
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -48(%rbp)                  ## 8-byte Spill
	movq	%r8, %rbx
	movl	%ecx, %r13d
	movl	%edx, %r12d
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	32(%rdi), %rax
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	24(%rdi), %edi
	callq	_BUG_ON
	testl	%r15d, %r15d
	jne	LBB0_4
## %bb.1:
	testl	%r12d, %r12d
	je	LBB0_3
## %bb.2:
	cmpl	%r12d, (%r14)
	je	LBB0_3
LBB0_4:
	cmpq	$0, 16(%r14)
	je	LBB0_6
## %bb.5:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_6:
	cmpq	$0, 8(%r14)
	jne	LBB0_7
## %bb.8:
	movq	_MTD_OPS_PLACE_OOB@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_3:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dbg
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_7:
	movq	_MTD_OPS_RAW@GOTPCREL(%rip), %rax
LBB0_9:
	movl	%r13d, %ecx
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	movq	_SM_SECTOR_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)
	movq	%rbx, -80(%rbp)
	movq	$0, -88(%rbp)
	movq	_SM_OOB_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -96(%rbp)
	movq	%rdx, -104(%rbp)
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%r12d, %edx
	movq	%rbx, %r13
	callq	_sm_mkoffset
	leaq	-120(%rbp), %rdx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_mtd_write_oob
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	movl	%r12d, %esi
	movl	%r15d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dbg
	movq	%r14, %rdi
	callq	_sm_recheck_media
	jmp	LBB0_12
LBB0_11:
	movq	-120(%rbp), %rax
	xorl	%edi, %edi
	movq	_SM_OOB_SIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	setne	%dil
	callq	_WARN_ON
	testq	%r13, %r13
	setne	%al
	movq	-112(%rbp), %rcx
	movq	_SM_SECTOR_SIZE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	setne	%cl
	andb	%al, %cl
	movzbl	%cl, %edi
	callq	_WARN_ON
	xorl	%ebx, %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"attempted to write the CIS!"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_MTD_OPS_RAW,4,2                ## @MTD_OPS_RAW
	.comm	_MTD_OPS_PLACE_OOB,4,2          ## @MTD_OPS_PLACE_OOB
	.comm	_SM_SECTOR_SIZE,8,3             ## @SM_SECTOR_SIZE
	.comm	_SM_OOB_SIZE,8,3                ## @SM_OOB_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"write to block %d at zone %d, failed with error %d"

	.no_dead_strip	_sm_write_sector
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sm_write_sector
_sm_write_sector:                       ; @sm_write_sector
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x28, x27, [sp, #96]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #112]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #128]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x25, x5
	mov	x20, x4
	mov	x24, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	ldr	x8, [x0, #32]
	ldr	x23, [x8]
	ldr	w0, [x0, #24]
	bl	_BUG_ON
	cbnz	w22, LBB0_3
; %bb.1:
	cbz	w21, LBB0_6
; %bb.2:
	ldr	w8, [x19]
	cmp	w8, w21
	b.eq	LBB0_6
LBB0_3:
	ldr	x8, [x19, #16]
	cbnz	x8, LBB0_7
; %bb.4:
Lloh0:
	adrp	x8, _MTD_OPS_RAW@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTD_OPS_RAW@GOTPAGEOFF]
	ldr	x9, [x19, #8]
Lloh2:
	adrp	x10, _MTD_OPS_PLACE_OOB@GOTPAGE
Lloh3:
	ldr	x10, [x10, _MTD_OPS_PLACE_OOB@GOTPAGEOFF]
	cmp	x9, #0
	csel	x8, x10, x8, eq
	ldr	w8, [x8]
	str	w8, [sp, #88]
Lloh4:
	adrp	x26, _SM_SECTOR_SIZE@GOTPAGE
Lloh5:
	ldr	x26, [x26, _SM_SECTOR_SIZE@GOTPAGEOFF]
	ldr	x8, [x26]
	stp	x20, x8, [sp, #72]
	str	xzr, [sp, #64]
Lloh6:
	adrp	x27, _SM_OOB_SIZE@GOTPAGE
Lloh7:
	ldr	x27, [x27, _SM_OOB_SIZE@GOTPAGEOFF]
	ldr	x8, [x27]
	stp	x25, x8, [sp, #48]
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	mov	x3, x24
	bl	_sm_mkoffset
	mov	x1, x0
	add	x2, sp, #32
	mov	x0, x23
	bl	_mtd_write_oob
	mov	x23, x0
	cbz	w0, LBB0_9
; %bb.5:
	stp	x22, x23, [sp, #8]
	str	x21, [sp]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_dbg
	mov	x0, x19
	bl	_sm_recheck_media
	b	LBB0_8
LBB0_6:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dbg
LBB0_7:
Lloh12:
	adrp	x8, _EIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_8:
	mov	x0, x23
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #128]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #112]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
LBB0_9:
	ldr	x8, [sp, #32]
	ldr	x9, [x27]
	cmp	x8, x9
	cset	w0, ne
	bl	_WARN_ON
	cmp	x20, #0
	ldr	x8, [sp, #40]
	ldr	x9, [x26]
	ccmp	x8, x9, #4, ne
	cset	w0, ne
	bl	_WARN_ON
	b	LBB0_8
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"attempted to write the CIS!"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_MTD_OPS_RAW,4,2                ; @MTD_OPS_RAW
	.comm	_MTD_OPS_PLACE_OOB,4,2          ; @MTD_OPS_PLACE_OOB
	.comm	_SM_SECTOR_SIZE,8,3             ; @SM_SECTOR_SIZE
	.comm	_SM_OOB_SIZE,8,3                ; @SM_OOB_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"write to block %d at zone %d, failed with error %d"

	.no_dead_strip	_sm_write_sector
.subsections_via_symbols
