	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kv_init_graphics_levels
_kv_init_graphics_levels:               ## @kv_init_graphics_levels
	.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, %r12
	callq	_kv_get_pi
	movq	%rax, %r14
	testq	%r12, %r12
	je	LBB0_6
## %bb.1:
	cmpq	$0, (%r12)
	je	LBB0_6
## %bb.2:
	movq	$0, 8(%r14)
	movq	%r14, %r15
	addq	$40, %r15
	xorl	%ebx, %ebx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r12), %rax
	movl	4(%rax,%rbx,8), %edx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_kv_set_divider_value
	movq	8(%r12), %rax
	movl	(%rax,%rbx,8), %edx
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_kv_convert_vid7_to_vid2
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	callq	_kv_set_vid
	movq	16(%r14), %rax
	movl	(%rax,%rbx,4), %edx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_kv_set_at
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	_kv_dpm_power_level_enabled_for_throttle
	incq	8(%r14)
	incq	%rbx
	cmpq	(%r12), %rbx
	jae	LBB0_11
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %r13
	testq	%r13, %r13
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r12), %rax
	movl	(%rax,%rbx,8), %esi
	movq	%r12, %rdi
	callq	_kv_convert_8bit_index_to_voltage
	cmpq	%rax, %r13
	jge	LBB0_5
	jmp	LBB0_11
LBB0_6:
	movq	$0, 8(%r14)
	cmpq	$0, 24(%r14)
	je	LBB0_11
## %bb.7:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	32(%r14), %rax
	movl	8(%rax,%r15), %edx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_kv_set_divider_value
	movq	32(%r14), %rax
	movq	(%rax,%r15), %rdx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_kv_set_vid
	movq	16(%r14), %rax
	movl	(%rax,%rbx,4), %edx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_kv_set_at
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	_kv_dpm_power_level_enabled_for_throttle
	incq	8(%r14)
	incq	%rbx
	addq	$16, %r15
	cmpq	24(%r14), %rbx
	jae	LBB0_11
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %r13
	testq	%r13, %r13
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	32(%r14), %rax
	movq	(%rax,%r15), %rsi
	movq	%r12, %rdi
	callq	_kv_convert_2bit_index_to_voltage
	cmpq	%rax, %r13
	jge	LBB0_10
LBB0_11:
	movq	_SMU7_MAX_LEVELS_GRAPHICS@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	je	LBB0_14
## %bb.12:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	_kv_dpm_power_level_enable
	incq	%rbx
	cmpq	(%r14), %rbx
	jb	LBB0_13
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SMU7_MAX_LEVELS_GRAPHICS,8,3   ## @SMU7_MAX_LEVELS_GRAPHICS
	.no_dead_strip	_kv_init_graphics_levels
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kv_init_graphics_levels
_kv_init_graphics_levels:               ; @kv_init_graphics_levels
	.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
	bl	_kv_get_pi
	mov	x20, x0
	cbz	x19, LBB0_6
; %bb.1:
	ldr	x8, [x19]
	cbz	x8, LBB0_6
; %bb.2:
	mov	x23, #0
	mov	x21, #0
	str	xzr, [x20, #8]
	add	x22, x20, #40
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #8]
	add	x8, x8, x23
	ldr	w2, [x8, #4]
	mov	x0, x19
	mov	x1, x21
	bl	_kv_set_divider_value
	ldr	x8, [x19, #8]
	ldr	w2, [x8, x23]
	mov	x0, x19
	mov	x1, x22
	bl	_kv_convert_vid7_to_vid2
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_kv_set_vid
	ldr	x8, [x20, #16]
	ldr	w2, [x8, x21, lsl #2]
	mov	x0, x19
	mov	x1, x21
	bl	_kv_set_at
	mov	x0, x19
	mov	x1, x21
	mov	w2, #1
	bl	_kv_dpm_power_level_enabled_for_throttle
	ldr	x8, [x20, #8]
	add	x8, x8, #1
	str	x8, [x20, #8]
	add	x21, x21, #1
	ldr	x8, [x19]
	add	x23, x23, #8
	cmp	x21, x8
	b.hs	LBB0_11
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x24, [x20]
	cbz	x24, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #8]
	ldr	w1, [x8, x23]
	mov	x0, x19
	bl	_kv_convert_8bit_index_to_voltage
	cmp	x24, x0
	b.ge	LBB0_3
	b	LBB0_11
LBB0_6:
	str	xzr, [x20, #8]
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_11
; %bb.7:
	mov	x22, #0
	mov	x21, #0
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x20, #32]
	add	x8, x8, x22
	ldr	w2, [x8, #8]
	mov	x0, x19
	mov	x1, x21
	bl	_kv_set_divider_value
	ldr	x8, [x20, #32]
	ldr	x2, [x8, x22]
	mov	x0, x19
	mov	x1, x21
	bl	_kv_set_vid
	ldr	x8, [x20, #16]
	ldr	w2, [x8, x21, lsl #2]
	mov	x0, x19
	mov	x1, x21
	bl	_kv_set_at
	mov	x0, x19
	mov	x1, x21
	mov	w2, #1
	bl	_kv_dpm_power_level_enabled_for_throttle
	ldr	x8, [x20, #8]
	add	x8, x8, #1
	str	x8, [x20, #8]
	add	x21, x21, #1
	ldr	x8, [x20, #24]
	add	x22, x22, #16
	cmp	x21, x8
	b.hs	LBB0_11
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x23, [x20]
	cbz	x23, LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x20, #32]
	ldr	x1, [x8, x22]
	mov	x0, x19
	bl	_kv_convert_2bit_index_to_voltage
	cmp	x23, x0
	b.ge	LBB0_8
LBB0_11:
Lloh0:
	adrp	x21, _SMU7_MAX_LEVELS_GRAPHICS@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SMU7_MAX_LEVELS_GRAPHICS@GOTPAGEOFF]
	ldr	x8, [x21]
	cbz	x8, LBB0_14
; %bb.12:
	mov	x20, #0
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_kv_dpm_power_level_enable
	add	x20, x20, #1
	ldr	x8, [x21]
	cmp	x20, x8
	b.lo	LBB0_13
LBB0_14:
	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	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_SMU7_MAX_LEVELS_GRAPHICS,8,3   ; @SMU7_MAX_LEVELS_GRAPHICS
	.no_dead_strip	_kv_init_graphics_levels
.subsections_via_symbols
