	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function zynqmp_dma_alloc_chan_resources
_zynqmp_dma_alloc_chan_resources:       ## @zynqmp_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
	callq	_to_chan
	movq	%rax, %r13
	movl	40(%rax), %edi
	callq	_pm_runtime_get_sync
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	js	LBB0_3
## %bb.1:
	movq	_ZYNQMP_DMA_NUM_DESCS@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movl	$40, %esi
	callq	_kcalloc
	movq	%rax, 32(%r13)
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movl	$1, (%r13)
	movl	(%r12), %eax
	movl	%eax, 4(%r13)
	leaq	44(%r13), %r15
	movq	%r15, %rdi
	callq	_INIT_LIST_HEAD
	movl	(%r12), %esi
	testl	%esi, %esi
	jle	LBB0_8
## %bb.5:
	leaq	48(%r13), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	$36, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%r13), %r14
	leaq	(%r14,%rbx), %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_dma_async_tx_descriptor_init
	movq	_zynqmp_dma_tx_submit@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14,%rbx)
	leaq	(%r14,%rbx), %rdi
	addq	$-4, %rdi
	movq	%r15, %rsi
	callq	_list_add_tail
	incq	%r12
	movq	_ZYNQMP_DMA_NUM_DESCS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rsi
	addq	$40, %rbx
	cmpq	%rsi, %r12
	jl	LBB0_6
## %bb.7:
	movq	_ZYNQMP_DMA_NUM_DESCS@GOTPCREL(%rip), %r12
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
LBB0_8:
	imull	8(%r13), %esi
	movl	40(%r13), %edi
	addl	%esi, %esi
	movq	%r13, %rdx
	addq	$16, %rdx
	movl	(%rbx), %ecx
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_dma_alloc_coherent
	movq	%rax, 24(%r13)
	testq	%rax, %rax
	je	LBB0_2
## %bb.9:
	movq	%rax, %r15
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_3
## %bb.10:
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	movl	$12, %r14d
	movl	$1, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%r13), %r12
	movq	%r13, %rdi
	callq	_ZYNQMP_DMA_DESC_SIZE
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	imull	%ebx, %eax
	cltq
	leaq	(%r15,%rax), %rcx
	movq	%rcx, -8(%r12,%r14,2)
	addq	%r15, %rax
	addq	$4, %rax
	movq	%rax, (%r12,%r14,2)
	movq	16(%r13), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	callq	_ZYNQMP_DMA_DESC_SIZE
	imull	%ebx, %eax
	movq	%r13, %r15
	movslq	%eax, %r13
	addq	-64(%rbp), %r13                 ## 8-byte Folded Reload
	movq	%r13, -24(%r12,%r14,2)
	movq	%r15, %rdi
	callq	_ZYNQMP_DMA_DESC_SIZE
	cltq
	addq	%r13, %rax
	movq	%rax, -16(%r12,%r14,2)
	movq	_ZYNQMP_DMA_NUM_DESCS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%rax, %rcx
	jge	LBB0_3
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	24(%r15), %rax
	addl	$2, -48(%rbp)                   ## 4-byte Folded Spill
	addq	$20, %r14
	incq	%rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, %r13
	movq	%rax, %r15
	jmp	LBB0_11
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
                                        ## 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	_ZYNQMP_DMA_NUM_DESCS,4,2       ## @ZYNQMP_DMA_NUM_DESCS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_zynqmp_dma_tx_submit,4,2       ## @zynqmp_dma_tx_submit
	.no_dead_strip	_zynqmp_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 zynqmp_dma_alloc_chan_resources
_zynqmp_dma_alloc_chan_resources:       ; @zynqmp_dma_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
	bl	_to_chan
	mov	x19, x0
	ldr	w0, [x0, #40]
	bl	_pm_runtime_get_sync
                                        ; kill: def $w0 killed $w0 def $x0
	tbnz	w0, #31, LBB0_11
; %bb.1:
Lloh0:
	adrp	x23, _ZYNQMP_DMA_NUM_DESCS@GOTPAGE
Lloh1:
	ldr	x23, [x23, _ZYNQMP_DMA_NUM_DESCS@GOTPAGEOFF]
	ldr	w0, [x23]
Lloh2:
	adrp	x24, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x24, [x24, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x24]
	mov	w1, #40
	bl	_kcalloc
	str	x0, [x19, #32]
	cbz	x0, LBB0_10
; %bb.2:
	mov	w8, #1
	str	w8, [x19]
	ldr	w8, [x23]
	str	w8, [x19, #4]
	add	x20, x19, #44
	mov	x0, x20
	bl	_INIT_LIST_HEAD
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.3:
	mov	x25, #0
	add	x21, x19, #48
	mov	w26, #36
Lloh4:
	adrp	x27, _zynqmp_dma_tx_submit@GOTPAGE
Lloh5:
	ldr	x27, [x27, _zynqmp_dma_tx_submit@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #32]
	add	x22, x8, x26
	mov	x0, x22
	mov	x1, x21
	bl	_dma_async_tx_descriptor_init
	ldr	w8, [x27]
	str	w8, [x22], #-4
	mov	x0, x22
	mov	x1, x20
	bl	_list_add_tail
	add	x25, x25, #1
	ldrsw	x8, [x23]
	add	x26, x26, #40
	cmp	x25, x8
	b.lt	LBB0_4
LBB0_5:
	ldr	w0, [x19, #40]
	ldr	w9, [x19, #8]
	mul	w8, w8, w9
	lsl	w1, w8, #1
	add	x2, x19, #16
	ldr	w3, [x24]
	bl	_dma_alloc_coherent
	str	x0, [x19, #24]
	cbz	x0, LBB0_10
; %bb.6:
	mov	x20, x0
	ldr	w0, [x23]
	cmp	w0, #1
	b.lt	LBB0_11
; %bb.7:
	mov	x21, #0
	mov	w22, #0
	mov	w24, #1
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x25, [x19, #32]
	mov	x0, x19
	bl	_ZYNQMP_DMA_DESC_SIZE
	mul	w8, w22, w0
	add	x8, x20, w8, sxtw
	add	x20, x25, x21
	add	x9, x8, #4
	stp	x8, x9, [x20, #16]
	ldr	x25, [x19, #16]
	mov	x0, x19
	bl	_ZYNQMP_DMA_DESC_SIZE
	mul	w8, w22, w0
	add	x25, x25, w8, sxtw
	str	x25, [x20]
	mov	x0, x19
	bl	_ZYNQMP_DMA_DESC_SIZE
	add	x8, x25, w0, sxtw
	str	x8, [x20, #8]
	ldrsw	x0, [x23]
	cmp	x24, x0
	b.ge	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x20, [x19, #24]
	add	w22, w22, #2
	add	x21, x21, #40
	add	x24, x24, #1
	b	LBB0_8
LBB0_10:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
                                        ; kill: def $w0 killed $w0 killed $x0
	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	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ZYNQMP_DMA_NUM_DESCS,4,2       ; @ZYNQMP_DMA_NUM_DESCS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_zynqmp_dma_tx_submit,4,2       ; @zynqmp_dma_tx_submit
	.no_dead_strip	_zynqmp_dma_alloc_chan_resources
.subsections_via_symbols
