	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function si_populate_ulv_state
_si_populate_ulv_state:                 ## @si_populate_ulv_state
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_evergreen_get_pi
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_si_get_pi
	movq	%rax, %r12
	leaq	8(%rax), %rsi
	movq	8(%r14), %rdx
	movq	%rbx, %rdi
	callq	_si_convert_power_level_to_smc
	testl	%eax, %eax
	jne	LBB0_10
## %bb.1:
	cmpq	$0, (%r15)
	je	LBB0_6
## %bb.2:
	movq	_SCLK_MIN_DEEPSLEEP_FREQ@GOTPCREL(%rip), %rcx
	cmpq	$1350, (%rcx)                   ## imm = 0x546
	jl	LBB0_3
## %bb.4:
	movq	_PPSMC_STATEFLAG_DEEPSLEEP_BYPASS@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_3:
	movq	_PPSMC_STATEFLAG_DEEPSLEEP_THROTTLE@GOTPCREL(%rip), %rcx
LBB0_5:
	movl	(%rcx), %ecx
	movq	8(%r14), %rdx
	orl	%ecx, 24(%rdx)
LBB0_6:
	cmpq	$0, (%r12)
	je	LBB0_7
## %bb.8:
	movq	_PPSMC_SWSTATE_FLAG_PCIE_X1@GOTPCREL(%rip), %rdx
	movl	4(%r14), %ecx
	orl	(%rdx), %ecx
	jmp	LBB0_9
LBB0_7:
	movl	4(%r14), %ecx
LBB0_9:
	movq	_SISLANDS_ULV_STATE_ARB_INDEX@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	8(%r14), %rsi
	movq	%rdx, 16(%rsi)
	movl	$1, (%rsi)
	movl	4(%rsi), %edx
	movl	%edx, 8(%rsi)
	movl	$1, (%r14)
	movq	_PPSMC_SWSTATE_FLAG_DC@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movl	%ecx, 4(%r14)
LBB0_10:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SCLK_MIN_DEEPSLEEP_FREQ,8,3    ## @SCLK_MIN_DEEPSLEEP_FREQ
	.comm	_PPSMC_STATEFLAG_DEEPSLEEP_BYPASS,4,2 ## @PPSMC_STATEFLAG_DEEPSLEEP_BYPASS
	.comm	_PPSMC_STATEFLAG_DEEPSLEEP_THROTTLE,4,2 ## @PPSMC_STATEFLAG_DEEPSLEEP_THROTTLE
	.comm	_PPSMC_SWSTATE_FLAG_PCIE_X1,4,2 ## @PPSMC_SWSTATE_FLAG_PCIE_X1
	.comm	_SISLANDS_ULV_STATE_ARB_INDEX,8,3 ## @SISLANDS_ULV_STATE_ARB_INDEX
	.comm	_PPSMC_SWSTATE_FLAG_DC,4,2      ## @PPSMC_SWSTATE_FLAG_DC
	.no_dead_strip	_si_populate_ulv_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function si_populate_ulv_state
_si_populate_ulv_state:                 ; @si_populate_ulv_state
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	mov	x22, x0
	bl	_evergreen_get_pi
	mov	x21, x0
	mov	x0, x22
	bl	_si_get_pi
	mov	x20, x0
	add	x1, x0, #8
	ldr	x2, [x19, #8]
	mov	x0, x22
	bl	_si_convert_power_level_to_smc
	cbnz	w0, LBB0_7
; %bb.1:
	ldr	x8, [x21]
	cbz	x8, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _SCLK_MIN_DEEPSLEEP_FREQ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SCLK_MIN_DEEPSLEEP_FREQ@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _PPSMC_STATEFLAG_DEEPSLEEP_BYPASS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PPSMC_STATEFLAG_DEEPSLEEP_BYPASS@GOTPAGEOFF]
Lloh5:
	adrp	x10, _PPSMC_STATEFLAG_DEEPSLEEP_THROTTLE@GOTPAGE
Lloh6:
	ldr	x10, [x10, _PPSMC_STATEFLAG_DEEPSLEEP_THROTTLE@GOTPAGEOFF]
	cmp	x8, #1349
	csel	x8, x9, x10, gt
	ldr	w8, [x8]
	ldr	x9, [x19, #8]
	ldr	w10, [x9, #24]
	orr	w8, w10, w8
	str	w8, [x9, #24]
LBB0_3:
	ldr	x8, [x20]
	cbz	x8, LBB0_5
; %bb.4:
Lloh7:
	adrp	x8, _PPSMC_SWSTATE_FLAG_PCIE_X1@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PPSMC_SWSTATE_FLAG_PCIE_X1@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	ldr	w9, [x19, #4]
	orr	w8, w9, w8
	b	LBB0_6
LBB0_5:
	ldr	w8, [x19, #4]
LBB0_6:
Lloh10:
	adrp	x9, _SISLANDS_ULV_STATE_ARB_INDEX@GOTPAGE
Lloh11:
	ldr	x9, [x9, _SISLANDS_ULV_STATE_ARB_INDEX@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	ldr	x10, [x19, #8]
	str	x9, [x10, #16]
	mov	w9, #1
	str	w9, [x10]
	ldr	w11, [x10, #4]
	str	w11, [x10, #8]
	str	w9, [x19]
Lloh13:
	adrp	x9, _PPSMC_SWSTATE_FLAG_DC@GOTPAGE
Lloh14:
	ldr	x9, [x9, _PPSMC_SWSTATE_FLAG_DC@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x19, #4]
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_SCLK_MIN_DEEPSLEEP_FREQ,8,3    ; @SCLK_MIN_DEEPSLEEP_FREQ
	.comm	_PPSMC_STATEFLAG_DEEPSLEEP_BYPASS,4,2 ; @PPSMC_STATEFLAG_DEEPSLEEP_BYPASS
	.comm	_PPSMC_STATEFLAG_DEEPSLEEP_THROTTLE,4,2 ; @PPSMC_STATEFLAG_DEEPSLEEP_THROTTLE
	.comm	_PPSMC_SWSTATE_FLAG_PCIE_X1,4,2 ; @PPSMC_SWSTATE_FLAG_PCIE_X1
	.comm	_SISLANDS_ULV_STATE_ARB_INDEX,8,3 ; @SISLANDS_ULV_STATE_ARB_INDEX
	.comm	_PPSMC_SWSTATE_FLAG_DC,4,2      ; @PPSMC_SWSTATE_FLAG_DC
	.no_dead_strip	_si_populate_ulv_state
.subsections_via_symbols
