	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fsl_qdma_alloc_chan_resources
_fsl_qdma_alloc_chan_resources:         ## @fsl_qdma_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_to_fsl_qdma_chan
	movq	(%rax), %rbx
	movq	8(%rax), %r12
	cmpq	$0, (%rbx)
	je	LBB0_3
## %bb.1:
	cmpq	$0, 8(%rbx)
	je	LBB0_3
## %bb.2:
	movl	(%r12), %r14d
	jmp	LBB0_9
LBB0_3:
	leaq	16(%rbx), %rdi
	callq	_INIT_LIST_HEAD
	movq	(%r15), %rax
	movl	(%rax), %esi
	movq	_FSL_QDMA_COMMAND_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	movl	$64, %ecx
	xorl	%r8d, %r8d
	callq	_dma_pool_create
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	movq	(%r15), %rax
	movl	(%rax), %esi
	movq	_FSL_QDMA_DESCRIPTOR_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	movl	$32, %ecx
	xorl	%r8d, %r8d
	callq	_dma_pool_create
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	movq	%rbx, %rdi
	callq	_fsl_qdma_pre_request_enqueue_desc
	testl	%eax, %eax
	je	LBB0_10
## %bb.6:
	movq	(%r15), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	movq	8(%rbx), %rdi
	callq	_dma_pool_destroy
LBB0_7:
	movq	(%rbx), %rdi
	callq	_dma_pool_destroy
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
LBB0_9:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	(%r12), %r14d
	incl	%r14d
	movl	%r14d, (%r12)
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"comp_pool"

	.comm	_FSL_QDMA_COMMAND_BUFFER_SIZE,4,2 ## @FSL_QDMA_COMMAND_BUFFER_SIZE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"desc_pool"

	.comm	_FSL_QDMA_DESCRIPTOR_BUFFER_SIZE,4,2 ## @FSL_QDMA_DESCRIPTOR_BUFFER_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"failed to alloc dma buffer for S/G descriptor\n"

	.no_dead_strip	_fsl_qdma_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 fsl_qdma_alloc_chan_resources
_fsl_qdma_alloc_chan_resources:         ; @fsl_qdma_alloc_chan_resources
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x0
	bl	_to_fsl_qdma_chan
	ldp	x19, x21, [x0]
	ldr	x8, [x19]
	cbz	x8, LBB0_3
; %bb.1:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_3
; %bb.2:
	ldr	w0, [x21]
	b	LBB0_9
LBB0_3:
	add	x0, x19, #16
	bl	_INIT_LIST_HEAD
	ldr	x8, [x20]
	ldr	w1, [x8]
Lloh0:
	adrp	x8, _FSL_QDMA_COMMAND_BUFFER_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FSL_QDMA_COMMAND_BUFFER_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	w3, #64
	mov	w4, #0
	bl	_dma_pool_create
	str	x0, [x19]
	cbz	x0, LBB0_8
; %bb.4:
	ldr	x8, [x20]
	ldr	w1, [x8]
Lloh5:
	adrp	x8, _FSL_QDMA_DESCRIPTOR_BUFFER_SIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _FSL_QDMA_DESCRIPTOR_BUFFER_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	w3, #32
	mov	w4, #0
	bl	_dma_pool_create
	str	x0, [x19, #8]
	cbz	x0, LBB0_7
; %bb.5:
	mov	x0, x19
	bl	_fsl_qdma_pre_request_enqueue_desc
	cbz	w0, LBB0_10
; %bb.6:
	ldr	x8, [x20]
	ldr	w0, [x8]
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	ldr	x0, [x19, #8]
	bl	_dma_pool_destroy
LBB0_7:
	ldr	x0, [x19]
	bl	_dma_pool_destroy
LBB0_8:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_10:
	ldr	w8, [x21]
	add	w0, w8, #1
	str	w0, [x21]
	b	LBB0_9
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"comp_pool"

	.comm	_FSL_QDMA_COMMAND_BUFFER_SIZE,4,2 ; @FSL_QDMA_COMMAND_BUFFER_SIZE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"desc_pool"

	.comm	_FSL_QDMA_DESCRIPTOR_BUFFER_SIZE,4,2 ; @FSL_QDMA_DESCRIPTOR_BUFFER_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"failed to alloc dma buffer for S/G descriptor\n"

	.no_dead_strip	_fsl_qdma_alloc_chan_resources
.subsections_via_symbols
