	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rv770_convert_power_level_to_smc
_rv770_convert_power_level_to_smc:      ## @rv770_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r12d
	movq	%rdx, %r13
	movq	%rsi, %r15
	movq	%rdi, %r14
	callq	_rv770_get_pi
	cmpq	$0, 24(%rax)
	setne	%dl
	movl	(%r15), %ecx
	movq	_ATOM_PPLIB_R600_FLAGS_PCIEGEN2@GOTPCREL(%rip), %rdi
	movl	(%rdi), %esi
	andl	%ecx, %esi
	setne	%bl
	andb	%dl, %bl
	movzbl	%bl, %edx
	movl	%edx, (%r13)
	xorl	%esi, %esi
	movl	(%rdi), %edx
	andl	%ecx, %edx
	setne	%sil
	movl	%esi, 4(%r13)
	movq	_ATOM_PPLIB_R600_FLAGS_BACKBIASENABLE@GOTPCREL(%rip), %rsi
	xorl	%edx, %edx
	andl	(%rsi), %ecx
	setne	%dl
	movl	%edx, 8(%r13)
	movl	%r12d, 36(%r13)
	movq	(%r14), %rdi
	movq	_CHIP_RV740@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rdi
	jne	LBB0_2
## %bb.1:
	movq	%rax, %rbx
	movl	20(%r15), %esi
	leaq	32(%r13), %rdx
	movq	%r14, %rdi
	callq	_rv740_populate_sclk_value
	testl	%eax, %eax
	jne	LBB0_19
	jmp	LBB0_7
LBB0_2:
	movq	_CHIP_RV730@GOTPCREL(%rip), %rcx
	leaq	32(%r13), %rdx
	movl	20(%r15), %esi
	cmpq	(%rcx), %rdi
	je	LBB0_4
## %bb.3:
	movq	_CHIP_RV710@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdi
	je	LBB0_4
## %bb.5:
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_rv770_populate_sclk_value
	testl	%eax, %eax
	jne	LBB0_19
	jmp	LBB0_7
LBB0_4:
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_rv730_populate_sclk_value
	testl	%eax, %eax
	jne	LBB0_19
LBB0_7:
	movq	(%r14), %rax
	cmpq	(%r12), %rax
	jne	LBB0_13
## %bb.8:
	cmpq	$0, 16(%rbx)
	movq	8(%r15), %rdx
	je	LBB0_12
## %bb.9:
	movq	%rbx, %rsi
	xorl	%ebx, %ebx
	movl	$0, %eax
	cmpq	(%rsi), %rdx
	jg	LBB0_11
## %bb.10:
	movq	%rsi, %r12
	movq	%rdx, %rdi
	callq	_rv740_get_mclk_frequency_ratio
	movq	%r12, %rsi
	orl	$16, %eax
LBB0_11:
	movl	%eax, 12(%r13)
	movq	8(%r15), %rdx
	movq	_SMC_MC_EDC_RD_FLAG@GOTPCREL(%rip), %rax
	movq	_SMC_MC_EDC_WR_FLAG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	cmpq	8(%rsi), %rdx
	cmovgl	%ecx, %ebx
	movl	%ebx, 16(%r13)
LBB0_12:
	movl	20(%r15), %esi
	leaq	28(%r13), %rcx
	movq	%r14, %rdi
	callq	_rv740_populate_mclk_value
	testl	%eax, %eax
	jne	LBB0_19
	jmp	LBB0_18
LBB0_13:
	movq	_CHIP_RV730@GOTPCREL(%rip), %rdi
	leaq	28(%r13), %rcx
	movl	20(%r15), %esi
	movq	8(%r15), %rdx
	cmpq	(%rdi), %rax
	je	LBB0_15
## %bb.14:
	movq	_CHIP_RV710@GOTPCREL(%rip), %rdi
	cmpq	(%rdi), %rax
	je	LBB0_15
## %bb.16:
	movq	%r14, %rdi
	callq	_rv770_populate_mclk_value
	testl	%eax, %eax
	jne	LBB0_19
	jmp	LBB0_18
LBB0_15:
	movq	%r14, %rdi
	callq	_rv730_populate_mclk_value
	testl	%eax, %eax
	jne	LBB0_19
LBB0_18:
	movl	16(%r15), %esi
	leaq	24(%r13), %rdx
	movq	%r14, %rdi
	callq	_rv770_populate_vddc_value
	testl	%eax, %eax
	je	LBB0_20
LBB0_19:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movq	8(%r15), %rsi
	addq	$20, %r13
	movq	%r14, %rdi
	movq	%r13, %rdx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rv770_populate_mvdd_value      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ATOM_PPLIB_R600_FLAGS_PCIEGEN2,4,2 ## @ATOM_PPLIB_R600_FLAGS_PCIEGEN2
	.comm	_ATOM_PPLIB_R600_FLAGS_BACKBIASENABLE,4,2 ## @ATOM_PPLIB_R600_FLAGS_BACKBIASENABLE
	.comm	_CHIP_RV740,8,3                 ## @CHIP_RV740
	.comm	_CHIP_RV730,8,3                 ## @CHIP_RV730
	.comm	_CHIP_RV710,8,3                 ## @CHIP_RV710
	.comm	_SMC_MC_EDC_RD_FLAG,4,2         ## @SMC_MC_EDC_RD_FLAG
	.comm	_SMC_MC_EDC_WR_FLAG,4,2         ## @SMC_MC_EDC_WR_FLAG
	.no_dead_strip	_rv770_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 rv770_convert_power_level_to_smc
_rv770_convert_power_level_to_smc:      ; @rv770_convert_power_level_to_smc
	.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	x23, x3
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	bl	_rv770_get_pi
	mov	x22, x0
	ldr	x8, [x0, #24]
	ldr	w9, [x21]
Lloh0:
	adrp	x10, _ATOM_PPLIB_R600_FLAGS_PCIEGEN2@GOTPAGE
Lloh1:
	ldr	x10, [x10, _ATOM_PPLIB_R600_FLAGS_PCIEGEN2@GOTPAGEOFF]
	ldr	w11, [x10]
	tst	w11, w9
	ccmp	x8, #0, #4, ne
	cset	w8, ne
	str	w8, [x19]
	ldr	w8, [x10]
	tst	w8, w9
Lloh2:
	adrp	x8, _ATOM_PPLIB_R600_FLAGS_BACKBIASENABLE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ATOM_PPLIB_R600_FLAGS_BACKBIASENABLE@GOTPAGEOFF]
	cset	w10, ne
Lloh4:
	ldr	w8, [x8]
	tst	w8, w9
	cset	w8, ne
	stp	w10, w8, [x19, #4]
	str	w23, [x19, #36]
	ldr	x8, [x20]
Lloh5:
	adrp	x23, _CHIP_RV740@GOTPAGE
Lloh6:
	ldr	x23, [x23, _CHIP_RV740@GOTPAGEOFF]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	w1, [x21, #20]
	add	x2, x19, #32
	mov	x0, x20
	bl	_rv740_populate_sclk_value
	cbnz	w0, LBB0_17
	b	LBB0_5
LBB0_2:
Lloh7:
	adrp	x9, _CHIP_RV730@GOTPAGE
Lloh8:
	ldr	x9, [x9, _CHIP_RV730@GOTPAGEOFF]
Lloh9:
	adrp	x10, _CHIP_RV710@GOTPAGE
Lloh10:
	ldr	x10, [x10, _CHIP_RV710@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
Lloh12:
	ldr	x10, [x10]
	ldr	w1, [x21, #20]
	add	x2, x19, #32
	cmp	x8, x9
	mov	x0, x20
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_4
; %bb.3:
	bl	_rv730_populate_sclk_value
	cbnz	w0, LBB0_17
	b	LBB0_5
LBB0_4:
	bl	_rv770_populate_sclk_value
	cbnz	w0, LBB0_17
LBB0_5:
	ldr	x8, [x20]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.6:
	ldr	x8, [x22, #16]
	ldr	x2, [x21, #8]
	cbz	x8, LBB0_15
; %bb.7:
	ldr	x8, [x22]
	cmp	x2, x8
	b.le	LBB0_13
; %bb.8:
	mov	w8, #0
	b	LBB0_14
LBB0_9:
Lloh13:
	adrp	x9, _CHIP_RV730@GOTPAGE
Lloh14:
	ldr	x9, [x9, _CHIP_RV730@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	ldr	w1, [x21, #20]
	ldr	x2, [x21, #8]
	add	x3, x19, #28
	cmp	x8, x9
	b.eq	LBB0_12
; %bb.10:
Lloh16:
	adrp	x9, _CHIP_RV710@GOTPAGE
Lloh17:
	ldr	x9, [x9, _CHIP_RV710@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_12
; %bb.11:
	mov	x0, x20
	bl	_rv770_populate_mclk_value
	cbnz	w0, LBB0_17
	b	LBB0_16
LBB0_12:
	mov	x0, x20
	bl	_rv730_populate_mclk_value
	cbnz	w0, LBB0_17
	b	LBB0_16
LBB0_13:
	mov	x0, x2
	bl	_rv740_get_mclk_frequency_ratio
	orr	w8, w0, #0x10
LBB0_14:
	str	w8, [x19, #12]
	ldr	x2, [x21, #8]
	ldr	x8, [x22, #8]
Lloh19:
	adrp	x9, _SMC_MC_EDC_RD_FLAG@GOTPAGE
Lloh20:
	ldr	x9, [x9, _SMC_MC_EDC_RD_FLAG@GOTPAGEOFF]
Lloh21:
	adrp	x10, _SMC_MC_EDC_WR_FLAG@GOTPAGE
Lloh22:
	ldr	x10, [x10, _SMC_MC_EDC_WR_FLAG@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
Lloh24:
	ldr	w10, [x10]
	orr	w9, w10, w9
	cmp	x2, x8
	csel	w8, w9, wzr, gt
	str	w8, [x19, #16]
LBB0_15:
	ldr	w1, [x21, #20]
	add	x3, x19, #28
	mov	x0, x20
	bl	_rv740_populate_mclk_value
	cbnz	w0, LBB0_17
LBB0_16:
	ldr	w1, [x21, #16]
	add	x2, x19, #24
	mov	x0, x20
	bl	_rv770_populate_vddc_value
	cbz	w0, LBB0_18
LBB0_17:
	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
LBB0_18:
	ldr	x1, [x21, #8]
	add	x2, x19, #20
	mov	x0, x20
	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
	b	_rv770_populate_mvdd_value
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh11
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_ATOM_PPLIB_R600_FLAGS_PCIEGEN2,4,2 ; @ATOM_PPLIB_R600_FLAGS_PCIEGEN2
	.comm	_ATOM_PPLIB_R600_FLAGS_BACKBIASENABLE,4,2 ; @ATOM_PPLIB_R600_FLAGS_BACKBIASENABLE
	.comm	_CHIP_RV740,8,3                 ; @CHIP_RV740
	.comm	_CHIP_RV730,8,3                 ; @CHIP_RV730
	.comm	_CHIP_RV710,8,3                 ; @CHIP_RV710
	.comm	_SMC_MC_EDC_RD_FLAG,4,2         ; @SMC_MC_EDC_RD_FLAG
	.comm	_SMC_MC_EDC_WR_FLAG,4,2         ; @SMC_MC_EDC_WR_FLAG
	.no_dead_strip	_rv770_convert_power_level_to_smc
.subsections_via_symbols
