	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pd_alloc_chan_resources
_pd_alloc_chan_resources:               ## @pd_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
	movq	%rdi, %r12
	callq	_to_pd_chan
	movq	%rax, %rbx
	movq	_tmp_list@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_LIST_HEAD
	movq	%rbx, %rdi
	callq	_pdc_is_idle
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	leaq	8(%rbx), %r14
	movq	%r14, %rdi
	callq	_list_empty
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movq	_init_nr_desc_per_channel@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	jle	LBB0_4
## %bb.6:
	xorl	%ebx, %ebx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r14
	movq	_tmp_list@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %esi
	movq	%r12, %rdi
	callq	_pdc_alloc_desc
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%rax, %rdi
	movq	%r13, %rsi
	callq	_list_add_tail
	incl	%ebx
	cmpl	(%r15), %ebx
	jl	LBB0_7
	jmp	LBB0_10
LBB0_1:
	movq	%r12, %rdi
	callq	_chan2dev
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_dbg
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_11
LBB0_5:
	movl	(%rbx), %eax
	jmp	LBB0_11
LBB0_4:
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_8:
	movq	%r12, %rdi
	callq	_chan2dev
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	movl	%ebx, %edx
	callq	_dev_warn
LBB0_10:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %r13
	addq	$4, %r13
	movq	%r13, %rdi
	callq	_spin_lock_irq
	movq	_tmp_list@GOTPCREL(%rip), %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_list_splice
	movl	%ebx, (%r14)
	movq	%r12, %rdi
	callq	_dma_cookie_init
	movq	%r13, %rdi
	callq	_spin_unlock_irq
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_pdc_enable_irq
	movl	(%r14), %eax
LBB0_11:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_tmp_list,4,2                   ## @tmp_list
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DMA channel not idle ?\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_init_nr_desc_per_channel,4,2   ## @init_nr_desc_per_channel
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.1:                               ## @.str.1
	.asciz	"Only allocated %d initial descriptors\n"

	.no_dead_strip	_pd_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 pd_alloc_chan_resources
_pd_alloc_chan_resources:               ; @pd_alloc_chan_resources
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	bl	_to_pd_chan
	mov	x20, x0
Lloh0:
	adrp	x8, _tmp_list@GOTPAGE
Lloh1:
	ldr	x8, [x8, _tmp_list@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_LIST_HEAD
	mov	x0, x20
	bl	_pdc_is_idle
	cbz	w0, LBB0_6
; %bb.1:
	add	x21, x20, #8
	mov	x0, x21
	bl	_list_empty
	cbz	w0, LBB0_10
; %bb.2:
Lloh3:
	adrp	x24, _init_nr_desc_per_channel@GOTPAGE
Lloh4:
	ldr	x24, [x24, _init_nr_desc_per_channel@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.3:
	mov	w22, #0
Lloh5:
	adrp	x25, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x25, [x25, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	adrp	x23, _tmp_list@GOTPAGE
Lloh8:
	ldr	x23, [x23, _tmp_list@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x25]
	mov	x0, x19
	bl	_pdc_alloc_desc
	cbz	x0, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x1, x23
	bl	_list_add_tail
	add	w22, w22, #1
	ldr	w8, [x24]
	cmp	w22, w8
	b.lt	LBB0_4
	b	LBB0_9
LBB0_6:
	mov	x0, x19
	bl	_chan2dev
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_7:
	mov	w22, #0
	b	LBB0_9
LBB0_8:
	mov	x0, x19
	bl	_chan2dev
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_dev_warn
LBB0_9:
	add	x23, x20, #4
	mov	x0, x23
	bl	_spin_lock_irq
Lloh16:
	adrp	x0, _tmp_list@GOTPAGE
Lloh17:
	ldr	x0, [x0, _tmp_list@GOTPAGEOFF]
	mov	x1, x21
	bl	_list_splice
	str	w22, [x20]
	mov	x0, x19
	bl	_dma_cookie_init
	mov	x0, x23
	bl	_spin_unlock_irq
	mov	x0, x19
	mov	w1, #1
	bl	_pdc_enable_irq
LBB0_10:
	ldr	w0, [x20]
LBB0_11:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_tmp_list,4,2                   ; @tmp_list
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMA channel not idle ?\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_init_nr_desc_per_channel,4,2   ; @init_nr_desc_per_channel
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.1:                               ; @.str.1
	.asciz	"Only allocated %d initial descriptors\n"

	.no_dead_strip	_pd_alloc_chan_resources
.subsections_via_symbols
