	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smu_sw_init
_smu_sw_init:                           ## @smu_sw_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, %rbx
	leaq	8(%rdi), %r14
	movl	4(%rdi), %eax
	movl	%eax, 116(%rdi)
	movq	_SMU_FEATURE_MAX@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	movl	%eax, 112(%rdi)
	addq	$108, %rdi
	callq	_mutex_init
	movl	104(%rbx), %edi
	movl	(%r15), %esi
	callq	_bitmap_zero
	movl	100(%rbx), %edi
	movl	(%r15), %esi
	callq	_bitmap_zero
	movl	96(%rbx), %edi
	movl	(%r15), %esi
	callq	_bitmap_zero
	leaq	92(%rbx), %rdi
	callq	_mutex_init
	movq	_SMU_BACO_STATE_EXIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 88(%rbx)
	movl	$0, 84(%rbx)
	leaq	80(%rbx), %rdi
	callq	_mutex_init
	movq	$0, 72(%rbx)
	movq	_PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%rbx)
	movq	%rax, 16(%rbx)
	movq	32(%rbx), %rdx
	movb	(%rdx,%rax,4), %cl
	movl	$1, %esi
	shll	%cl, %esi
	movl	%esi, 24(%rbx)
	movl	$0, (%rdx,%rax,4)
	movq	_PP_SMC_POWER_PROFILE_FULLSCREEN3D@GOTPCREL(%rip), %r8
	movq	(%r8), %rsi
	movl	$1, (%rdx,%rsi,4)
	movq	_PP_SMC_POWER_PROFILE_POWERSAVING@GOTPCREL(%rip), %r9
	movq	(%r9), %rdi
	movl	$2, (%rdx,%rdi,4)
	movq	_PP_SMC_POWER_PROFILE_VIDEO@GOTPCREL(%rip), %r10
	movq	(%r10), %rcx
	movl	$3, (%rdx,%rcx,4)
	movq	_PP_SMC_POWER_PROFILE_VR@GOTPCREL(%rip), %r11
	movq	(%r11), %rsi
	movl	$4, (%rdx,%rsi,4)
	movq	_PP_SMC_POWER_PROFILE_COMPUTE@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rdi
	movl	$5, (%rdx,%rdi,4)
	movq	_PP_SMC_POWER_PROFILE_CUSTOM@GOTPCREL(%rip), %rdi
	movq	(%rdi), %rcx
	movl	$6, (%rdx,%rcx,4)
	movq	40(%rbx), %rcx
	movq	%rax, (%rcx)
	movq	(%r8), %rax
	movq	%rax, 8(%rcx)
	movq	(%r9), %rax
	movq	%rax, 16(%rcx)
	movq	(%r10), %rax
	movq	%rax, 24(%rcx)
	movq	(%r11), %rax
	movq	%rax, 32(%rcx)
	movq	(%rsi), %rax
	movq	%rax, 40(%rcx)
	movq	(%rdi), %rax
	movq	%rax, 48(%rcx)
	movq	%rbx, 64(%rbx)
	movq	_AMD_DPM_FORCED_LEVEL_AUTO@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 56(%rbx)
	movq	%rax, 48(%rbx)
	movq	%r14, %rdi
	callq	_smu_init_microcode
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_6
LBB0_2:
	movq	%r14, %rdi
	callq	_smu_smc_table_sw_init
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_6
LBB0_4:
	movq	%r14, %rdi
	callq	_smu_register_irq_handler
	testl	%eax, %eax
	je	LBB0_8
## %bb.5:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rdi
LBB0_6:
	callq	_pr_err
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	xorl	%ebx, %ebx
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_SMU_FEATURE_MAX,4,2            ## @SMU_FEATURE_MAX
	.comm	_SMU_BACO_STATE_EXIT,4,2        ## @SMU_BACO_STATE_EXIT
	.comm	_PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT,8,3 ## @PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT
	.comm	_PP_SMC_POWER_PROFILE_FULLSCREEN3D,8,3 ## @PP_SMC_POWER_PROFILE_FULLSCREEN3D
	.comm	_PP_SMC_POWER_PROFILE_POWERSAVING,8,3 ## @PP_SMC_POWER_PROFILE_POWERSAVING
	.comm	_PP_SMC_POWER_PROFILE_VIDEO,8,3 ## @PP_SMC_POWER_PROFILE_VIDEO
	.comm	_PP_SMC_POWER_PROFILE_VR,8,3    ## @PP_SMC_POWER_PROFILE_VR
	.comm	_PP_SMC_POWER_PROFILE_COMPUTE,8,3 ## @PP_SMC_POWER_PROFILE_COMPUTE
	.comm	_PP_SMC_POWER_PROFILE_CUSTOM,8,3 ## @PP_SMC_POWER_PROFILE_CUSTOM
	.comm	_AMD_DPM_FORCED_LEVEL_AUTO,8,3  ## @AMD_DPM_FORCED_LEVEL_AUTO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to load smu firmware!\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to sw init smc table!\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to register smc irq handler!\n"

	.no_dead_strip	_smu_sw_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smu_sw_init
_smu_sw_init:                           ; @smu_sw_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
	ldr	w8, [x0, #4]
Lloh0:
	adrp	x20, _SMU_FEATURE_MAX@GOTPAGE
Lloh1:
	ldr	x20, [x20, _SMU_FEATURE_MAX@GOTPAGEOFF]
	ldr	w9, [x20]
	stp	w9, w8, [x0, #112]
	add	x0, x0, #108
	bl	_mutex_init
	ldr	w0, [x19, #104]
	ldr	w1, [x20]
	bl	_bitmap_zero
	ldr	w0, [x19, #100]
	ldr	w1, [x20]
	bl	_bitmap_zero
	ldr	w0, [x19, #96]
	ldr	w1, [x20]
	bl	_bitmap_zero
	add	x0, x19, #92
	bl	_mutex_init
Lloh2:
	adrp	x8, _SMU_BACO_STATE_EXIT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SMU_BACO_STATE_EXIT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	stp	wzr, w8, [x19, #84]
	add	x0, x19, #80
	bl	_mutex_init
Lloh5:
	adrp	x8, _PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	lsl	x9, x8, #2
	ldp	x10, x11, [x19, #32]
	ldr	w12, [x10, x9]
	mov	w13, #1
	lsl	w12, w13, w12
	str	w12, [x19, #24]
	str	wzr, [x10, x9]
Lloh8:
	adrp	x9, _PP_SMC_POWER_PROFILE_FULLSCREEN3D@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PP_SMC_POWER_PROFILE_FULLSCREEN3D@GOTPAGEOFF]
	ldr	x12, [x9]
	str	w13, [x10, x12, lsl #2]
Lloh10:
	adrp	x12, _PP_SMC_POWER_PROFILE_POWERSAVING@GOTPAGE
Lloh11:
	ldr	x12, [x12, _PP_SMC_POWER_PROFILE_POWERSAVING@GOTPAGEOFF]
	ldr	x13, [x12]
	mov	w14, #2
	str	w14, [x10, x13, lsl #2]
Lloh12:
	adrp	x13, _PP_SMC_POWER_PROFILE_VIDEO@GOTPAGE
Lloh13:
	ldr	x13, [x13, _PP_SMC_POWER_PROFILE_VIDEO@GOTPAGEOFF]
	ldr	x14, [x13]
	mov	w15, #3
	str	w15, [x10, x14, lsl #2]
Lloh14:
	adrp	x14, _PP_SMC_POWER_PROFILE_VR@GOTPAGE
Lloh15:
	ldr	x14, [x14, _PP_SMC_POWER_PROFILE_VR@GOTPAGEOFF]
	ldr	x15, [x14]
	mov	w16, #4
	str	w16, [x10, x15, lsl #2]
Lloh16:
	adrp	x15, _PP_SMC_POWER_PROFILE_COMPUTE@GOTPAGE
Lloh17:
	ldr	x15, [x15, _PP_SMC_POWER_PROFILE_COMPUTE@GOTPAGEOFF]
	ldr	x16, [x15]
	mov	w17, #5
	str	w17, [x10, x16, lsl #2]
Lloh18:
	adrp	x16, _PP_SMC_POWER_PROFILE_CUSTOM@GOTPAGE
Lloh19:
	ldr	x16, [x16, _PP_SMC_POWER_PROFILE_CUSTOM@GOTPAGEOFF]
	ldr	x17, [x16]
	mov	w0, #6
	str	w0, [x10, x17, lsl #2]
	mov	x20, x19
	str	x8, [x20, #8]!
	str	xzr, [x19, #72]
	str	x8, [x19, #16]
	str	x8, [x11]
	ldr	x8, [x9]
	ldr	x9, [x12]
	stp	x8, x9, [x11, #8]
	ldr	x8, [x13]
	ldr	x9, [x14]
	stp	x8, x9, [x11, #24]
	ldr	x8, [x15]
	ldr	x9, [x16]
	stp	x8, x9, [x11, #40]
	str	x19, [x19, #64]
Lloh20:
	adrp	x8, _AMD_DPM_FORCED_LEVEL_AUTO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AMD_DPM_FORCED_LEVEL_AUTO@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	stp	x8, x8, [x19, #48]
	mov	x0, x20
	bl	_smu_init_microcode
	cbz	w0, LBB0_2
; %bb.1:
	mov	x19, x0
Lloh23:
	adrp	x0, l_.str@PAGE
Lloh24:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_6
LBB0_2:
	mov	x0, x20
	bl	_smu_smc_table_sw_init
	cbz	w0, LBB0_4
; %bb.3:
	mov	x19, x0
Lloh25:
	adrp	x0, l_.str.1@PAGE
Lloh26:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_4:
	mov	x0, x20
	bl	_smu_register_irq_handler
	mov	x19, x0
	cbz	w0, LBB0_7
; %bb.5:
Lloh27:
	adrp	x0, l_.str.2@PAGE
Lloh28:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_6:
	bl	_pr_err
LBB0_7:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_SMU_FEATURE_MAX,4,2            ; @SMU_FEATURE_MAX
	.comm	_SMU_BACO_STATE_EXIT,4,2        ; @SMU_BACO_STATE_EXIT
	.comm	_PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT,8,3 ; @PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT
	.comm	_PP_SMC_POWER_PROFILE_FULLSCREEN3D,8,3 ; @PP_SMC_POWER_PROFILE_FULLSCREEN3D
	.comm	_PP_SMC_POWER_PROFILE_POWERSAVING,8,3 ; @PP_SMC_POWER_PROFILE_POWERSAVING
	.comm	_PP_SMC_POWER_PROFILE_VIDEO,8,3 ; @PP_SMC_POWER_PROFILE_VIDEO
	.comm	_PP_SMC_POWER_PROFILE_VR,8,3    ; @PP_SMC_POWER_PROFILE_VR
	.comm	_PP_SMC_POWER_PROFILE_COMPUTE,8,3 ; @PP_SMC_POWER_PROFILE_COMPUTE
	.comm	_PP_SMC_POWER_PROFILE_CUSTOM,8,3 ; @PP_SMC_POWER_PROFILE_CUSTOM
	.comm	_AMD_DPM_FORCED_LEVEL_AUTO,8,3  ; @AMD_DPM_FORCED_LEVEL_AUTO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to load smu firmware!\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to sw init smc table!\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to register smc irq handler!\n"

	.no_dead_strip	_smu_sw_init
.subsections_via_symbols
