	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sirfsoc_dma_alloc_chan_resources
_sirfsoc_dma_alloc_chan_resources:      ## @sirfsoc_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
	movq	%rdi, %r15
	callq	_dma_chan_to_sirfsoc_dma
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_dma_chan_to_sirfsoc_dma_chan
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_descs@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_LIST_HEAD
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %edi
	callq	_pm_runtime_get_sync
	movq	_SIRFSOC_DMA_DESCRIPTORS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_6
## %bb.1:
	xorl	%ebx, %ebx
	movq	_sirfsoc_dma_tx_submit@GOTPCREL(%rip), %r12
	movq	_descs@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$12, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r14
	movq	%rax, %rdi
	addq	$4, %rdi
	movq	%r15, %rsi
	callq	_dma_async_tx_descriptor_init
	movq	_DMA_CTRL_ACK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
	movl	(%r12), %eax
	movl	%eax, 4(%r14)
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_list_add_tail
	incl	%ebx
	movq	_SIRFSOC_DMA_DESCRIPTORS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jl	LBB0_2
	jmp	LBB0_4
LBB0_5:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_notice
	testl	%ebx, %ebx
	je	LBB0_6
LBB0_4:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	%r14, %rsi
	addq	$4, %rsi
	movq	_descs@GOTPCREL(%rip), %rdi
	callq	_list_splice_tail_init
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	jmp	LBB0_7
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_descs,4,2                      ## @descs
	.comm	_SIRFSOC_DMA_DESCRIPTORS,4,2    ## @SIRFSOC_DMA_DESCRIPTORS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Memory allocation error. Allocated only %u descriptors\n"

	.comm	_DMA_CTRL_ACK,4,2               ## @DMA_CTRL_ACK
	.comm	_sirfsoc_dma_tx_submit,4,2      ## @sirfsoc_dma_tx_submit
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_sirfsoc_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 sirfsoc_dma_alloc_chan_resources
_sirfsoc_dma_alloc_chan_resources:      ; @sirfsoc_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
	mov	x21, x0
	bl	_dma_chan_to_sirfsoc_dma
	mov	x22, x0
	mov	x0, x21
	bl	_dma_chan_to_sirfsoc_dma_chan
	mov	x19, x0
Lloh0:
	adrp	x8, _descs@GOTPAGE
Lloh1:
	ldr	x8, [x8, _descs@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_LIST_HEAD
	ldr	w0, [x22]
	bl	_pm_runtime_get_sync
Lloh3:
	adrp	x25, _SIRFSOC_DMA_DESCRIPTORS@GOTPAGE
Lloh4:
	ldr	x25, [x25, _SIRFSOC_DMA_DESCRIPTORS@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.1:
	mov	w20, #0
Lloh5:
	adrp	x26, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x26, [x26, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	adrp	x27, _DMA_CTRL_ACK@GOTPAGE
Lloh8:
	ldr	x27, [x27, _DMA_CTRL_ACK@GOTPAGEOFF]
Lloh9:
	adrp	x28, _sirfsoc_dma_tx_submit@GOTPAGE
Lloh10:
	ldr	x28, [x28, _sirfsoc_dma_tx_submit@GOTPAGEOFF]
Lloh11:
	adrp	x23, _descs@GOTPAGE
Lloh12:
	ldr	x23, [x23, _descs@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x26]
	mov	w0, #12
	bl	_kzalloc
	cbz	x0, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x24, x0
	add	x0, x0, #4
	mov	x1, x21
	bl	_dma_async_tx_descriptor_init
	ldr	w8, [x27]
	ldr	w9, [x28]
	stp	w9, w8, [x24, #4]
	mov	x0, x24
	mov	x1, x23
	bl	_list_add_tail
	add	w20, w20, #1
	ldr	w8, [x25]
	cmp	w20, w8
	b.lt	LBB0_2
	b	LBB0_5
LBB0_4:
	ldr	w0, [x22]
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_notice
	cbz	w20, LBB0_6
LBB0_5:
	mov	x0, x19
	bl	_spin_lock_irqsave
	add	x1, x19, #4
Lloh15:
	adrp	x0, _descs@GOTPAGE
Lloh16:
	ldr	x0, [x0, _descs@GOTPAGEOFF]
	bl	_list_splice_tail_init
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	b	LBB0_7
LBB0_6:
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_7:
	mov	x0, x20
	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	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_descs,4,2                      ; @descs
	.comm	_SIRFSOC_DMA_DESCRIPTORS,4,2    ; @SIRFSOC_DMA_DESCRIPTORS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Memory allocation error. Allocated only %u descriptors\n"

	.comm	_DMA_CTRL_ACK,4,2               ; @DMA_CTRL_ACK
	.comm	_sirfsoc_dma_tx_submit,4,2      ; @sirfsoc_dma_tx_submit
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_sirfsoc_dma_alloc_chan_resources
.subsections_via_symbols
