	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function d40_prep_desc
_d40_prep_desc:                         ## @d40_prep_desc
	.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	%rcx, %r15
	movl	%edx, %r12d
	movq	%rsi, %r13
	movq	%rdi, %r14
	callq	_d40_desc_get
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %rbx
	movl	4(%r14), %ecx
	movl	8(%r14), %edx
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_d40_sg_2_dmalen
	movq	%rax, (%rbx)
	testq	%rax, %rax
	js	LBB0_2
## %bb.3:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	callq	_d40_pool_lli_alloc
	testl	%eax, %eax
	js	LBB0_4
## %bb.8:
	movq	$0, 24(%rbx)
	movq	%rbx, %rdi
	addq	$8, %rdi
	movq	%r15, 8(%rbx)
	movq	_d40_tx_submit@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	%r14, %rsi
	callq	_dma_async_tx_descriptor_init
	jmp	LBB0_7
LBB0_2:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_5
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
LBB0_5:
	movq	%r14, %rdi
	callq	_chan_err
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_d40_desc_free
LBB0_6:
	xorl	%ebx, %ebx
LBB0_7:
	movq	%rbx, %rax
	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	"Unaligned size\n"

L_.str.1:                               ## @.str.1
	.asciz	"Could not allocate lli\n"

	.comm	_d40_tx_submit,4,2              ## @d40_tx_submit
	.no_dead_strip	_d40_prep_desc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function d40_prep_desc
_d40_prep_desc:                         ; @d40_prep_desc
	.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	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x20, x0
	bl	_d40_desc_get
	mov	x19, x0
	cbz	x0, LBB0_7
; %bb.1:
	ldp	w3, w2, [x20, #4]
	mov	x0, x23
	mov	x1, x22
	bl	_d40_sg_2_dmalen
	str	x0, [x19]
	tbnz	x0, #63, LBB0_4
; %bb.2:
	mov	x2, x0
	mov	x0, x20
	mov	x1, x19
	bl	_d40_pool_lli_alloc
	tbnz	w0, #31, LBB0_5
; %bb.3:
	mov	x0, x19
	str	x21, [x0, #8]!
	str	xzr, [x0, #16]
Lloh0:
	adrp	x8, _d40_tx_submit@GOTPAGE
Lloh1:
	ldr	x8, [x8, _d40_tx_submit@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x0, #8]
	mov	x1, x20
	bl	_dma_async_tx_descriptor_init
	b	LBB0_7
LBB0_4:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_6
LBB0_5:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_6:
	mov	x0, x20
	bl	_chan_err
	mov	x0, x20
	mov	x1, x19
	bl	_d40_desc_free
	mov	x19, #0
LBB0_7:
	mov	x0, x19
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unaligned size\n"

l_.str.1:                               ; @.str.1
	.asciz	"Could not allocate lli\n"

	.comm	_d40_tx_submit,4,2              ; @d40_tx_submit
	.no_dead_strip	_d40_prep_desc
.subsections_via_symbols
