	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tonga_populate_cac_tables
_tonga_populate_cac_tables:             ## @tonga_populate_cac_tables
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	(%rdi), %rax
	movq	8(%rdi), %r13
	movq	(%rax), %r14
	movq	8(%rax), %r12
	movl	52(%rsi), %edi
	callq	_PP_SMC_TO_HOST_UL
	movq	%rax, %rbx
	movl	48(%r15), %edi
	callq	_PP_SMC_TO_HOST_UL
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	testq	%rbx, %rbx
	je	LBB0_6
## %bb.1:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	(%rax,%rbx,8), %rsi
	movq	%r14, %rdi
	callq	_phm_get_voltage_index
	movq	%rax, %r13
	movq	(%r14), %rax
	leaq	(,%r13,4), %rcx
	leaq	(%rcx,%rcx,2), %r12
	movl	8(%rax,%r12), %edi
	callq	_convert_to_vid
	movq	40(%r15), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	(%r14), %rax
	movl	4(%rax,%r12), %edi
	callq	_convert_to_vid
	movq	32(%r15), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	(%r14), %rax
	movl	(%rax,%r12), %edi
	callq	_convert_to_vid
	movq	24(%r15), %rcx
	movq	%rax, (%rcx,%rbx,8)
	incq	%rbx
	cmpq	%rbx, -56(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_2
## %bb.3:
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	_SMU7_VOLTAGE_CONTROL_BY_SVID2@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	je	LBB0_8
## %bb.4:
	xorl	%ebx, %ebx
	movq	%rsi, %r13
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	(%rax,%rbx,8), %rsi
	movq	%r14, %rdi
	callq	_phm_get_voltage_index
	movq	(%r14), %rcx
	shlq	$2, %rax
	leaq	(%rax,%rax,2), %r12
	movl	8(%rcx,%r12), %edi
	callq	_convert_to_vid
	movq	16(%r15), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	(%r14), %rax
	movl	4(%rax,%r12), %edi
	callq	_convert_to_vid
	movq	8(%r15), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	(%r14), %rax
	movl	(%rax,%r12), %edi
	callq	_convert_to_vid
	movq	(%r15), %rcx
	movq	%rax, (%rcx,%rbx,8)
	incq	%rbx
	cmpq	%rbx, %r13
	jne	LBB0_5
	jmp	LBB0_11
LBB0_6:
	movq	(%r13), %rax
	movq	_SMU7_VOLTAGE_CONTROL_BY_SVID2@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.7:
	xorl	%r13d, %r13d
LBB0_8:
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	testq	%r14, %r14
	je	LBB0_11
## %bb.9:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	leaq	(,%r13,2), %rcx
	addq	%r13, %rcx
	movl	4(%rax,%rcx,4), %edi
	callq	_convert_to_vid
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_phm_get_voltage_index
	movq	%rax, %r13
	movq	(%r12), %rax
	leaq	(,%r13,2), %rcx
	addq	%r13, %rcx
	movl	(%rax,%rcx,4), %edi
	callq	_convert_to_vid
	movq	(%r15), %rcx
	movq	%rax, (%rcx,%rbx,8)
	incq	%rbx
	cmpq	%rbx, %r14
	jne	LBB0_10
LBB0_11:
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SMU7_VOLTAGE_CONTROL_BY_SVID2,8,3 ## @SMU7_VOLTAGE_CONTROL_BY_SVID2
	.no_dead_strip	_tonga_populate_cac_tables
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tonga_populate_cac_tables
_tonga_populate_cac_tables:             ; @tonga_populate_cac_tables
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	ldp	x8, x25, [x0]
	ldp	x21, x20, [x8]
	ldr	w0, [x1, #52]
	bl	_PP_SMC_TO_HOST_UL
	mov	x22, x0
	ldr	w0, [x19, #48]
	bl	_PP_SMC_TO_HOST_UL
	mov	x23, x0
	cbz	x22, LBB0_6
; %bb.1:
	mov	x26, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25, #8]
	lsl	x27, x26, #3
	ldr	x1, [x8, x27]
	mov	x0, x21
	bl	_phm_get_voltage_index
	mov	x24, x0
	ldr	x8, [x21]
	add	x9, x0, x0, lsl #1
	lsl	x28, x9, #2
	add	x8, x8, x28
	ldr	w0, [x8, #8]
	bl	_convert_to_vid
	ldr	x8, [x19, #40]
	str	x0, [x8, x27]
	ldr	x8, [x21]
	add	x8, x8, x28
	ldr	w0, [x8, #4]
	bl	_convert_to_vid
	ldr	x8, [x19, #32]
	str	x0, [x8, x27]
	ldr	x8, [x21]
	ldr	w0, [x8, x28]
	bl	_convert_to_vid
	ldr	x8, [x19, #24]
	str	x0, [x8, x27]
	add	x26, x26, #1
	cmp	x22, x26
	b.ne	LBB0_2
; %bb.3:
	ldr	x8, [x25]
Lloh0:
	adrp	x9, _SMU7_VOLTAGE_CONTROL_BY_SVID2@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SMU7_VOLTAGE_CONTROL_BY_SVID2@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_8
; %bb.4:
	mov	x20, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25, #8]
	lsl	x23, x20, #3
	ldr	x1, [x8, x23]
	mov	x0, x21
	bl	_phm_get_voltage_index
	ldr	x8, [x21]
	add	x9, x0, x0, lsl #1
	lsl	x24, x9, #2
	add	x8, x8, x24
	ldr	w0, [x8, #8]
	bl	_convert_to_vid
	ldr	x8, [x19, #16]
	str	x0, [x8, x23]
	ldr	x8, [x21]
	add	x8, x8, x24
	ldr	w0, [x8, #4]
	bl	_convert_to_vid
	ldr	x8, [x19, #8]
	str	x0, [x8, x23]
	ldr	x8, [x21]
	ldr	w0, [x8, x24]
	bl	_convert_to_vid
	ldr	x8, [x19]
	str	x0, [x8, x23]
	add	x20, x20, #1
	cmp	x22, x20
	b.ne	LBB0_5
	b	LBB0_11
LBB0_6:
	ldr	x8, [x25]
Lloh3:
	adrp	x9, _SMU7_VOLTAGE_CONTROL_BY_SVID2@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SMU7_VOLTAGE_CONTROL_BY_SVID2@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.7:
	mov	x24, #0
LBB0_8:
	cbz	x23, LBB0_11
; %bb.9:
	mov	x21, #0
	mov	w22, #12
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	madd	x8, x24, x22, x8
	ldr	w0, [x8, #4]
	bl	_convert_to_vid
	mov	x1, x0
	mov	x0, x20
	bl	_phm_get_voltage_index
	mov	x24, x0
	ldr	x8, [x20]
	mul	x9, x0, x22
	ldr	w0, [x8, x9]
	bl	_convert_to_vid
	ldr	x8, [x19]
	str	x0, [x8, x21, lsl #3]
	add	x21, x21, #1
	cmp	x23, x21
	b.ne	LBB0_10
LBB0_11:
	mov	w0, #0
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_SMU7_VOLTAGE_CONTROL_BY_SVID2,8,3 ; @SMU7_VOLTAGE_CONTROL_BY_SVID2
	.no_dead_strip	_tonga_populate_cac_tables
.subsections_via_symbols
