	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ni_convert_power_level_to_smc
_ni_convert_power_level_to_smc:         ## @ni_convert_power_level_to_smc
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	callq	_rv770_get_pi
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_evergreen_get_pi
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_ni_get_pi
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_DC_STUTTER_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
	movl	%eax, %r13d
	cmpq	$0, 24(%r12)
	je	LBB0_1
## %bb.2:
	movq	_ATOM_PPLIB_R600_FLAGS_PCIEGEN2@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%eax, %eax
	testl	%ecx, (%r15)
	setne	%al
	jmp	LBB0_3
LBB0_1:
	xorl	%eax, %eax
LBB0_3:
	movl	%eax, (%r14)
	movl	24(%r15), %esi
	leaq	32(%r14), %rdx
	movq	%rbx, %rdi
	callq	_ni_populate_sclk_value
	testl	%eax, %eax
	jne	LBB0_30
## %bb.4:
	movl	$0, 28(%r14)
	movq	(%r12), %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	je	LBB0_10
## %bb.5:
	cmpq	%rcx, 8(%r15)
	jg	LBB0_10
## %bb.6:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpl	$0, 28(%rcx)
	je	LBB0_7
LBB0_10:
	cmpq	$0, 16(%r12)
	je	LBB0_23
## %bb.11:
	movq	8(%r15), %rsi
	cmpq	8(%r12), %rsi
	jle	LBB0_13
## %bb.12:
	movq	_NISLANDS_SMC_MC_EDC_RD_FLAG@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, 28(%r14)
LBB0_13:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpq	(%rcx), %rsi
	jle	LBB0_15
## %bb.14:
	movq	_NISLANDS_SMC_MC_EDC_WR_FLAG@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, 28(%r14)
LBB0_15:
	movq	%rbx, %rdi
	callq	_cypress_get_strobe_mode_settings
	movl	%eax, 4(%r14)
	movq	_NISLANDS_SMC_STROBE_ENABLE@GOTPCREL(%rip), %r13
	movq	8(%r15), %rsi
	testl	%eax, (%r13)
	je	LBB0_20
## %bb.16:
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_cypress_get_mclk_frequency_ratio
	movl	%eax, %r12d
	movq	_MC_SEQ_MISC7@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
	shrl	$16, %eax
	andl	$15, %eax
	cmpl	%eax, %r12d
	jge	LBB0_17
## %bb.19:
	movq	_MC_SEQ_MISC6@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_23:
	movl	24(%r15), %esi
	movq	8(%r15), %rdx
	leaq	24(%r14), %rcx
	movq	%rbx, %rdi
	movl	$1, %r8d
	movl	$1, %r9d
	jmp	LBB0_24
LBB0_20:
	xorl	%r9d, %r9d
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	(%rax), %rsi
	jle	LBB0_22
## %bb.21:
	movq	_NISLANDS_SMC_MC_RTT_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 28(%r14)
	jmp	LBB0_22
LBB0_17:
	movq	_MC_SEQ_MISC5@GOTPCREL(%rip), %rax
LBB0_18:
	movl	(%rax), %edi
	callq	_RREG32
	movl	%eax, %r9d
	shrl	%r9d
	andl	$1, %r9d
LBB0_22:
	movl	24(%r15), %esi
	movq	8(%r15), %rdx
	leaq	24(%r14), %rcx
	movl	(%r13), %eax
	xorl	%r8d, %r8d
	andl	4(%r14), %eax
	setne	%r8b
	movq	%rbx, %rdi
LBB0_24:
	callq	_ni_populate_mclk_value
	testl	%eax, %eax
	jne	LBB0_30
## %bb.25:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	24(%rax), %rsi
	movl	20(%r15), %edx
	leaq	20(%r14), %r12
	movq	%rbx, %rdi
	movq	%r12, %rcx
	callq	_ni_populate_voltage_value
	testl	%eax, %eax
	jne	LBB0_30
## %bb.26:
	leaq	-52(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_ni_get_std_voltage_value
	testl	%eax, %eax
	jne	LBB0_30
## %bb.27:
	movl	-52(%rbp), %esi
	movl	20(%r14), %edx
	leaq	16(%r14), %rcx
	movq	%rbx, %rdi
	callq	_ni_populate_std_voltage_value
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, 16(%rax)
	je	LBB0_29
## %bb.28:
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	addq	$8, %rsi
	movl	16(%r15), %edx
	leaq	12(%r14), %rcx
	movq	%rbx, %rdi
	callq	_ni_populate_voltage_value
	testl	%eax, %eax
	jne	LBB0_30
LBB0_29:
	movq	8(%r15), %rsi
	addq	$8, %r14
	movq	%rbx, %rdi
	movq	%r14, %rdx
	callq	_ni_populate_mvdd_value
	xorl	%eax, %eax
LBB0_30:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_DC_STUTTER_ENABLE_A@GOTPCREL(%rip), %rcx
	testl	%r13d, (%rcx)
	je	LBB0_10
## %bb.8:
	movq	_DC_STUTTER_ENABLE_B@GOTPCREL(%rip), %rcx
	testl	%r13d, (%rcx)
	je	LBB0_10
## %bb.9:
	movq	_NISLANDS_SMC_MC_STUTTER_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%r14)
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_DC_STUTTER_CNTL,4,2            ## @DC_STUTTER_CNTL
	.comm	_ATOM_PPLIB_R600_FLAGS_PCIEGEN2,4,2 ## @ATOM_PPLIB_R600_FLAGS_PCIEGEN2
	.comm	_DC_STUTTER_ENABLE_A,4,2        ## @DC_STUTTER_ENABLE_A
	.comm	_DC_STUTTER_ENABLE_B,4,2        ## @DC_STUTTER_ENABLE_B
	.comm	_NISLANDS_SMC_MC_STUTTER_EN,4,2 ## @NISLANDS_SMC_MC_STUTTER_EN
	.comm	_NISLANDS_SMC_MC_EDC_RD_FLAG,4,2 ## @NISLANDS_SMC_MC_EDC_RD_FLAG
	.comm	_NISLANDS_SMC_MC_EDC_WR_FLAG,4,2 ## @NISLANDS_SMC_MC_EDC_WR_FLAG
	.comm	_NISLANDS_SMC_STROBE_ENABLE,4,2 ## @NISLANDS_SMC_STROBE_ENABLE
	.comm	_MC_SEQ_MISC7,4,2               ## @MC_SEQ_MISC7
	.comm	_MC_SEQ_MISC5,4,2               ## @MC_SEQ_MISC5
	.comm	_MC_SEQ_MISC6,4,2               ## @MC_SEQ_MISC6
	.comm	_NISLANDS_SMC_MC_RTT_ENABLE,4,2 ## @NISLANDS_SMC_MC_RTT_ENABLE
	.no_dead_strip	_ni_convert_power_level_to_smc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ni_convert_power_level_to_smc
_ni_convert_power_level_to_smc:         ; @ni_convert_power_level_to_smc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	bl	_rv770_get_pi
	mov	x24, x0
	mov	x0, x19
	bl	_evergreen_get_pi
	mov	x22, x0
	mov	x0, x19
	bl	_ni_get_pi
	mov	x23, x0
Lloh0:
	adrp	x8, _DC_STUTTER_CNTL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DC_STUTTER_CNTL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_RREG32
	mov	x25, x0
	ldr	x8, [x24, #24]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w8, [x21]
Lloh3:
	adrp	x9, _ATOM_PPLIB_R600_FLAGS_PCIEGEN2@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ATOM_PPLIB_R600_FLAGS_PCIEGEN2@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w8, ne
LBB0_2:
	mov	x2, x20
	str	w8, [x2], #32
	ldr	w1, [x21, #24]
	mov	x0, x19
	bl	_ni_populate_sclk_value
	cbz	w0, LBB0_4
LBB0_3:
	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
	add	sp, sp, #96
	ret
LBB0_4:
	str	wzr, [x20, #28]
	ldr	x8, [x24]
	cbz	x8, LBB0_8
; %bb.5:
	ldr	x9, [x21, #8]
	cmp	x9, x8
	b.gt	LBB0_7
; %bb.6:
	ldr	w8, [x22, #28]
	cbz	w8, LBB0_20
LBB0_7:
	mov	w8, #0
LBB0_8:
	ldr	x9, [x24, #16]
	cbz	x9, LBB0_23
LBB0_9:
	ldr	x1, [x21, #8]
	ldr	x9, [x24, #8]
	cmp	x1, x9
	b.le	LBB0_11
; %bb.10:
Lloh6:
	adrp	x9, _NISLANDS_SMC_MC_EDC_RD_FLAG@GOTPAGE
Lloh7:
	ldr	x9, [x9, _NISLANDS_SMC_MC_EDC_RD_FLAG@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x20, #28]
LBB0_11:
	ldr	x9, [x22]
	cmp	x1, x9
	b.le	LBB0_13
; %bb.12:
Lloh9:
	adrp	x9, _NISLANDS_SMC_MC_EDC_WR_FLAG@GOTPAGE
Lloh10:
	ldr	x9, [x9, _NISLANDS_SMC_MC_EDC_WR_FLAG@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x20, #28]
LBB0_13:
	mov	x0, x19
	bl	_cypress_get_strobe_mode_settings
	str	w0, [x20, #4]
Lloh12:
	adrp	x24, _NISLANDS_SMC_STROBE_ENABLE@GOTPAGE
Lloh13:
	ldr	x24, [x24, _NISLANDS_SMC_STROBE_ENABLE@GOTPAGEOFF]
	ldr	w8, [x24]
	ldr	x1, [x21, #8]
	tst	w8, w0
	b.eq	LBB0_16
; %bb.14:
	mov	x0, x19
	mov	w2, #1
	bl	_cypress_get_mclk_frequency_ratio
	mov	x23, x0
Lloh14:
	adrp	x8, _MC_SEQ_MISC7@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MC_SEQ_MISC7@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_RREG32
	ubfx	w8, w0, #16, #4
	cmp	w23, w8
	b.ge	LBB0_18
; %bb.15:
Lloh17:
	adrp	x8, _MC_SEQ_MISC6@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MC_SEQ_MISC6@GOTPAGEOFF]
	b	LBB0_19
LBB0_16:
	ldr	x8, [x23]
	cmp	x1, x8
	b.le	LBB0_24
; %bb.17:
	mov	w5, #0
Lloh19:
	adrp	x8, _NISLANDS_SMC_MC_RTT_ENABLE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _NISLANDS_SMC_MC_RTT_ENABLE@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	ldr	w9, [x20, #28]
	orr	w8, w9, w8
	str	w8, [x20, #28]
	b	LBB0_25
LBB0_18:
Lloh22:
	adrp	x8, _MC_SEQ_MISC5@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MC_SEQ_MISC5@GOTPAGEOFF]
LBB0_19:
	ldr	w0, [x8]
	bl	_RREG32
	ubfx	w5, w0, #1, #1
	b	LBB0_25
LBB0_20:
Lloh24:
	adrp	x8, _DC_STUTTER_ENABLE_A@GOTPAGE
Lloh25:
	ldr	x8, [x8, _DC_STUTTER_ENABLE_A@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	tst	w8, w25
	b.eq	LBB0_7
; %bb.21:
Lloh27:
	adrp	x8, _DC_STUTTER_ENABLE_B@GOTPAGE
Lloh28:
	ldr	x8, [x8, _DC_STUTTER_ENABLE_B@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	tst	w8, w25
	b.eq	LBB0_7
; %bb.22:
Lloh30:
	adrp	x8, _NISLANDS_SMC_MC_STUTTER_EN@GOTPAGE
Lloh31:
	ldr	x8, [x8, _NISLANDS_SMC_MC_STUTTER_EN@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	str	w8, [x20, #28]
	ldr	x9, [x24, #16]
	cbnz	x9, LBB0_9
LBB0_23:
	ldr	w1, [x21, #24]
	ldr	x2, [x21, #8]
	add	x3, x20, #24
	mov	x0, x19
	mov	w4, #1
	mov	w5, #1
	bl	_ni_populate_mclk_value
	cbnz	w0, LBB0_3
	b	LBB0_26
LBB0_24:
	mov	w5, #0
LBB0_25:
	ldr	w1, [x21, #24]
	ldr	x2, [x21, #8]
	add	x3, x20, #24
	ldr	w8, [x20, #4]
	ldr	w9, [x24]
	tst	w9, w8
	cset	w4, ne
	mov	x0, x19
	bl	_ni_populate_mclk_value
	cbnz	w0, LBB0_3
LBB0_26:
	add	x1, x22, #24
	ldr	w2, [x21, #20]
	add	x23, x20, #20
	mov	x0, x19
	mov	x3, x23
	bl	_ni_populate_voltage_value
	cbnz	w0, LBB0_3
; %bb.27:
	add	x2, sp, #12
	mov	x0, x19
	mov	x1, x23
	bl	_ni_get_std_voltage_value
	cbnz	w0, LBB0_3
; %bb.28:
	ldr	w1, [sp, #12]
	ldr	w2, [x20, #20]
	add	x3, x20, #16
	mov	x0, x19
	bl	_ni_populate_std_voltage_value
	ldr	x8, [x22, #16]
	cbz	x8, LBB0_30
; %bb.29:
	add	x1, x22, #8
	ldr	w2, [x21, #16]
	add	x3, x20, #12
	mov	x0, x19
	bl	_ni_populate_voltage_value
	cbnz	w0, LBB0_3
LBB0_30:
	ldr	x1, [x21, #8]
	add	x2, x20, #8
	mov	x0, x19
	bl	_ni_populate_mvdd_value
	mov	w0, #0
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_DC_STUTTER_CNTL,4,2            ; @DC_STUTTER_CNTL
	.comm	_ATOM_PPLIB_R600_FLAGS_PCIEGEN2,4,2 ; @ATOM_PPLIB_R600_FLAGS_PCIEGEN2
	.comm	_DC_STUTTER_ENABLE_A,4,2        ; @DC_STUTTER_ENABLE_A
	.comm	_DC_STUTTER_ENABLE_B,4,2        ; @DC_STUTTER_ENABLE_B
	.comm	_NISLANDS_SMC_MC_STUTTER_EN,4,2 ; @NISLANDS_SMC_MC_STUTTER_EN
	.comm	_NISLANDS_SMC_MC_EDC_RD_FLAG,4,2 ; @NISLANDS_SMC_MC_EDC_RD_FLAG
	.comm	_NISLANDS_SMC_MC_EDC_WR_FLAG,4,2 ; @NISLANDS_SMC_MC_EDC_WR_FLAG
	.comm	_NISLANDS_SMC_STROBE_ENABLE,4,2 ; @NISLANDS_SMC_STROBE_ENABLE
	.comm	_MC_SEQ_MISC7,4,2               ; @MC_SEQ_MISC7
	.comm	_MC_SEQ_MISC5,4,2               ; @MC_SEQ_MISC5
	.comm	_MC_SEQ_MISC6,4,2               ; @MC_SEQ_MISC6
	.comm	_NISLANDS_SMC_MC_RTT_ENABLE,4,2 ; @NISLANDS_SMC_MC_RTT_ENABLE
	.no_dead_strip	_ni_convert_power_level_to_smc
.subsections_via_symbols
