	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tonga_populate_vr_config
_tonga_populate_vr_config:              ## @tonga_populate_vr_config
	.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	%rsi, %r14
	movq	(%rdi), %rbx
	movq	_SMU7_VOLTAGE_CONTROL_BY_SVID2@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	cmpq	(%rbx), %rax
	jne	LBB0_5
## %bb.1:
	movq	_VR_SVI2_PLANE_1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_VRCONF_VDDGFX_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	(%r14), %edx
	movl	%edx, (%r14)
	cmpq	8(%rbx), %rax
	jne	LBB0_4
## %bb.2:
	movq	_VR_SVI2_PLANE_2@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_5:
	movq	_VR_MERGED_WITH_VDDC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_VRCONF_VDDGFX_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	(%r14), %edx
	movl	%edx, (%r14)
	cmpq	8(%rbx), %rax
	jne	LBB0_7
## %bb.6:
	movq	_VR_SVI2_PLANE_1@GOTPCREL(%rip), %rax
LBB0_3:
	orl	(%rax), %edx
	movl	%edx, (%r14)
	jmp	LBB0_9
LBB0_4:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_8
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
LBB0_8:
	callq	_pr_err
LBB0_9:
	movq	16(%rbx), %rax
	cmpq	%rax, (%r15)
	jne	LBB0_11
## %bb.10:
	movq	_VR_SVI2_PLANE_2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_VRCONF_VDDCI_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%eax, (%r14)
	movq	_SMU7_VOLTAGE_CONTROL_BY_GPIO@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	jmp	LBB0_13
LBB0_11:
	movq	_SMU7_VOLTAGE_CONTROL_BY_GPIO@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rax, %rcx
	jne	LBB0_13
## %bb.12:
	movq	_VR_SMIO_PATTERN_1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_VRCONF_VDDCI_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	%edx, (%r14)
	movq	%rax, %rcx
LBB0_13:
	cmpq	24(%rbx), %rcx
	jne	LBB0_15
## %bb.14:
	movq	_VR_SMIO_PATTERN_2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_VRCONF_MVDD_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%eax, (%r14)
LBB0_15:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SMU7_VOLTAGE_CONTROL_BY_SVID2,8,3 ## @SMU7_VOLTAGE_CONTROL_BY_SVID2
	.comm	_VR_SVI2_PLANE_1,4,2            ## @VR_SVI2_PLANE_1
	.comm	_VRCONF_VDDGFX_SHIFT,4,2        ## @VRCONF_VDDGFX_SHIFT
	.comm	_VR_SVI2_PLANE_2,4,2            ## @VR_SVI2_PLANE_2
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"VDDC and VDDGFX should be both on SVI2 control in splitted mode !\n"

	.comm	_VR_MERGED_WITH_VDDC,4,2        ## @VR_MERGED_WITH_VDDC
L_.str.1:                               ## @.str.1
	.asciz	"VDDC should be on SVI2 control in merged mode !\n"

	.comm	_VRCONF_VDDCI_SHIFT,4,2         ## @VRCONF_VDDCI_SHIFT
	.comm	_SMU7_VOLTAGE_CONTROL_BY_GPIO,8,3 ## @SMU7_VOLTAGE_CONTROL_BY_GPIO
	.comm	_VR_SMIO_PATTERN_1,4,2          ## @VR_SMIO_PATTERN_1
	.comm	_VR_SMIO_PATTERN_2,4,2          ## @VR_SMIO_PATTERN_2
	.comm	_VRCONF_MVDD_SHIFT,4,2          ## @VRCONF_MVDD_SHIFT
	.no_dead_strip	_tonga_populate_vr_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tonga_populate_vr_config
_tonga_populate_vr_config:              ; @tonga_populate_vr_config
	.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, x1
	ldr	x20, [x0]
Lloh0:
	adrp	x21, _SMU7_VOLTAGE_CONTROL_BY_SVID2@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SMU7_VOLTAGE_CONTROL_BY_SVID2@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	x9, [x20]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
Lloh2:
	adrp	x9, _VR_SVI2_PLANE_1@GOTPAGE
Lloh3:
	ldr	x9, [x9, _VR_SVI2_PLANE_1@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
Lloh5:
	adrp	x10, _VRCONF_VDDGFX_SHIFT@GOTPAGE
Lloh6:
	ldr	x10, [x10, _VRCONF_VDDGFX_SHIFT@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	ldr	w10, [x19]
	orr	w9, w10, w9
	str	w9, [x19]
	ldr	x10, [x20, #8]
	cmp	x8, x10
	b.ne	LBB0_6
; %bb.2:
Lloh8:
	adrp	x8, _VR_SVI2_PLANE_2@GOTPAGE
Lloh9:
	ldr	x8, [x8, _VR_SVI2_PLANE_2@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:
Lloh10:
	adrp	x9, _VR_MERGED_WITH_VDDC@GOTPAGE
Lloh11:
	ldr	x9, [x9, _VR_MERGED_WITH_VDDC@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
Lloh13:
	adrp	x10, _VRCONF_VDDGFX_SHIFT@GOTPAGE
Lloh14:
	ldr	x10, [x10, _VRCONF_VDDGFX_SHIFT@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	ldr	w10, [x19]
	orr	w9, w10, w9
	str	w9, [x19]
	ldr	x10, [x20, #8]
	cmp	x8, x10
	b.ne	LBB0_7
; %bb.4:
Lloh16:
	adrp	x8, _VR_SVI2_PLANE_1@GOTPAGE
Lloh17:
	ldr	x8, [x8, _VR_SVI2_PLANE_1@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	orr	w8, w8, w9
	str	w8, [x19]
	b	LBB0_9
LBB0_6:
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_8
LBB0_7:
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_8:
	bl	_pr_err
LBB0_9:
	ldr	x9, [x21]
	ldr	x8, [x20, #16]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
Lloh22:
	adrp	x8, _VR_SVI2_PLANE_2@GOTPAGE
Lloh23:
	ldr	x8, [x8, _VR_SVI2_PLANE_2@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _VRCONF_VDDCI_SHIFT@GOTPAGE
Lloh26:
	ldr	x9, [x9, _VRCONF_VDDCI_SHIFT@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	lsl	w8, w8, w9
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
Lloh28:
	adrp	x8, _SMU7_VOLTAGE_CONTROL_BY_GPIO@GOTPAGE
Lloh29:
	ldr	x8, [x8, _SMU7_VOLTAGE_CONTROL_BY_GPIO@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x8]
	b	LBB0_13
LBB0_11:
Lloh31:
	adrp	x9, _SMU7_VOLTAGE_CONTROL_BY_GPIO@GOTPAGE
Lloh32:
	ldr	x9, [x9, _SMU7_VOLTAGE_CONTROL_BY_GPIO@GOTPAGEOFF]
Lloh33:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
Lloh34:
	adrp	x9, _VR_SMIO_PATTERN_1@GOTPAGE
Lloh35:
	ldr	x9, [x9, _VR_SMIO_PATTERN_1@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
Lloh37:
	adrp	x10, _VRCONF_VDDCI_SHIFT@GOTPAGE
Lloh38:
	ldr	x10, [x10, _VRCONF_VDDCI_SHIFT@GOTPAGEOFF]
Lloh39:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	ldr	w10, [x19]
	orr	w9, w10, w9
	str	w9, [x19]
	mov	x9, x8
LBB0_13:
	ldr	x8, [x20, #24]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
Lloh40:
	adrp	x8, _VR_SMIO_PATTERN_2@GOTPAGE
Lloh41:
	ldr	x8, [x8, _VR_SMIO_PATTERN_2@GOTPAGEOFF]
Lloh42:
	adrp	x9, _VRCONF_MVDD_SHIFT@GOTPAGE
Lloh43:
	ldr	x9, [x9, _VRCONF_MVDD_SHIFT@GOTPAGEOFF]
Lloh44:
	ldr	w8, [x8]
Lloh45:
	ldr	w9, [x9]
	lsl	w8, w8, w9
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_15:
	mov	w0, #0
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_SMU7_VOLTAGE_CONTROL_BY_SVID2,8,3 ; @SMU7_VOLTAGE_CONTROL_BY_SVID2
	.comm	_VR_SVI2_PLANE_1,4,2            ; @VR_SVI2_PLANE_1
	.comm	_VRCONF_VDDGFX_SHIFT,4,2        ; @VRCONF_VDDGFX_SHIFT
	.comm	_VR_SVI2_PLANE_2,4,2            ; @VR_SVI2_PLANE_2
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"VDDC and VDDGFX should be both on SVI2 control in splitted mode !\n"

	.comm	_VR_MERGED_WITH_VDDC,4,2        ; @VR_MERGED_WITH_VDDC
l_.str.1:                               ; @.str.1
	.asciz	"VDDC should be on SVI2 control in merged mode !\n"

	.comm	_VRCONF_VDDCI_SHIFT,4,2         ; @VRCONF_VDDCI_SHIFT
	.comm	_SMU7_VOLTAGE_CONTROL_BY_GPIO,8,3 ; @SMU7_VOLTAGE_CONTROL_BY_GPIO
	.comm	_VR_SMIO_PATTERN_1,4,2          ; @VR_SMIO_PATTERN_1
	.comm	_VR_SMIO_PATTERN_2,4,2          ; @VR_SMIO_PATTERN_2
	.comm	_VRCONF_MVDD_SHIFT,4,2          ; @VRCONF_MVDD_SHIFT
	.no_dead_strip	_tonga_populate_vr_config
.subsections_via_symbols
