	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mpc_dma_alloc_chan_resources
_mpc_dma_alloc_chan_resources:          ## @mpc_dma_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
	movq	%rdi, %r12
	callq	_dma_chan_to_mpc_dma
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_dma_chan_to_mpc_dma_chan
	movq	%rax, %r14
	movq	_descs@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_LIST_HEAD
	movl	8(%rbx), %edi
	movq	_MPC_DMA_DESCRIPTORS@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	shll	$2, %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-56(%rbp), %rdx
	callq	_dma_alloc_coherent
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%rax, %r13
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%r15)
	jle	LBB0_7
## %bb.2:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$32, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, %r14
	movq	%rax, %rdi
	addq	$24, %rdi
	movq	%r12, %rsi
	callq	_dma_async_tx_descriptor_init
	movq	_DMA_CTRL_ACK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%r14)
	movq	_mpc_dma_tx_submit@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r14)
	leaq	(%r15,%r13), %rax
	movq	%rax, 16(%r14)
	movq	-56(%rbp), %rax
	addq	%r15, %rax
	movq	%rax, 8(%r14)
	movq	%r14, %rdi
	movq	_descs@GOTPCREL(%rip), %rsi
	callq	_list_add_tail
	incq	%rbx
	movq	_MPC_DMA_DESCRIPTORS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$4, %r15
	cmpq	%rax, %rbx
	jl	LBB0_3
	jmp	LBB0_5
LBB0_6:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_notice
	testl	%ebx, %ebx
	je	LBB0_7
LBB0_5:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	%r13, 16(%rbx)
	movq	-56(%rbp), %rax
	movq	%rax, 8(%rbx)
	movq	%rbx, %rsi
	addq	$4, %rsi
	movq	_descs@GOTPCREL(%rip), %rdi
	callq	_list_splice_tail_init
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	movl	(%r12), %esi
	callq	_out_8
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_7:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %edi
	movq	_MPC_DMA_DESCRIPTORS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	shll	$2, %esi
	movq	-56(%rbp), %rcx
	movq	%r13, %rdx
	callq	_dma_free_coherent
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_descs,4,2                      ## @descs
	.comm	_MPC_DMA_DESCRIPTORS,4,2        ## @MPC_DMA_DESCRIPTORS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Memory allocation error. Allocated only %u descriptors\n"

	.comm	_DMA_CTRL_ACK,4,2               ## @DMA_CTRL_ACK
	.comm	_mpc_dma_tx_submit,4,2          ## @mpc_dma_tx_submit
	.no_dead_strip	_mpc_dma_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 mpc_dma_alloc_chan_resources
_mpc_dma_alloc_chan_resources:          ; @mpc_dma_alloc_chan_resources
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	bl	_dma_chan_to_mpc_dma
	mov	x20, x0
	mov	x0, x19
	bl	_dma_chan_to_mpc_dma_chan
	mov	x21, x0
Lloh0:
	adrp	x8, _descs@GOTPAGE
Lloh1:
	ldr	x8, [x8, _descs@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_LIST_HEAD
Lloh3:
	adrp	x26, _MPC_DMA_DESCRIPTORS@GOTPAGE
Lloh4:
	ldr	x26, [x26, _MPC_DMA_DESCRIPTORS@GOTPAGEOFF]
	ldr	w0, [x20, #8]
	ldr	w8, [x26]
	lsl	w1, w8, #2
Lloh5:
	adrp	x27, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x27, [x27, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w3, [x27]
	add	x2, sp, #24
	bl	_dma_alloc_coherent
	cbz	x0, LBB0_8
; %bb.1:
	mov	x22, x0
	stp	x21, x20, [sp, #8]              ; 16-byte Folded Spill
	ldr	w8, [x26]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.2:
	mov	x28, #0
	mov	x23, #0
Lloh7:
	adrp	x21, _DMA_CTRL_ACK@GOTPAGE
Lloh8:
	ldr	x21, [x21, _DMA_CTRL_ACK@GOTPAGEOFF]
Lloh9:
	adrp	x20, _mpc_dma_tx_submit@GOTPAGE
Lloh10:
	ldr	x20, [x20, _mpc_dma_tx_submit@GOTPAGEOFF]
Lloh11:
	adrp	x24, _descs@GOTPAGE
Lloh12:
	ldr	x24, [x24, _descs@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x27]
	mov	w0, #32
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x25, x0
	add	x0, x0, #24
	mov	x1, x19
	bl	_dma_async_tx_descriptor_init
	ldr	w8, [x21]
	ldr	w9, [x20]
	stp	w9, w8, [x25, #24]
	add	x8, x22, x28
	ldr	x9, [sp, #24]
	add	x9, x9, x28
	stp	x9, x8, [x25, #8]
	mov	x0, x25
	mov	x1, x24
	bl	_list_add_tail
	add	x23, x23, #1
	ldrsw	x8, [x26]
	add	x28, x28, #4
	cmp	x23, x8
	b.lt	LBB0_3
	b	LBB0_6
LBB0_5:
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	ldr	w0, [x8, #8]
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x23
	bl	_dev_notice
	cbz	w23, LBB0_7
LBB0_6:
	ldr	x20, [sp, #8]                   ; 8-byte Folded Reload
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	x8, [sp, #24]
	stp	x8, x22, [x20, #8]
	add	x1, x20, #4
Lloh15:
	adrp	x0, _descs@GOTPAGE
Lloh16:
	ldr	x0, [x0, _descs@GOTPAGEOFF]
	bl	_list_splice_tail_init
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	ldr	x0, [x8]
	ldr	w1, [x19]
	bl	_out_8
	mov	w0, #0
	b	LBB0_9
LBB0_7:
	ldp	x8, x3, [sp, #16]               ; 8-byte Folded Reload
	ldr	w0, [x8, #8]
	ldr	w8, [x26]
	lsl	w1, w8, #2
	mov	x2, x22
	bl	_dma_free_coherent
LBB0_8:
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_descs,4,2                      ; @descs
	.comm	_MPC_DMA_DESCRIPTORS,4,2        ; @MPC_DMA_DESCRIPTORS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Memory allocation error. Allocated only %u descriptors\n"

	.comm	_DMA_CTRL_ACK,4,2               ; @DMA_CTRL_ACK
	.comm	_mpc_dma_tx_submit,4,2          ; @mpc_dma_tx_submit
	.no_dead_strip	_mpc_dma_alloc_chan_resources
.subsections_via_symbols
