	.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	16(%rdi), %r15
	leaq	(%rsi,%rsi,2), %r12
	movl	4(%r15,%r12,4), %edx
	leaq	L_.str(%rip), %rsi
	movl	$1, %r13d
	movl	$1, %edi
	callq	_DEBUG
	movq	_XFER_ERASING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15,%r12,4)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$32, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	leaq	(%r15,%r12,4), %rax
	addq	$4, %rax
	movq	(%r14), %rdi
	movq	%rdi, 24(%rbx)
	movq	_ftl_erase_callback@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 20(%rbx)
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movb	8(%r14), %cl
	shll	%cl, %r13d
	movl	%r13d, (%rbx)
	movq	%r14, 8(%rbx)
	movq	%rbx, %rsi
	callq	*(%rdi)
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_kfree
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_5
LBB0_3:
	incl	(%r15,%r12,4)
	xorl	%r14d, %r14d
LBB0_5:
	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	_ftl_erase_callback,4,2         ## @ftl_erase_callback
	.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	x20, x0
	ldr	x22, [x0, #16]
	mov	w8, #12
	madd	x23, x1, x8, x22
	ldr	w2, [x23, #4]!
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w24, #1
	mov	w0, #1
	bl	_DEBUG
Lloh2:
	adrp	x8, _XFER_ERASING@GOTPAGE
Lloh3:
	ldr	x8, [x8, _XFER_ERASING@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x23, #4]
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	w0, #32
	bl	_kmalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
	ldr	x0, [x20]
	str	x0, [x21, #24]
Lloh8:
	adrp	x8, _ftl_erase_callback@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ftl_erase_callback@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	w9, [x23]
	stp	w9, w8, [x21, #16]
	ldr	w8, [x20, #8]
	lsl	w8, w24, w8
	str	w8, [x21]
	str	x20, [x21, #8]
	ldr	x8, [x0]
	mov	x1, x21
	blr	x8
	mov	x20, x0
	cbz	w0, LBB0_4
; %bb.2:
	mov	x0, x21
	bl	_kfree
	b	LBB0_5
LBB0_3:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_5
LBB0_4:
	mov	w8, #12
	mul	x8, x19, x8
	ldr	w9, [x22, x8]
	add	w9, w9, #1
	str	w9, [x22, x8]
LBB0_5:
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.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	_ftl_erase_callback,4,2         ; @ftl_erase_callback
	.no_dead_strip	_erase_xfer
.subsections_via_symbols
