	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtdswap_write_marker
_mtdswap_write_marker:                  ## @mtdswap_write_marker
	.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
	movq	%rdi, %r15
	movq	$0, -56(%rbp)
	leaq	-48(%rbp), %rax
	movq	%rax, -64(%rbp)
	movq	_MTD_OPS_AUTO_OOB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -72(%rbp)
	movq	$0, -80(%rbp)
	movq	_MTDSWAP_TYPE_CLEAN@GOTPCREL(%rip), %rax
	cmpq	%rdx, (%rax)
	jne	LBB0_2
## %bb.1:
	movq	_MTDSWAP_MAGIC_CLEAN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le16
	movq	%rax, -48(%rbp)
	movl	(%r14), %edi
	callq	_cpu_to_le32
	movl	%eax, -40(%rbp)
	movq	_MTDSWAP_OOBSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -88(%rbp)
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_mtdswap_eb_offset
	movq	%rax, %r12
	movq	8(%r15), %rdi
	jmp	LBB0_3
LBB0_2:
	movq	_MTDSWAP_MAGIC_DIRTY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le16
	movq	%rax, -48(%rbp)
	movl	$8, -88(%rbp)
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_mtdswap_eb_offset
	movq	%rax, %r12
	movq	8(%r15), %rdi
	addq	(%rdi), %r12
LBB0_3:
	leaq	-88(%rbp), %rdx
	movq	%r12, %rsi
	callq	_mtd_write_oob
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_7
## %bb.4:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_dev_warn
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	je	LBB0_6
## %bb.5:
	movl	%ebx, %edi
	callq	_mtd_is_eccerr
	testq	%rax, %rax
	je	LBB0_9
LBB0_6:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_mtdswap_handle_write_error
	jmp	LBB0_9
LBB0_7:
	movl	-88(%rbp), %r8d
	movl	-84(%rbp), %ecx
	cmpl	%r8d, %ecx
	je	LBB0_9
## %bb.8:
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_dev_warn
LBB0_9:
	movl	%ebx, %eax
	addq	$64, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTD_OPS_AUTO_OOB,4,2           ## @MTD_OPS_AUTO_OOB
	.comm	_MTDSWAP_TYPE_CLEAN,8,3         ## @MTDSWAP_TYPE_CLEAN
	.comm	_MTDSWAP_MAGIC_CLEAN,4,2        ## @MTDSWAP_MAGIC_CLEAN
	.comm	_MTDSWAP_OOBSIZE,4,2            ## @MTDSWAP_OOBSIZE
	.comm	_MTDSWAP_MAGIC_DIRTY,4,2        ## @MTDSWAP_MAGIC_DIRTY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Write OOB failed for block at %08llx error %d\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"Short OOB write for block at %08llx: %zd not %zd\n"

	.no_dead_strip	_mtdswap_write_marker
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtdswap_write_marker
_mtdswap_write_marker:                  ; @mtdswap_write_marker
	.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	x20, x1
	mov	x19, x0
	add	x8, sp, #48
	stp	x8, xzr, [sp, #32]
Lloh0:
	adrp	x8, _MTD_OPS_AUTO_OOB@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTD_OPS_AUTO_OOB@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #24]
	str	xzr, [sp, #16]
Lloh3:
	adrp	x8, _MTDSWAP_TYPE_CLEAN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MTDSWAP_TYPE_CLEAN@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x8, x2
	b.ne	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _MTDSWAP_MAGIC_CLEAN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MTDSWAP_MAGIC_CLEAN@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_cpu_to_le16
	str	x0, [sp, #48]
	ldr	w0, [x20]
	bl	_cpu_to_le32
	str	w0, [sp, #56]
Lloh9:
	adrp	x8, _MTDSWAP_OOBSIZE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MTDSWAP_OOBSIZE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [sp, #8]
	mov	x0, x19
	mov	x1, x20
	bl	_mtdswap_eb_offset
	mov	x22, x0
	ldr	x0, [x19, #8]
	b	LBB0_3
LBB0_2:
Lloh12:
	adrp	x8, _MTDSWAP_MAGIC_DIRTY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MTDSWAP_MAGIC_DIRTY@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_cpu_to_le16
	str	x0, [sp, #48]
	mov	w8, #8
	str	w8, [sp, #8]
	mov	x0, x19
	mov	x1, x20
	bl	_mtdswap_eb_offset
	mov	x8, x0
	ldr	x0, [x19, #8]
	ldr	x9, [x0]
	add	x22, x9, x8
LBB0_3:
	add	x2, sp, #8
	mov	x1, x22
	bl	_mtd_write_oob
	mov	x21, x0
	cbz	w0, LBB0_7
; %bb.4:
	ldr	w0, [x19]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	mov	x3, x21
	bl	_dev_warn
Lloh17:
	adrp	x8, _EIO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	cmn	w21, w8
	b.eq	LBB0_6
; %bb.5:
	mov	x0, x21
	bl	_mtd_is_eccerr
	cbz	x0, LBB0_9
LBB0_6:
	mov	x0, x19
	mov	x1, x20
	bl	_mtdswap_handle_write_error
	b	LBB0_9
LBB0_7:
	ldp	w8, w3, [sp, #8]
	cmp	w3, w8
	b.eq	LBB0_9
; %bb.8:
	ldr	w0, [x19]
	str	x8, [sp]
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_dev_warn
LBB0_9:
	mov	x0, x21
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_MTD_OPS_AUTO_OOB,4,2           ; @MTD_OPS_AUTO_OOB
	.comm	_MTDSWAP_TYPE_CLEAN,8,3         ; @MTDSWAP_TYPE_CLEAN
	.comm	_MTDSWAP_MAGIC_CLEAN,4,2        ; @MTDSWAP_MAGIC_CLEAN
	.comm	_MTDSWAP_OOBSIZE,4,2            ; @MTDSWAP_OOBSIZE
	.comm	_MTDSWAP_MAGIC_DIRTY,4,2        ; @MTDSWAP_MAGIC_DIRTY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Write OOB failed for block at %08llx error %d\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"Short OOB write for block at %08llx: %zd not %zd\n"

	.no_dead_strip	_mtdswap_write_marker
.subsections_via_symbols
