	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function acp_hw_fini
_acp_hw_fini:                           ## @acp_hw_fini
	.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, %r14
	cmpq	$0, 8(%rdi)
	je	LBB0_1
## %bb.2:
	movl	28(%r14), %edi
	movq	_mmACP_SOFT_RESET@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_cgs_read_register
	movq	_ACP_SOFT_RESET__SoftResetAud_MASK@GOTPCREL(%rip), %rcx
	orq	(%rcx), %rax
	movl	28(%r14), %edi
	movl	(%r15), %esi
	movq	%rax, %rdx
	callq	_cgs_write_register
	movq	_ACP_SOFT_RESET_DONE_TIME_OUT_VALUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	28(%r14), %edi
	movl	(%r15), %esi
	callq	_cgs_read_register
	movq	_ACP_SOFT_RESET__SoftResetAudDone_MASK@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	notq	%rax
	testq	%rax, (%r12)
	je	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	decq	%rbx
	je	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$100, %edi
	callq	_udelay
	movl	28(%r14), %edi
	movl	(%r15), %esi
	callq	_cgs_read_register
	jmp	LBB0_3
LBB0_8:
	movl	28(%r14), %edi
	movq	_mmACP_CONTROL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_cgs_read_register
	movq	_ACP_CONTROL__ClkEn_MASK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	notq	%rdx
	andq	%rax, %rdx
	movl	28(%r14), %edi
	movl	(%rbx), %esi
	callq	_cgs_write_register
	movq	_ACP_CLOCK_EN_TIME_OUT_VALUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	28(%r14), %edi
	movq	_mmACP_STATUS@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	callq	_cgs_read_register
	testb	$1, %al
	jne	LBB0_10
## %bb.16:                              ##   in Loop: Header=BB0_9 Depth=1
	decq	%rbx
	je	LBB0_5
## %bb.17:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	$100, %edi
	callq	_udelay
	movl	28(%r14), %edi
	jmp	LBB0_9
LBB0_1:
	movq	_AMD_IP_BLOCK_TYPE_ACP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_amdgpu_dpm_set_powergating_by_smu
	jmp	LBB0_6
LBB0_10:
	movq	_ACP_DEVS@GOTPCREL(%rip), %r13
	cmpl	$0, (%r13)
	jle	LBB0_15
## %bb.11:
	xorl	%ebx, %ebx
	leaq	L_.str.1(%rip), %r15
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_12 Depth=1
	incq	%rbx
	movslq	(%r13), %rax
	cmpq	%rax, %rbx
	jge	LBB0_15
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	movl	(%rax,%rbx,4), %edi
	movl	%ebx, %esi
	callq	_get_mfd_cell_dev
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_pm_genpd_remove_device
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_dev_err
	jmp	LBB0_14
LBB0_15:
	movl	24(%r14), %edi
	callq	_mfd_remove_devices
	movq	16(%r14), %rdi
	callq	_kfree
	movq	8(%r14), %rdi
	callq	_kfree
	movq	(%r14), %rdi
	callq	_kfree
	xorl	%ebx, %ebx
	jmp	LBB0_6
LBB0_5:
	movq	32(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AMD_IP_BLOCK_TYPE_ACP,4,2      ## @AMD_IP_BLOCK_TYPE_ACP
	.comm	_mmACP_SOFT_RESET,4,2           ## @mmACP_SOFT_RESET
	.comm	_ACP_SOFT_RESET__SoftResetAud_MASK,8,3 ## @ACP_SOFT_RESET__SoftResetAud_MASK
	.comm	_ACP_SOFT_RESET_DONE_TIME_OUT_VALUE,8,3 ## @ACP_SOFT_RESET_DONE_TIME_OUT_VALUE
	.comm	_ACP_SOFT_RESET__SoftResetAudDone_MASK,8,3 ## @ACP_SOFT_RESET__SoftResetAudDone_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to reset ACP\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_mmACP_CONTROL,4,2              ## @mmACP_CONTROL
	.comm	_ACP_CONTROL__ClkEn_MASK,8,3    ## @ACP_CONTROL__ClkEn_MASK
	.comm	_ACP_CLOCK_EN_TIME_OUT_VALUE,8,3 ## @ACP_CLOCK_EN_TIME_OUT_VALUE
	.comm	_mmACP_STATUS,4,2               ## @mmACP_STATUS
	.comm	_ACP_DEVS,4,2                   ## @ACP_DEVS
L_.str.1:                               ## @.str.1
	.asciz	"remove dev from genpd failed\n"

	.no_dead_strip	_acp_hw_fini
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function acp_hw_fini
_acp_hw_fini:                           ; @acp_hw_fini
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_9
; %bb.1:
	ldr	w0, [x19, #28]
Lloh0:
	adrp	x20, _mmACP_SOFT_RESET@GOTPAGE
Lloh1:
	ldr	x20, [x20, _mmACP_SOFT_RESET@GOTPAGEOFF]
	ldr	w1, [x20]
	bl	_cgs_read_register
Lloh2:
	adrp	x8, _ACP_SOFT_RESET__SoftResetAud_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ACP_SOFT_RESET__SoftResetAud_MASK@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	orr	x2, x8, x0
	ldr	w0, [x19, #28]
	ldr	w1, [x20]
	bl	_cgs_write_register
Lloh5:
	adrp	x8, _ACP_SOFT_RESET_DONE_TIME_OUT_VALUE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ACP_SOFT_RESET_DONE_TIME_OUT_VALUE@GOTPAGEOFF]
Lloh7:
	ldr	x21, [x8]
	ldr	w0, [x19, #28]
	ldr	w1, [x20]
	bl	_cgs_read_register
Lloh8:
	adrp	x22, _ACP_SOFT_RESET__SoftResetAudDone_MASK@GOTPAGE
Lloh9:
	ldr	x22, [x22, _ACP_SOFT_RESET__SoftResetAudDone_MASK@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22]
	bics	xzr, x8, x0
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	subs	x21, x21, #1
	b.eq	LBB0_16
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #100
	bl	_udelay
	ldr	w0, [x19, #28]
	ldr	w1, [x20]
	bl	_cgs_read_register
	b	LBB0_2
LBB0_5:
	ldr	w0, [x19, #28]
Lloh10:
	adrp	x20, _mmACP_CONTROL@GOTPAGE
Lloh11:
	ldr	x20, [x20, _mmACP_CONTROL@GOTPAGEOFF]
	ldr	w1, [x20]
	bl	_cgs_read_register
Lloh12:
	adrp	x8, _ACP_CONTROL__ClkEn_MASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ACP_CONTROL__ClkEn_MASK@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	bic	x2, x0, x8
	ldr	w0, [x19, #28]
	ldr	w1, [x20]
	bl	_cgs_write_register
Lloh15:
	adrp	x8, _ACP_CLOCK_EN_TIME_OUT_VALUE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ACP_CLOCK_EN_TIME_OUT_VALUE@GOTPAGEOFF]
Lloh17:
	ldr	x20, [x8]
	ldr	w0, [x19, #28]
Lloh18:
	adrp	x21, _mmACP_STATUS@GOTPAGE
Lloh19:
	ldr	x21, [x21, _mmACP_STATUS@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	bl	_cgs_read_register
	tbnz	w0, #0, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	subs	x20, x20, #1
	b.eq	LBB0_16
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w0, #100
	bl	_udelay
	ldr	w0, [x19, #28]
	b	LBB0_6
LBB0_9:
Lloh20:
	adrp	x8, _AMD_IP_BLOCK_TYPE_ACP@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AMD_IP_BLOCK_TYPE_ACP@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_amdgpu_dpm_set_powergating_by_smu
	mov	w0, #0
	b	LBB0_17
LBB0_10:
Lloh23:
	adrp	x23, _ACP_DEVS@GOTPAGE
Lloh24:
	ldr	x23, [x23, _ACP_DEVS@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.11:
	mov	x20, #0
Lloh25:
	adrp	x21, l_.str.1@PAGE
Lloh26:
	add	x21, x21, l_.str.1@PAGEOFF
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x20, x20, #1
	ldrsw	x8, [x23]
	cmp	x20, x8
	b.ge	LBB0_15
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	ldr	w0, [x8, x20, lsl #2]
	mov	x1, x20
	bl	_get_mfd_cell_dev
	mov	x22, x0
	bl	_pm_genpd_remove_device
	cbz	w0, LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x22
	mov	x1, x21
	bl	_dev_err
	b	LBB0_12
LBB0_15:
	ldr	w0, [x19, #24]
	bl	_mfd_remove_devices
	ldr	x0, [x19, #16]
	bl	_kfree
	ldr	x0, [x19, #8]
	bl	_kfree
	ldr	x0, [x19]
	bl	_kfree
	mov	w0, #0
	b	LBB0_17
LBB0_16:
	ldr	x0, [x19, #32]
Lloh27:
	adrp	x1, l_.str@PAGE
Lloh28:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh29:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_17:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_AMD_IP_BLOCK_TYPE_ACP,4,2      ; @AMD_IP_BLOCK_TYPE_ACP
	.comm	_mmACP_SOFT_RESET,4,2           ; @mmACP_SOFT_RESET
	.comm	_ACP_SOFT_RESET__SoftResetAud_MASK,8,3 ; @ACP_SOFT_RESET__SoftResetAud_MASK
	.comm	_ACP_SOFT_RESET_DONE_TIME_OUT_VALUE,8,3 ; @ACP_SOFT_RESET_DONE_TIME_OUT_VALUE
	.comm	_ACP_SOFT_RESET__SoftResetAudDone_MASK,8,3 ; @ACP_SOFT_RESET__SoftResetAudDone_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to reset ACP\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_mmACP_CONTROL,4,2              ; @mmACP_CONTROL
	.comm	_ACP_CONTROL__ClkEn_MASK,8,3    ; @ACP_CONTROL__ClkEn_MASK
	.comm	_ACP_CLOCK_EN_TIME_OUT_VALUE,8,3 ; @ACP_CLOCK_EN_TIME_OUT_VALUE
	.comm	_mmACP_STATUS,4,2               ; @mmACP_STATUS
	.comm	_ACP_DEVS,4,2                   ; @ACP_DEVS
l_.str.1:                               ; @.str.1
	.asciz	"remove dev from genpd failed\n"

	.no_dead_strip	_acp_hw_fini
.subsections_via_symbols
