	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vega20_get_current_power_state
_vega20_get_current_power_state:        ## @vega20_get_current_power_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	cmpl	$0, 16(%rdi)
	je	LBB0_2
## %bb.1:
	movq	%rdi, %r14
	cmpq	$0, 8(%rdi)
	je	LBB0_2
## %bb.3:
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	8(%r14), %rax
	movl	(%rax), %ecx
	addl	$-128, %ecx
	cmpl	$3, %ecx
	jae	LBB0_4
## %bb.7:
	movslq	%ecx, %rax
	leaq	l_switch.table.vega20_get_current_power_state(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	jmp	LBB0_8
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_4:
	movq	_SMU_STATE_CLASSIFICATION_FLAG_BOOT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 4(%rax)
	jne	LBB0_5
## %bb.6:
	movq	_POWER_STATE_TYPE_DEFAULT@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_5:
	movq	_POWER_STATE_TYPE_INTERNAL_BOOT@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_9:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_POWER_STATE_TYPE_BATTERY,4,2   ## @POWER_STATE_TYPE_BATTERY
	.comm	_POWER_STATE_TYPE_BALANCED,4,2  ## @POWER_STATE_TYPE_BALANCED
	.comm	_POWER_STATE_TYPE_PERFORMANCE,4,2 ## @POWER_STATE_TYPE_PERFORMANCE
	.comm	_SMU_STATE_CLASSIFICATION_FLAG_BOOT,4,2 ## @SMU_STATE_CLASSIFICATION_FLAG_BOOT
	.comm	_POWER_STATE_TYPE_INTERNAL_BOOT,4,2 ## @POWER_STATE_TYPE_INTERNAL_BOOT
	.comm	_POWER_STATE_TYPE_DEFAULT,4,2   ## @POWER_STATE_TYPE_DEFAULT
	.no_dead_strip	_vega20_get_current_power_state
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.vega20_get_current_power_state
l_switch.table.vega20_get_current_power_state:
	.quad	_POWER_STATE_TYPE_PERFORMANCE
	.quad	_POWER_STATE_TYPE_BATTERY
	.quad	_POWER_STATE_TYPE_BALANCED

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vega20_get_current_power_state
_vega20_get_current_power_state:        ; @vega20_get_current_power_state
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	w8, [x0, #16]
	cbz	w8, LBB0_4
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x19, #8]
	ldr	w9, [x8]
	sub	w9, w9, #128
	cmp	w9, #3
	b.hs	LBB0_5
; %bb.3:
Lloh0:
	adrp	x8, l_switch.table.vega20_get_current_power_state@PAGE
Lloh1:
	add	x8, x8, l_switch.table.vega20_get_current_power_state@PAGEOFF
	ldr	x8, [x8, w9, sxtw #3]
	b	LBB0_6
LBB0_4:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_7
LBB0_5:
	ldr	w8, [x8, #4]
Lloh5:
	adrp	x9, _SMU_STATE_CLASSIFICATION_FLAG_BOOT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SMU_STATE_CLASSIFICATION_FLAG_BOOT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	adrp	x10, _POWER_STATE_TYPE_INTERNAL_BOOT@GOTPAGE
Lloh9:
	ldr	x10, [x10, _POWER_STATE_TYPE_INTERNAL_BOOT@GOTPAGEOFF]
Lloh10:
	adrp	x11, _POWER_STATE_TYPE_DEFAULT@GOTPAGE
Lloh11:
	ldr	x11, [x11, _POWER_STATE_TYPE_DEFAULT@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x11, x10, eq
LBB0_6:
	ldr	w20, [x8]
	mov	x0, x19
	bl	_mutex_unlock
LBB0_7:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_POWER_STATE_TYPE_BATTERY,4,2   ; @POWER_STATE_TYPE_BATTERY
	.comm	_POWER_STATE_TYPE_BALANCED,4,2  ; @POWER_STATE_TYPE_BALANCED
	.comm	_POWER_STATE_TYPE_PERFORMANCE,4,2 ; @POWER_STATE_TYPE_PERFORMANCE
	.comm	_SMU_STATE_CLASSIFICATION_FLAG_BOOT,4,2 ; @SMU_STATE_CLASSIFICATION_FLAG_BOOT
	.comm	_POWER_STATE_TYPE_INTERNAL_BOOT,4,2 ; @POWER_STATE_TYPE_INTERNAL_BOOT
	.comm	_POWER_STATE_TYPE_DEFAULT,4,2   ; @POWER_STATE_TYPE_DEFAULT
	.no_dead_strip	_vega20_get_current_power_state
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.vega20_get_current_power_state
l_switch.table.vega20_get_current_power_state:
	.quad	_POWER_STATE_TYPE_PERFORMANCE
	.quad	_POWER_STATE_TYPE_BATTERY
	.quad	_POWER_STATE_TYPE_BALANCED

.subsections_via_symbols
