	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fsl_qdma_alloc_queue_resources
_fsl_qdma_alloc_queue_resources:        ## @fsl_qdma_alloc_queue_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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_FSL_QDMA_QUEUE_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%rbx, %rax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movl	(%r13), %r12d
	movl	4(%r13), %ecx
	cmpl	%ebx, %r12d
	cmovgel	%ebx, %r12d
	movl	%r12d, %eax
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	imull	%ecx, %eax
	imull	$56, %eax, %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	%rax, %rbx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movq	%r15, %rdx
	movl	%r12d, %ecx
	callq	_device_property_read_u32_array
	testl	%eax, %eax
	je	LBB0_5
## %bb.2:
	leaq	L_.str.1(%rip), %rsi
LBB0_3:
	movq	%r14, %rdi
	callq	_dev_err
LBB0_4:
	xorl	%ebx, %ebx
LBB0_16:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_18
## %bb.17:
	movq	%rbx, %rax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	cmpl	$0, -80(%rbp)                   ## 4-byte Folded Reload
	jle	LBB0_16
## %bb.6:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movslq	%r12d, %rax
	movl	%r12d, %ecx
	imulq	$56, %rax, %rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	imulq	$56, %rcx, %rax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	movq	%rbx, %r14
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movl	%r12d, -68(%rbp)                ## 4-byte Spill
	jmp	LBB0_7
LBB0_14:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	incq	%rcx
	addq	-104(%rbp), %r14                ## 8-byte Folded Reload
	movq	%rcx, %rax
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	cmpq	-80(%rbp), %rcx                 ## 8-byte Folded Reload
	movl	-68(%rbp), %r12d                ## 4-byte Reload
	je	LBB0_15
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
	testl	%r12d, %r12d
	jle	LBB0_14
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rbx,%r12,4), %esi
	movq	_FSL_QDMA_CIRCULAR_DESC_SIZE_MAX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	ja	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=2
	movq	_FSL_QDMA_CIRCULAR_DESC_SIZE_MIN@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jb	LBB0_10
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=2
	shll	$2, %esi
	leaq	(%r14,%r15), %rdx
	addq	$48, %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_dma_alloc_coherent
	movq	%rax, 16(%r14,%r15)
	testq	%rax, %rax
	je	LBB0_4
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=2
	movq	8(%r13), %rbx
	movq	%r13, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_FSL_QDMA_BLOCK_BASE_OFFSET
	addq	%rbx, %rax
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movq	%rax, 40(%r14,%r15)
	movl	(%rbx,%r12,4), %eax
	movl	%eax, (%r14,%r15)
	movl	%r12d, 4(%r14,%r15)
	movq	16(%r14,%r15), %rax
	movq	%rax, 32(%r14,%r15)
	movq	%rax, 24(%r14,%r15)
	leaq	(%r14,%r15), %rdi
	addq	$12, %rdi
	callq	_INIT_LIST_HEAD
	leaq	(%r14,%r15), %rdi
	addq	$8, %rdi
	callq	_spin_lock_init
	incq	%r12
	addq	$56, %r15
	cmpq	%r15, -112(%rbp)                ## 8-byte Folded Reload
	jne	LBB0_9
	jmp	LBB0_14
LBB0_10:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_3
LBB0_15:
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_16
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_FSL_QDMA_QUEUE_MAX,4,2         ## @FSL_QDMA_QUEUE_MAX
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"queue-sizes"

L_.str.1:                               ## @.str.1
	.asciz	"Can't get queue-sizes.\n"

	.comm	_FSL_QDMA_CIRCULAR_DESC_SIZE_MAX,4,2 ## @FSL_QDMA_CIRCULAR_DESC_SIZE_MAX
	.comm	_FSL_QDMA_CIRCULAR_DESC_SIZE_MIN,4,2 ## @FSL_QDMA_CIRCULAR_DESC_SIZE_MIN
L_.str.2:                               ## @.str.2
	.asciz	"Get wrong queue-sizes.\n"

	.no_dead_strip	_fsl_qdma_alloc_queue_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_queue_resources
_fsl_qdma_alloc_queue_resources:        ; @fsl_qdma_alloc_queue_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
	sub	sp, sp, #48
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x8, _FSL_QDMA_QUEUE_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FSL_QDMA_QUEUE_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w12, [x8]
	lsl	x8, x12, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	ldp	w8, w23, [x1]
	cmp	w8, w12
	csel	w24, w8, w12, lt
	mul	w8, w24, w23
	mov	w9, #56
	mul	w1, w8, w9
Lloh8:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	bl	_devm_kzalloc
	mov	x28, x0
	cbz	x0, LBB0_5
; %bb.1:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	mov	x3, x24
	bl	_device_property_read_u32_array
	cbz	w0, LBB0_7
; %bb.2:
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_3:
	mov	x0, x19
	bl	_dev_err
LBB0_4:
	mov	x28, #0
LBB0_5:
	ldur	x8, [x29, #-88]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.6:
	mov	x0, x28
	sub	sp, x29, #80
	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
LBB0_7:
	cmp	w23, #1
	b.lt	LBB0_5
; %bb.8:
	mov	x25, #0
	mov	w8, #56
	smull	x9, w24, w8
	stur	x9, [x29, #-120]                ; 8-byte Folded Spill
	umull	x8, w24, w8
	stp	x23, x8, [x29, #-104]           ; 16-byte Folded Spill
	mov	x22, x28
	stur	w24, [x29, #-108]               ; 4-byte Folded Spill
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x25, x25, #1
	ldur	x8, [x29, #-120]                ; 8-byte Folded Reload
	add	x22, x22, x8
	ldur	x23, [x29, #-104]               ; 8-byte Folded Reload
	cmp	x25, x23
	ldur	w24, [x29, #-108]               ; 4-byte Folded Reload
	b.eq	LBB0_5
LBB0_10:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_12 Depth 2
	cmp	w24, #1
	b.lt	LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x27, #0
	mov	x26, #0
LBB0_12:                                ;   Parent Loop BB0_10 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x21, x26, lsl #2]
Lloh18:
	adrp	x9, _FSL_QDMA_CIRCULAR_DESC_SIZE_MAX@GOTPAGE
Lloh19:
	ldr	x9, [x9, _FSL_QDMA_CIRCULAR_DESC_SIZE_MAX@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
Lloh21:
	adrp	x10, _FSL_QDMA_CIRCULAR_DESC_SIZE_MIN@GOTPAGE
Lloh22:
	ldr	x10, [x10, _FSL_QDMA_CIRCULAR_DESC_SIZE_MIN@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	cmp	w8, w9
	ccmp	w8, w10, #0, ls
	b.lo	LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=2
	lsl	w1, w8, #2
	add	x24, x22, x27
	add	x2, x24, #48
Lloh24:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh26:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_dma_alloc_coherent
	str	x0, [x24, #16]
	cbz	x0, LBB0_4
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=2
	ldr	x23, [x20, #8]
	mov	x0, x20
	mov	x1, x25
	bl	_FSL_QDMA_BLOCK_BASE_OFFSET
	add	x8, x0, x23
	str	x8, [x24, #40]
	ldr	w8, [x21, x26, lsl #2]
	stp	w8, w26, [x24]
	ldr	x8, [x24, #16]
	stp	x8, x8, [x24, #24]
	add	x0, x24, #12
	bl	_INIT_LIST_HEAD
	add	x0, x24, #8
	bl	_spin_lock_init
	add	x26, x26, #1
	add	x27, x27, #56
	ldur	x8, [x29, #-96]                 ; 8-byte Folded Reload
	cmp	x8, x27
	b.ne	LBB0_12
	b	LBB0_9
LBB0_15:
Lloh27:
	adrp	x1, l_.str.2@PAGE
Lloh28:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_3
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_FSL_QDMA_QUEUE_MAX,4,2         ; @FSL_QDMA_QUEUE_MAX
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"queue-sizes"

l_.str.1:                               ; @.str.1
	.asciz	"Can't get queue-sizes.\n"

	.comm	_FSL_QDMA_CIRCULAR_DESC_SIZE_MAX,4,2 ; @FSL_QDMA_CIRCULAR_DESC_SIZE_MAX
	.comm	_FSL_QDMA_CIRCULAR_DESC_SIZE_MIN,4,2 ; @FSL_QDMA_CIRCULAR_DESC_SIZE_MIN
l_.str.2:                               ; @.str.2
	.asciz	"Get wrong queue-sizes.\n"

	.no_dead_strip	_fsl_qdma_alloc_queue_resources
.subsections_via_symbols
