	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smu7_hwmgr_backend_init
_smu7_hwmgr_backend_init:               ## @smu7_hwmgr_backend_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r14
	movq	%rax, 48(%rbx)
	movq	%rbx, %rdi
	callq	_smu7_patch_voltage_workaround
	movq	%rbx, %rdi
	callq	_smu7_init_dpm_defaults
	movl	32(%rbx), %edi
	movq	_PHM_PlatformCaps_EVV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_phm_cap_enabled
	movq	%rbx, %rdi
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	callq	_smu7_get_evv_voltages
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	leaq	L_.str(%rip), %rdi
	callq	_pr_info
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_17
LBB0_6:
	callq	_smu7_get_elb_voltages
LBB0_7:
	movq	(%rbx), %rax
	movq	_PP_TABLE_V1@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.8:
	movq	%rbx, %rdi
	callq	_smu7_complete_dependency_tables
	movq	%rbx, %rdi
	callq	_smu7_set_private_data_based_on_pptable_v1
	jmp	LBB0_11
LBB0_9:
	movq	_PP_TABLE_V0@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.10:
	movq	%rbx, %rdi
	callq	_smu7_patch_dependency_tables_with_leakage
	movq	%rbx, %rdi
	callq	_smu7_set_private_data_based_on_pptable_v0
LBB0_11:
	movq	%rbx, %rdi
	callq	_phm_initializa_dynamic_state_adjustment_rule_settings
	testl	%eax, %eax
	je	LBB0_12
## %bb.15:
	movq	%rbx, %rdi
	callq	_smu7_hwmgr_backend_fini
	jmp	LBB0_16
LBB0_12:
	movq	40(%rbx), %rax
	movl	$0, (%r14)
	movq	_SMU7_MAX_HARDWARE_POWERLEVELS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 28(%rbx)
	movabsq	$214748364802, %rcx             ## imm = 0x3200000002
	movq	%rcx, 8(%rbx)
	movl	(%rax), %ecx
	movl	%ecx, 4(%r14)
	movq	_CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_14
## %bb.13:
	movl	$20, 8(%r14)
LBB0_14:
	movl	4(%rax), %eax
	movl	%eax, 12(%r14)
	movabsq	$2148020519936, %rax            ## imm = 0x1F420000400
	movq	%rax, 16(%rbx)
	movl	$500, 24(%rbx)                  ## imm = 0x1F4
	movq	%rbx, %rdi
	callq	_smu7_thermal_parameter_init
LBB0_16:
	xorl	%eax, %eax
LBB0_17:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PHM_PlatformCaps_EVV,4,2       ## @PHM_PlatformCaps_EVV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Get EVV Voltage Failed.  Abort Driver loading!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PP_TABLE_V1,8,3                ## @PP_TABLE_V1
	.comm	_PP_TABLE_V0,8,3                ## @PP_TABLE_V0
	.comm	_SMU7_MAX_HARDWARE_POWERLEVELS,4,2 ## @SMU7_MAX_HARDWARE_POWERLEVELS
	.comm	_CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3,4,2 ## @CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3
	.no_dead_strip	_smu7_hwmgr_backend_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function smu7_hwmgr_backend_init
lCPI0_0:
	.long	2                               ; 0x2
	.long	50                              ; 0x32
lCPI0_1:
	.long	536871936                       ; 0x20000400
	.long	500                             ; 0x1f4
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_smu7_hwmgr_backend_init:               ; @smu7_hwmgr_backend_init
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x20, x0
	str	x0, [x19, #48]
	mov	x0, x19
	bl	_smu7_patch_voltage_workaround
	mov	x0, x19
	bl	_smu7_init_dpm_defaults
	ldr	w0, [x19, #32]
Lloh3:
	adrp	x8, _PHM_PlatformCaps_EVV@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PHM_PlatformCaps_EVV@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_phm_cap_enabled
	cbz	x0, LBB0_6
; %bb.2:
	mov	x0, x19
	bl	_smu7_get_evv_voltages
	cbz	w0, LBB0_7
; %bb.3:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_17
LBB0_6:
	mov	x0, x19
	bl	_smu7_get_elb_voltages
LBB0_7:
	ldr	x8, [x19]
Lloh12:
	adrp	x9, _PP_TABLE_V1@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PP_TABLE_V1@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.8:
	mov	x0, x19
	bl	_smu7_complete_dependency_tables
	mov	x0, x19
	bl	_smu7_set_private_data_based_on_pptable_v1
	b	LBB0_11
LBB0_9:
Lloh15:
	adrp	x9, _PP_TABLE_V0@GOTPAGE
Lloh16:
	ldr	x9, [x9, _PP_TABLE_V0@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.10:
	mov	x0, x19
	bl	_smu7_patch_dependency_tables_with_leakage
	mov	x0, x19
	bl	_smu7_set_private_data_based_on_pptable_v0
LBB0_11:
	mov	x0, x19
	bl	_phm_initializa_dynamic_state_adjustment_rule_settings
	cbz	w0, LBB0_13
; %bb.12:
	mov	x0, x19
	bl	_smu7_hwmgr_backend_fini
	b	LBB0_16
LBB0_13:
	ldr	x8, [x19, #40]
Lloh18:
	adrp	x9, _SMU7_MAX_HARDWARE_POWERLEVELS@GOTPAGE
Lloh19:
	ldr	x9, [x9, _SMU7_MAX_HARDWARE_POWERLEVELS@GOTPAGEOFF]
	str	wzr, [x20]
Lloh20:
	ldr	w9, [x9]
	str	w9, [x19, #28]
Lloh21:
	adrp	x9, lCPI0_0@PAGE
Lloh22:
	ldr	d0, [x9, lCPI0_0@PAGEOFF]
	str	d0, [x19, #8]
	ldr	w9, [x8]
	str	w9, [x20, #4]
Lloh23:
	adrp	x10, _CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3@GOTPAGE
Lloh24:
	ldr	x10, [x10, _CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_15
; %bb.14:
	mov	w9, #20
	str	w9, [x20, #8]
LBB0_15:
	ldr	w8, [x8, #4]
	str	w8, [x20, #12]
Lloh26:
	adrp	x8, lCPI0_1@PAGE
Lloh27:
	ldr	d0, [x8, lCPI0_1@PAGEOFF]
	str	d0, [x19, #16]
	mov	w8, #500
	str	w8, [x19, #24]
	mov	x0, x19
	bl	_smu7_thermal_parameter_init
LBB0_16:
	mov	w0, #0
LBB0_17:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdr	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdr	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PHM_PlatformCaps_EVV,4,2       ; @PHM_PlatformCaps_EVV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Get EVV Voltage Failed.  Abort Driver loading!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PP_TABLE_V1,8,3                ; @PP_TABLE_V1
	.comm	_PP_TABLE_V0,8,3                ; @PP_TABLE_V0
	.comm	_SMU7_MAX_HARDWARE_POWERLEVELS,4,2 ; @SMU7_MAX_HARDWARE_POWERLEVELS
	.comm	_CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3,4,2 ; @CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3
	.no_dead_strip	_smu7_hwmgr_backend_init
.subsections_via_symbols
