	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_cqdma_hw_init
_mtk_cqdma_hw_init:                     ## @mtk_cqdma_hw_init
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_cqdma2dev
	movl	%eax, %edi
	callq	_pm_runtime_enable
	movq	%r15, %rdi
	callq	_cqdma2dev
	movl	%eax, %edi
	callq	_pm_runtime_get_sync
	movl	16(%r15), %edi
	callq	_clk_prepare_enable
	testl	%eax, %eax
	je	LBB0_1
## %bb.8:
	movl	%eax, %r14d
	movq	%r15, %rdi
	callq	_cqdma2dev
	movl	%eax, %edi
	callq	_pm_runtime_put_sync
	movq	%r15, %rdi
	callq	_cqdma2dev
	movl	%eax, %edi
	callq	_pm_runtime_disable
	jmp	LBB0_7
LBB0_1:
	cmpq	$0, (%r15)
	je	LBB0_6
## %bb.2:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_spin_lock_irqsave
	movq	8(%r15), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_mtk_cqdma_hard_reset
	testq	%rax, %rax
	js	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r15), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_spin_unlock_irqrestore
	incq	%rbx
	cmpq	(%r15), %rbx
	jb	LBB0_3
LBB0_6:
	xorl	%r14d, %r14d
	jmp	LBB0_7
LBB0_4:
	movq	%r15, %rdi
	callq	_cqdma2dev
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_err
	movq	8(%r15), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_spin_unlock_irqrestore
	movl	16(%r15), %edi
	callq	_clk_disable_unprepare
	movq	%r15, %rdi
	callq	_cqdma2dev
	movl	%eax, %edi
	callq	_pm_runtime_put_sync
	movq	%r15, %rdi
	callq	_cqdma2dev
	movl	%eax, %edi
	callq	_pm_runtime_disable
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_7:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cqdma hard reset timeout\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_mtk_cqdma_hw_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_cqdma_hw_init
_mtk_cqdma_hw_init:                     ; @mtk_cqdma_hw_init
	.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	x19, x0
	bl	_cqdma2dev
	bl	_pm_runtime_enable
	mov	x0, x19
	bl	_cqdma2dev
	bl	_pm_runtime_get_sync
	ldr	w0, [x19, #16]
	bl	_clk_prepare_enable
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
	mov	x0, x19
	bl	_cqdma2dev
	bl	_pm_runtime_put_sync
	mov	x0, x19
	bl	_cqdma2dev
	bl	_pm_runtime_disable
	b	LBB0_8
LBB0_2:
	ldr	x8, [x19]
	cbz	x8, LBB0_6
; %bb.3:
	mov	x20, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	lsl	x21, x20, #3
	ldr	x0, [x8, x21]
	bl	_spin_lock_irqsave
	ldr	x8, [x19, #8]
	ldr	x0, [x8, x21]
	bl	_mtk_cqdma_hard_reset
	tbnz	x0, #63, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #8]
	ldr	x0, [x8, x20, lsl #3]
	bl	_spin_unlock_irqrestore
	add	x20, x20, #1
	ldr	x8, [x19]
	cmp	x20, x8
	b.lo	LBB0_4
LBB0_6:
	mov	w20, #0
	b	LBB0_8
LBB0_7:
	mov	x0, x19
	bl	_cqdma2dev
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	ldr	x8, [x19, #8]
	ldr	x0, [x8, x20, lsl #3]
	bl	_spin_unlock_irqrestore
	ldr	w0, [x19, #16]
	bl	_clk_disable_unprepare
	mov	x0, x19
	bl	_cqdma2dev
	bl	_pm_runtime_put_sync
	mov	x0, x19
	bl	_cqdma2dev
	bl	_pm_runtime_disable
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_8:
	mov	x0, x20
	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
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cqdma hard reset timeout\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_mtk_cqdma_hw_init
.subsections_via_symbols
