	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cypress_convert_power_state_to_smc
_cypress_convert_power_state_to_smc:    ## @cypress_convert_power_state_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
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	%rsi, %rdi
	callq	_rv770_get_ps
	movq	%rax, %rbx
	movq	%r13, %rdi
	callq	_evergreen_get_pi
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_ATOM_PPLIB_DISALLOW_ON_DC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	jne	LBB0_2
## %bb.1:
	movq	_PPSMC_SWSTATE_FLAG_DC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 8(%r14)
LBB0_2:
	leaq	8(%rbx), %rsi
	movq	(%r14), %rdx
	movq	_PPSMC_DISPLAY_WATERMARK_LOW@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movq	%r13, %rdi
	callq	_cypress_convert_power_level_to_smc
	testl	%eax, %eax
	jne	LBB0_5
## %bb.3:
	leaq	4(%rbx), %rsi
	movq	(%r14), %rdx
	addq	$8, %rdx
	movl	(%r12), %ecx
	movq	%r13, %rdi
	callq	_cypress_convert_power_level_to_smc
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movq	(%r14), %rdx
	addq	$16, %rdx
	movq	_PPSMC_DISPLAY_WATERMARK_HIGH@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_cypress_convert_power_level_to_smc
	testl	%eax, %eax
	je	LBB0_6
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_MC_CG_ARB_FREQ_F1@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%r14), %rcx
	movl	%eax, 4(%rcx)
	movq	_MC_CG_ARB_FREQ_F2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rcx)
	movq	_MC_CG_ARB_FREQ_F3@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rcx)
	xorl	%eax, %eax
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	cmpq	$0, (%rdx)
	setne	%al
	leal	(%rax,%rax), %edx
	leal	(%rax,%rax,2), %esi
	shll	$2, %eax
	movl	%edx, (%rcx)
	movl	%esi, 8(%rcx)
	movl	%eax, 16(%rcx)
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_rv770_populate_smc_sp
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rv770_populate_smc_t           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ATOM_PPLIB_DISALLOW_ON_DC,4,2  ## @ATOM_PPLIB_DISALLOW_ON_DC
	.comm	_PPSMC_SWSTATE_FLAG_DC,4,2      ## @PPSMC_SWSTATE_FLAG_DC
	.comm	_PPSMC_DISPLAY_WATERMARK_LOW,4,2 ## @PPSMC_DISPLAY_WATERMARK_LOW
	.comm	_PPSMC_DISPLAY_WATERMARK_HIGH,4,2 ## @PPSMC_DISPLAY_WATERMARK_HIGH
	.comm	_MC_CG_ARB_FREQ_F1,4,2          ## @MC_CG_ARB_FREQ_F1
	.comm	_MC_CG_ARB_FREQ_F2,4,2          ## @MC_CG_ARB_FREQ_F2
	.comm	_MC_CG_ARB_FREQ_F3,4,2          ## @MC_CG_ARB_FREQ_F3
	.no_dead_strip	_cypress_convert_power_state_to_smc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cypress_convert_power_state_to_smc
_cypress_convert_power_state_to_smc:    ; @cypress_convert_power_state_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	x19, x2
	mov	x20, x1
	mov	x21, x0
	mov	x0, x1
	bl	_rv770_get_ps
	mov	x23, x0
	mov	x0, x21
	bl	_evergreen_get_pi
	mov	x22, x0
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _ATOM_PPLIB_DISALLOW_ON_DC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ATOM_PPLIB_DISALLOW_ON_DC@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _PPSMC_SWSTATE_FLAG_DC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PPSMC_SWSTATE_FLAG_DC@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	orr	w8, w9, w8
	str	w8, [x19, #8]
LBB0_2:
	add	x1, x23, #8
	ldr	x2, [x19]
Lloh6:
	adrp	x24, _PPSMC_DISPLAY_WATERMARK_LOW@GOTPAGE
Lloh7:
	ldr	x24, [x24, _PPSMC_DISPLAY_WATERMARK_LOW@GOTPAGEOFF]
	ldr	w3, [x24]
	mov	x0, x21
	bl	_cypress_convert_power_level_to_smc
	cbnz	w0, LBB0_5
; %bb.3:
	add	x1, x23, #4
	ldr	x8, [x19]
	add	x2, x8, #8
	ldr	w3, [x24]
	mov	x0, x21
	bl	_cypress_convert_power_level_to_smc
	cbnz	w0, LBB0_5
; %bb.4:
	ldr	x8, [x19]
	add	x2, x8, #16
Lloh8:
	adrp	x8, _PPSMC_DISPLAY_WATERMARK_HIGH@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PPSMC_DISPLAY_WATERMARK_HIGH@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
	mov	x0, x21
	mov	x1, x23
	bl	_cypress_convert_power_level_to_smc
	cbz	w0, LBB0_6
LBB0_5:
	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_6:
Lloh11:
	adrp	x8, _MC_CG_ARB_FREQ_F1@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MC_CG_ARB_FREQ_F1@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _MC_CG_ARB_FREQ_F2@GOTPAGE
Lloh15:
	ldr	x9, [x9, _MC_CG_ARB_FREQ_F2@GOTPAGEOFF]
	ldr	x10, [x19]
Lloh16:
	ldr	w9, [x9]
Lloh17:
	adrp	x11, _MC_CG_ARB_FREQ_F3@GOTPAGE
Lloh18:
	ldr	x11, [x11, _MC_CG_ARB_FREQ_F3@GOTPAGEOFF]
Lloh19:
	ldr	w11, [x11]
	ldr	x12, [x22]
	cmp	x12, #0
	cset	w12, ne
	lsl	w13, w12, #1
	stp	w13, w8, [x10]
	mov	w8, #3
	csel	w8, wzr, w8, eq
	lsl	w12, w12, #2
	stp	w8, w9, [x10, #8]
	stp	w12, w11, [x10, #16]
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_rv770_populate_smc_sp
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	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_smc_t
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_ATOM_PPLIB_DISALLOW_ON_DC,4,2  ; @ATOM_PPLIB_DISALLOW_ON_DC
	.comm	_PPSMC_SWSTATE_FLAG_DC,4,2      ; @PPSMC_SWSTATE_FLAG_DC
	.comm	_PPSMC_DISPLAY_WATERMARK_LOW,4,2 ; @PPSMC_DISPLAY_WATERMARK_LOW
	.comm	_PPSMC_DISPLAY_WATERMARK_HIGH,4,2 ; @PPSMC_DISPLAY_WATERMARK_HIGH
	.comm	_MC_CG_ARB_FREQ_F1,4,2          ; @MC_CG_ARB_FREQ_F1
	.comm	_MC_CG_ARB_FREQ_F2,4,2          ; @MC_CG_ARB_FREQ_F2
	.comm	_MC_CG_ARB_FREQ_F3,4,2          ; @MC_CG_ARB_FREQ_F3
	.no_dead_strip	_cypress_convert_power_state_to_smc
.subsections_via_symbols
