	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function shdma_alloc_chan_resources
_shdma_alloc_chan_resources:            ## @shdma_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, %r13
	callq	_to_shdma_chan
	movq	%rax, %r15
	movl	8(%rax), %edi
	callq	_to_shdma_dev
	movq	%rax, %r12
	movq	8(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%r13), %r14
	testq	%r14, %r14
	je	LBB0_3
## %bb.1:
	movl	(%r14), %eax
	movl	%eax, 20(%r15)
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_shdma_setup_slave
	testl	%eax, %eax
	jns	LBB0_4
## %bb.2:
	movl	%eax, %ebx
	jmp	LBB0_6
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, 16(%r15)
LBB0_4:
	movq	_NR_DESCS_PER_CHANNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movl	(%r12), %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_kcalloc
	movl	%eax, 12(%r15)
	testl	%eax, %eax
	je	LBB0_5
## %bb.9:
	movl	%eax, %edi
	movl	(%rbx), %eax
	movl	%eax, (%r15)
	movl	(%rbx), %ebx
	testl	%ebx, %ebx
	jle	LBB0_8
## %bb.10:
	leaq	8(%r15), %r14
	movq	%r15, %r12
	addq	$4, %r12
	movl	$1, %r13d
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	leal	-1(%r13), %esi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	callq	*(%rax)
	movq	%rax, %rbx
	leaq	8(%rax), %rdi
	movq	%r14, %rsi
	callq	_dma_async_tx_descriptor_init
	movq	_shdma_tx_submit@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	_DESC_IDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_list_add
	movq	_NR_DESCS_PER_CHANNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	cmpl	%ebx, %r13d
	jge	LBB0_8
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	12(%r15), %edi
	incl	%r13d
	jmp	LBB0_11
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	testq	%r14, %r14
	je	LBB0_7
LBB0_6:
	movl	(%r14), %edi
	movq	_shdma_slave_used@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_clear_bit
LBB0_7:
	movq	$0, (%r13)
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NR_DESCS_PER_CHANNEL,4,2       ## @NR_DESCS_PER_CHANNEL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_shdma_tx_submit,4,2            ## @shdma_tx_submit
	.comm	_DESC_IDLE,4,2                  ## @DESC_IDLE
	.comm	_shdma_slave_used,4,2           ## @shdma_slave_used
	.no_dead_strip	_shdma_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 shdma_alloc_chan_resources
_shdma_alloc_chan_resources:            ; @shdma_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	x21, x0
	bl	_to_shdma_chan
	mov	x19, x0
	mov	x20, x0
	ldr	w0, [x20, #8]!
	bl	_to_shdma_dev
	mov	x23, x0
	ldr	x24, [x0, #8]
	ldr	x26, [x21]
	cbz	x26, LBB0_3
; %bb.1:
	ldr	w8, [x26]
	str	w8, [x19, #20]
	mov	x0, x19
	mov	w1, #0
	bl	_shdma_setup_slave
	tbz	w0, #31, LBB0_4
; %bb.2:
	mov	x22, x0
	b	LBB0_10
LBB0_3:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x19, #16]
LBB0_4:
Lloh3:
	adrp	x25, _NR_DESCS_PER_CHANNEL@GOTPAGE
Lloh4:
	ldr	x25, [x25, _NR_DESCS_PER_CHANNEL@GOTPAGEOFF]
	ldr	w0, [x25]
	ldr	w1, [x23]
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	bl	_kcalloc
	str	w0, [x19, #12]
	cbz	w0, LBB0_9
; %bb.5:
	ldr	w8, [x25]
	str	w8, [x19]
	ldr	w22, [x25]
	cmp	w22, #1
	b.lt	LBB0_12
; %bb.6:
	add	x21, x19, #4
	mov	w23, #1
Lloh8:
	adrp	x26, _shdma_tx_submit@GOTPAGE
Lloh9:
	ldr	x26, [x26, _shdma_tx_submit@GOTPAGEOFF]
Lloh10:
	adrp	x27, _DESC_IDLE@GOTPAGE
Lloh11:
	ldr	x27, [x27, _DESC_IDLE@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	sub	w1, w23, #1
	ldr	x8, [x24]
	blr	x8
	mov	x22, x0
	add	x0, x0, #8
	mov	x1, x20
	bl	_dma_async_tx_descriptor_init
	ldr	w8, [x26]
	ldr	w9, [x27]
	stp	w9, w8, [x22, #4]
	mov	x0, x22
	mov	x1, x21
	bl	_list_add
	ldr	w22, [x25]
	cmp	w23, w22
	b.ge	LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [x19, #12]
	add	w23, w23, #1
	b	LBB0_7
LBB0_9:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w22, w8
	cbz	x26, LBB0_11
LBB0_10:
	ldr	w0, [x26]
Lloh15:
	adrp	x8, _shdma_slave_used@GOTPAGE
Lloh16:
	ldr	x8, [x8, _shdma_slave_used@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_clear_bit
LBB0_11:
	str	xzr, [x21]
LBB0_12:
	mov	x0, x22
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NR_DESCS_PER_CHANNEL,4,2       ; @NR_DESCS_PER_CHANNEL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_shdma_tx_submit,4,2            ; @shdma_tx_submit
	.comm	_DESC_IDLE,4,2                  ; @DESC_IDLE
	.comm	_shdma_slave_used,4,2           ; @shdma_slave_used
	.no_dead_strip	_shdma_alloc_chan_resources
.subsections_via_symbols
