	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cypress_convert_power_level_to_smc ## -- Begin function cypress_convert_power_level_to_smc
	.p2align	4, 0x90
_cypress_convert_power_level_to_smc:    ## @cypress_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
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r12
	movq	%rsi, %r14
	movq	%rdi, %r13
	callq	_rv770_get_pi
	movq	%rax, %r15
	movq	%r13, %rdi
	callq	_evergreen_get_pi
	cmpq	$0, 24(%r15)
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	setne	%al
	movl	(%r14), %ecx
	movq	_ATOM_PPLIB_R600_FLAGS_PCIEGEN2@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	andl	%ecx, %esi
	setne	%bl
	andb	%al, %bl
	movzbl	%bl, %eax
	movl	%eax, (%r12)
	xorl	%eax, %eax
	movl	(%rdx), %edx
	andl	%ecx, %edx
	setne	%al
	movl	%eax, 4(%r12)
	movq	_ATOM_PPLIB_R600_FLAGS_BACKBIASENABLE@GOTPCREL(%rip), %rax
	xorl	%edx, %edx
	andl	(%rax), %ecx
	setne	%dl
	movl	%edx, 8(%r12)
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 44(%r12)
	movl	24(%r14), %esi
	leaq	40(%r12), %rdx
	movq	%r13, %rdi
	callq	_rv740_populate_sclk_value
	testl	%eax, %eax
	jne	LBB0_24
## %bb.1:
	movl	$0, 32(%r12)
	movq	(%r15), %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	je	LBB0_7
## %bb.2:
	cmpq	%rcx, 8(%r14)
	jg	LBB0_7
## %bb.3:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpl	$0, 40(%rcx)
	jne	LBB0_7
## %bb.4:
	movq	_SMC_MC_STUTTER_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r12)
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpq	$0, 32(%rcx)
	movq	_PPSMC_STATEFLAG_AUTO_PULSE_SKIP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	je	LBB0_6
## %bb.5:
	orl	%ecx, 36(%r12)
LBB0_7:
	cmpq	$0, 16(%r15)
	je	LBB0_19
LBB0_8:
	movq	8(%r14), %rsi
	cmpq	8(%r15), %rsi
	jle	LBB0_10
## %bb.9:
	movq	_SMC_MC_EDC_RD_FLAG@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, 32(%r12)
LBB0_10:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpq	(%rcx), %rsi
	jle	LBB0_12
## %bb.11:
	movq	_SMC_MC_EDC_WR_FLAG@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, 32(%r12)
LBB0_12:
	movq	%r13, %rdi
	callq	_cypress_get_strobe_mode_settings
	movl	%eax, 12(%r12)
	movq	_SMC_STROBE_ENABLE@GOTPCREL(%rip), %r15
	testl	%eax, (%r15)
	je	LBB0_17
## %bb.13:
	movq	%r12, %rbx
	movq	8(%r14), %rsi
	movq	%r13, %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_14
## %bb.16:
	movq	_MC_SEQ_MISC6@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_17:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %r9d
	jmp	LBB0_18
LBB0_14:
	movq	_MC_SEQ_MISC5@GOTPCREL(%rip), %rax
LBB0_15:
	movl	(%rax), %edi
	callq	_RREG32
	movl	%eax, %r9d
	shrl	%r9d
	andl	$1, %r9d
	movq	%rbx, %r12
LBB0_18:
	movl	24(%r14), %esi
	movq	8(%r14), %rdx
	leaq	28(%r12), %rcx
	movl	(%r15), %eax
	xorl	%r8d, %r8d
	andl	12(%r12), %eax
	setne	%r8b
	movq	%r13, %rdi
	jmp	LBB0_20
LBB0_6:
	notl	%ecx
	andl	%ecx, 36(%r12)
	cmpq	$0, 16(%r15)
	jne	LBB0_8
LBB0_19:
	movl	24(%r14), %esi
	movq	8(%r14), %rdx
	leaq	28(%r12), %rcx
	movq	%r13, %rdi
	movl	$1, %r8d
	movl	$1, %r9d
LBB0_20:
	callq	_cypress_populate_mclk_value
	testl	%eax, %eax
	jne	LBB0_24
## %bb.21:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	24(%rax), %rsi
	movl	20(%r14), %edx
	leaq	24(%r12), %rcx
	movq	%r13, %rdi
	callq	_cypress_populate_voltage_value
	testl	%eax, %eax
	je	LBB0_22
LBB0_24:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, 16(%rax)
	je	LBB0_25
## %bb.23:
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	addq	$12, %rsi
	movl	16(%r14), %edx
	leaq	20(%r12), %rcx
	movq	%r13, %rdi
	callq	_cypress_populate_voltage_value
	testl	%eax, %eax
	jne	LBB0_24
LBB0_25:
	movq	8(%r14), %rsi
	addq	$16, %r12
	movq	%r13, %rdi
	movq	%r12, %rdx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_cypress_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	_SMC_MC_STUTTER_EN,4,2          ## @SMC_MC_STUTTER_EN
	.comm	_PPSMC_STATEFLAG_AUTO_PULSE_SKIP,4,2 ## @PPSMC_STATEFLAG_AUTO_PULSE_SKIP
	.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
	.comm	_SMC_STROBE_ENABLE,4,2          ## @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
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cypress_convert_power_level_to_smc ; -- Begin function cypress_convert_power_level_to_smc
	.p2align	2
_cypress_convert_power_level_to_smc:    ; @cypress_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	x24, x3
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	bl	_rv770_get_pi
	mov	x23, x0
	mov	x0, x20
	bl	_evergreen_get_pi
	mov	x22, x0
	ldr	x8, [x23, #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
	cset	w8, ne
Lloh2:
	adrp	x10, _ATOM_PPLIB_R600_FLAGS_BACKBIASENABLE@GOTPAGE
Lloh3:
	ldr	x10, [x10, _ATOM_PPLIB_R600_FLAGS_BACKBIASENABLE@GOTPAGEOFF]
Lloh4:
	ldr	w10, [x10]
	tst	w10, w9
	cset	w9, ne
	stp	w8, w9, [x19, #4]
	str	w24, [x19, #44]
	ldr	w1, [x21, #24]
	add	x2, x19, #40
	mov	x0, x20
	bl	_rv740_populate_sclk_value
	cbnz	w0, LBB0_24
; %bb.1:
	str	wzr, [x19, #32]
	ldr	x8, [x23]
	cbz	x8, LBB0_6
; %bb.2:
	ldr	x9, [x21, #8]
	cmp	x9, x8
	b.le	LBB0_4
; %bb.3:
	mov	w8, #0
	ldr	x9, [x23, #16]
	cbnz	x9, LBB0_7
	b	LBB0_22
LBB0_4:
	ldr	w8, [x22, #40]
	cbz	w8, LBB0_18
; %bb.5:
	mov	w8, #0
LBB0_6:
	ldr	x9, [x23, #16]
	cbz	x9, LBB0_22
LBB0_7:
	ldr	x1, [x21, #8]
	ldr	x9, [x23, #8]
	cmp	x1, x9
	b.le	LBB0_9
; %bb.8:
Lloh5:
	adrp	x9, _SMC_MC_EDC_RD_FLAG@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SMC_MC_EDC_RD_FLAG@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x19, #32]
LBB0_9:
	ldr	x9, [x22]
	cmp	x1, x9
	b.le	LBB0_11
; %bb.10:
Lloh8:
	adrp	x9, _SMC_MC_EDC_WR_FLAG@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SMC_MC_EDC_WR_FLAG@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x19, #32]
LBB0_11:
	mov	x0, x20
	bl	_cypress_get_strobe_mode_settings
	str	w0, [x19, #12]
Lloh11:
	adrp	x24, _SMC_STROBE_ENABLE@GOTPAGE
Lloh12:
	ldr	x24, [x24, _SMC_STROBE_ENABLE@GOTPAGEOFF]
	ldr	w8, [x24]
	tst	w8, w0
	b.eq	LBB0_14
; %bb.12:
	ldr	x1, [x21, #8]
	mov	x0, x20
	mov	w2, #1
	bl	_cypress_get_mclk_frequency_ratio
	mov	x23, x0
Lloh13:
	adrp	x8, _MC_SEQ_MISC7@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MC_SEQ_MISC7@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	bl	_RREG32
	ubfx	w8, w0, #16, #4
	cmp	w23, w8
	b.ge	LBB0_15
; %bb.13:
Lloh16:
	adrp	x8, _MC_SEQ_MISC6@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MC_SEQ_MISC6@GOTPAGEOFF]
	b	LBB0_16
LBB0_14:
	ldr	w5, [x22, #8]
	b	LBB0_17
LBB0_15:
Lloh18:
	adrp	x8, _MC_SEQ_MISC5@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MC_SEQ_MISC5@GOTPAGEOFF]
LBB0_16:
	ldr	w0, [x8]
	bl	_RREG32
	ubfx	w5, w0, #1, #1
LBB0_17:
	ldr	w1, [x21, #24]
	ldr	x2, [x21, #8]
	add	x3, x19, #28
	ldr	w8, [x19, #12]
	ldr	w9, [x24]
	tst	w9, w8
	cset	w4, ne
	mov	x0, x20
	bl	_cypress_populate_mclk_value
	cbnz	w0, LBB0_24
	b	LBB0_23
LBB0_18:
Lloh20:
	adrp	x8, _SMC_MC_STUTTER_EN@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SMC_MC_STUTTER_EN@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	str	w8, [x19, #32]
	ldr	x10, [x22, #32]
Lloh23:
	adrp	x9, _PPSMC_STATEFLAG_AUTO_PULSE_SKIP@GOTPAGE
Lloh24:
	ldr	x9, [x9, _PPSMC_STATEFLAG_AUTO_PULSE_SKIP@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	cbz	x10, LBB0_20
; %bb.19:
	ldr	w10, [x19, #36]
	orr	w9, w10, w9
	b	LBB0_21
LBB0_20:
	ldr	w10, [x19, #36]
	bic	w9, w10, w9
LBB0_21:
	str	w9, [x19, #36]
	ldr	x9, [x23, #16]
	cbnz	x9, LBB0_7
LBB0_22:
	ldr	w1, [x21, #24]
	ldr	x2, [x21, #8]
	add	x3, x19, #28
	mov	x0, x20
	mov	w4, #1
	mov	w5, #1
	bl	_cypress_populate_mclk_value
	cbnz	w0, LBB0_24
LBB0_23:
	add	x1, x22, #24
	ldr	w2, [x21, #20]
	add	x3, x19, #24
	mov	x0, x20
	bl	_cypress_populate_voltage_value
	cbz	w0, LBB0_25
LBB0_24:
	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_25:
	ldr	x8, [x22, #16]
	cbz	x8, LBB0_27
; %bb.26:
	add	x1, x22, #12
	ldr	w2, [x21, #16]
	add	x3, x19, #20
	mov	x0, x20
	bl	_cypress_populate_voltage_value
	cbnz	w0, LBB0_24
LBB0_27:
	ldr	x1, [x21, #8]
	add	x2, x19, #16
	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	_cypress_populate_mvdd_value
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.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	_SMC_MC_STUTTER_EN,4,2          ; @SMC_MC_STUTTER_EN
	.comm	_PPSMC_STATEFLAG_AUTO_PULSE_SKIP,4,2 ; @PPSMC_STATEFLAG_AUTO_PULSE_SKIP
	.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
	.comm	_SMC_STROBE_ENABLE,4,2          ; @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
.subsections_via_symbols
