	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function erase_xfer
_erase_xfer:                            ## @erase_xfer
	.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
	movq	%rdi, %r14
	movq	8(%rdi), %r15
	leaq	(%rsi,%rsi,2), %r12
	movl	8(%r15,%r12,4), %esi
	leaq	L_.str(%rip), %rdi
	callq	_pr_debug
	movq	_XFER_ERASING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15,%r12,4)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$8, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	leaq	(%r15,%r12,4), %r13
	addq	$8, %r13
	movl	(%r13), %eax
	movl	%eax, 4(%rbx)
	movb	4(%r14), %cl
	movl	$1, %eax
	shll	%cl, %eax
	movl	%eax, (%rbx)
	movl	(%r14), %edi
	movq	%rbx, %rsi
	callq	_mtd_erase
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movq	_XFER_FAILED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%r13)
	leaq	L_.str.1(%rip), %rdi
	movl	%r14d, %esi
	callq	_pr_notice
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_6
LBB0_3:
	movq	_XFER_ERASED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%r13)
	incl	4(%r15,%r12,4)
LBB0_5:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_6:
	movl	%r14d, %eax
	addq	$8, %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	"ftl_cs: erasing xfer unit at 0x%x\n"

	.comm	_XFER_ERASING,4,2               ## @XFER_ERASING
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_XFER_ERASED,4,2                ## @XFER_ERASED
	.comm	_XFER_FAILED,4,2                ## @XFER_FAILED
L_.str.1:                               ## @.str.1
	.asciz	"ftl_cs: erase failed: err = %d\n"

	.no_dead_strip	_erase_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function erase_xfer
_erase_xfer:                            ; @erase_xfer
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x0
	ldr	x22, [x0, #8]
	mov	w8, #12
	madd	x23, x1, x8, x22
	mov	x24, x23
	ldr	w1, [x24, #8]!
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
Lloh2:
	adrp	x8, _XFER_ERASING@GOTPAGE
Lloh3:
	ldr	x8, [x8, _XFER_ERASING@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x23]
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	w0, #8
	bl	_kmalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	ldr	w8, [x24]
	mov	w9, #1
	ldp	w0, w10, [x21]
	lsl	w9, w9, w10
	stp	w9, w8, [x20]
	mov	x1, x20
	bl	_mtd_erase
	mov	x21, x0
	cbz	w0, LBB0_4
; %bb.2:
Lloh8:
	adrp	x8, _XFER_FAILED@GOTPAGE
Lloh9:
	ldr	x8, [x8, _XFER_FAILED@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [x23]
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_pr_notice
	b	LBB0_5
LBB0_3:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_6
LBB0_4:
Lloh16:
	adrp	x8, _XFER_ERASED@GOTPAGE
Lloh17:
	ldr	x8, [x8, _XFER_ERASED@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	str	w8, [x23]
	mov	w8, #12
	madd	x8, x19, x8, x22
	ldr	w9, [x8, #4]
	add	w9, w9, #1
	str	w9, [x8, #4]
LBB0_5:
	mov	x0, x20
	bl	_kfree
LBB0_6:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ftl_cs: erasing xfer unit at 0x%x\n"

	.comm	_XFER_ERASING,4,2               ; @XFER_ERASING
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_XFER_ERASED,4,2                ; @XFER_ERASED
	.comm	_XFER_FAILED,4,2                ; @XFER_FAILED
l_.str.1:                               ; @.str.1
	.asciz	"ftl_cs: erase failed: err = %d\n"

	.no_dead_strip	_erase_xfer
.subsections_via_symbols
