	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function imxdma_alloc_chan_resources
_imxdma_alloc_chan_resources:           ## @imxdma_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
	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
	callq	_to_imxdma_chan
	movq	%rax, %r12
	movq	(%r14), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	(%rax), %eax
	movl	%eax, 12(%r12)
LBB0_2:
	movq	(%r12), %rax
	movq	_IMXDMA_MAX_CHAN_DESCRIPTORS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_7
## %bb.3:
	movq	%r12, %r15
	addq	$8, %r15
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %rbx
	movq	%rax, %r13
	addq	$8, %r13
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_dma_async_tx_descriptor_init
	movq	_imxdma_tx_submit@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	movq	_DMA_CTRL_ACK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	_DMA_COMPLETE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_list_add_tail
	movq	(%r12), %rax
	incq	%rax
	movq	%rax, (%r12)
	movq	_IMXDMA_MAX_CHAN_DESCRIPTORS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_4
	jmp	LBB0_7
LBB0_5:
	movq	(%r12), %rax
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	subl	(%rcx), %edx
	testq	%rax, %rax
	cmovel	%edx, %eax
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IMXDMA_MAX_CHAN_DESCRIPTORS,8,3 ## @IMXDMA_MAX_CHAN_DESCRIPTORS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_imxdma_tx_submit,4,2           ## @imxdma_tx_submit
	.comm	_DMA_CTRL_ACK,4,2               ## @DMA_CTRL_ACK
	.comm	_DMA_COMPLETE,4,2               ## @DMA_COMPLETE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_imxdma_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 imxdma_alloc_chan_resources
_imxdma_alloc_chan_resources:           ; @imxdma_alloc_chan_resources
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	_to_imxdma_chan
	mov	x20, x0
	ldr	x8, [x19]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w8, [x8]
	str	w8, [x20, #12]
LBB0_2:
	ldr	x8, [x20]
Lloh0:
	adrp	x24, _IMXDMA_MAX_CHAN_DESCRIPTORS@GOTPAGE
Lloh1:
	ldr	x24, [x24, _IMXDMA_MAX_CHAN_DESCRIPTORS@GOTPAGEOFF]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ge	LBB0_7
; %bb.3:
	add	x21, x20, #8
Lloh2:
	adrp	x25, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x25, [x25, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	adrp	x26, _imxdma_tx_submit@GOTPAGE
Lloh5:
	ldr	x26, [x26, _imxdma_tx_submit@GOTPAGEOFF]
Lloh6:
	adrp	x27, _DMA_CTRL_ACK@GOTPAGE
Lloh7:
	ldr	x27, [x27, _DMA_CTRL_ACK@GOTPAGEOFF]
Lloh8:
	adrp	x28, _DMA_COMPLETE@GOTPAGE
Lloh9:
	ldr	x28, [x28, _DMA_COMPLETE@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x25]
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x22, x0
	add	x23, x0, #8
	mov	x0, x23
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	mov	x0, x23
	mov	x1, x19
	bl	_dma_async_tx_descriptor_init
	ldr	w10, [x26]
	ldr	w8, [x27]
	ldr	w9, [x28]
	stp	w8, w10, [x22, #8]
	str	w9, [x22, #4]
	mov	x0, x22
	mov	x1, x21
	bl	_list_add_tail
	ldr	x8, [x20]
	add	x8, x8, #1
	str	x8, [x20]
	ldr	x9, [x24]
	cmp	x8, x9
	b.lt	LBB0_4
	b	LBB0_7
LBB0_6:
	ldr	x8, [x20]
LBB0_7:
Lloh10:
	adrp	x9, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x9, [x9, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	cmp	x8, #0
	csneg	w0, w8, w9, ne
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_IMXDMA_MAX_CHAN_DESCRIPTORS,8,3 ; @IMXDMA_MAX_CHAN_DESCRIPTORS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_imxdma_tx_submit,4,2           ; @imxdma_tx_submit
	.comm	_DMA_CTRL_ACK,4,2               ; @DMA_CTRL_ACK
	.comm	_DMA_COMPLETE,4,2               ; @DMA_COMPLETE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_imxdma_alloc_chan_resources
.subsections_via_symbols
