	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msgdma_alloc_chan_resources
_msgdma_alloc_chan_resources:           ## @msgdma_alloc_chan_resources
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	callq	_to_mdev
	movq	%rax, %rbx
	movq	_MSGDMA_DESC_NUM@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	_GFP_NOWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$8, %esi
	callq	_kcalloc
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	$1, (%rcx)
	movl	(%r14), %eax
	movl	%eax, 4(%rcx)
	leaq	8(%rcx), %r13
	movq	%r13, %rdi
	callq	_INIT_LIST_HEAD
	movl	(%r14), %eax
	testl	%eax, %eax
	jle	LBB0_5
## %bb.3:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	$12, %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	$4, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%r14, %r15
	movq	16(%rax), %r14
	leaq	(%r14,%rbx), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_dma_async_tx_descriptor_init
	movq	_msgdma_tx_submit@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14,%rbx)
	leaq	(%r14,%rbx), %rdi
	addq	$-4, %rdi
	movq	%r15, %r14
	movq	%r13, %rsi
	callq	_list_add_tail
	incq	%r12
	movslq	(%r15), %rax
	addq	$8, %rbx
	cmpq	%rax, %r12
	jl	LBB0_4
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_5:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MSGDMA_DESC_NUM,4,2            ## @MSGDMA_DESC_NUM
	.comm	_GFP_NOWAIT,4,2                 ## @GFP_NOWAIT
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_msgdma_tx_submit,4,2           ## @msgdma_tx_submit
	.no_dead_strip	_msgdma_alloc_chan_resources
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msgdma_alloc_chan_resources
_msgdma_alloc_chan_resources:           ; @msgdma_alloc_chan_resources
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	bl	_to_mdev
	mov	x19, x0
Lloh0:
	adrp	x23, _MSGDMA_DESC_NUM@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MSGDMA_DESC_NUM@GOTPAGEOFF]
	ldr	w0, [x23]
Lloh2:
	adrp	x8, _GFP_NOWAIT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_NOWAIT@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	w1, #8
	bl	_kcalloc
	str	x0, [x19, #16]
	cbz	x0, LBB0_4
; %bb.1:
	mov	w8, #1
	str	w8, [x19]
	ldr	w8, [x23]
	str	w8, [x19, #4]
	add	x20, x19, #8
	mov	x0, x20
	bl	_INIT_LIST_HEAD
	ldr	w0, [x23]
	cmp	w0, #1
	b.lt	LBB0_5
; %bb.2:
	mov	x24, #0
	add	x21, x19, #12
	mov	w25, #4
Lloh5:
	adrp	x26, _msgdma_tx_submit@GOTPAGE
Lloh6:
	ldr	x26, [x26, _msgdma_tx_submit@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	add	x22, x8, x25
	mov	x0, x22
	mov	x1, x21
	bl	_dma_async_tx_descriptor_init
	ldr	w8, [x26]
	str	w8, [x22], #-4
	mov	x0, x22
	mov	x1, x20
	bl	_list_add_tail
	add	x24, x24, #1
	ldrsw	x0, [x23]
	add	x25, x25, #8
	cmp	x24, x0
	b.lt	LBB0_3
	b	LBB0_5
LBB0_4:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
                                        ; kill: def $w0 killed $w0 killed $x0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_MSGDMA_DESC_NUM,4,2            ; @MSGDMA_DESC_NUM
	.comm	_GFP_NOWAIT,4,2                 ; @GFP_NOWAIT
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_msgdma_tx_submit,4,2           ; @msgdma_tx_submit
	.no_dead_strip	_msgdma_alloc_chan_resources
.subsections_via_symbols
