	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vega12_baco_set_state          ## -- Begin function vega12_baco_set_state
	.p2align	4, 0x90
_vega12_baco_set_state:                 ## @vega12_baco_set_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	leaq	-28(%rbp), %rsi
	callq	_smu9_baco_get_state
	xorl	%r15d, %r15d
	cmpl	%ebx, -28(%rbp)
	je	LBB0_12
## %bb.1:
	movq	_BACO_STATE_IN@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_6
## %bb.2:
	movq	_pre_baco_tbl@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%ebx, %edi
	callq	_ARRAY_SIZE
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_soc15_baco_program_registers
	testq	%rax, %rax
	je	LBB0_10
## %bb.3:
	movq	_PPSMC_MSG_EnterBaco@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_smum_send_msg_to_smc_with_parameter
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_6:
	movq	_BACO_STATE_OUT@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_10
## %bb.7:
	movl	$20, %edi
	callq	_msleep
	movq	_exit_baco_tbl@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%ebx, %edi
	callq	_ARRAY_SIZE
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_soc15_baco_program_registers
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	movq	_clean_baco_tbl@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_5:
	movq	_enter_baco_tbl@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %ebx
	movl	%ebx, %edi
	callq	_ARRAY_SIZE
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_soc15_baco_program_registers
	testq	%rax, %rax
	jne	LBB0_12
LBB0_10:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
LBB0_11:
	subl	(%rax), %r15d
LBB0_12:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BACO_STATE_IN,4,2              ## @BACO_STATE_IN
	.comm	_pre_baco_tbl,4,2               ## @pre_baco_tbl
	.comm	_PPSMC_MSG_EnterBaco,4,2        ## @PPSMC_MSG_EnterBaco
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_enter_baco_tbl,4,2             ## @enter_baco_tbl
	.comm	_BACO_STATE_OUT,4,2             ## @BACO_STATE_OUT
	.comm	_exit_baco_tbl,4,2              ## @exit_baco_tbl
	.comm	_clean_baco_tbl,4,2             ## @clean_baco_tbl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vega12_baco_set_state          ; -- Begin function vega12_baco_set_state
	.p2align	2
_vega12_baco_set_state:                 ; @vega12_baco_set_state
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
	add	x1, sp, #12
	bl	_smu9_baco_get_state
	ldr	w8, [sp, #12]
	cmp	w8, w20
	b.ne	LBB0_2
LBB0_1:
	mov	w0, #0
	b	LBB0_11
LBB0_2:
Lloh0:
	adrp	x8, _BACO_STATE_IN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BACO_STATE_IN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_6
; %bb.3:
Lloh3:
	adrp	x8, _pre_baco_tbl@GOTPAGE
Lloh4:
	ldr	x8, [x8, _pre_baco_tbl@GOTPAGEOFF]
Lloh5:
	ldr	w20, [x8]
	mov	x0, x20
	bl	_ARRAY_SIZE
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_soc15_baco_program_registers
	cbz	x0, LBB0_10
; %bb.4:
Lloh6:
	adrp	x8, _PPSMC_MSG_EnterBaco@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PPSMC_MSG_EnterBaco@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_smum_send_msg_to_smc_with_parameter
	cbnz	x0, LBB0_10
; %bb.5:
Lloh9:
	adrp	x8, _enter_baco_tbl@GOTPAGE
Lloh10:
	ldr	x8, [x8, _enter_baco_tbl@GOTPAGEOFF]
	b	LBB0_9
LBB0_6:
Lloh11:
	adrp	x8, _BACO_STATE_OUT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BACO_STATE_OUT@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_10
; %bb.7:
	mov	w0, #20
	bl	_msleep
Lloh14:
	adrp	x8, _exit_baco_tbl@GOTPAGE
Lloh15:
	ldr	x8, [x8, _exit_baco_tbl@GOTPAGEOFF]
Lloh16:
	ldr	w20, [x8]
	mov	x0, x20
	bl	_ARRAY_SIZE
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_soc15_baco_program_registers
	cbz	x0, LBB0_10
; %bb.8:
Lloh17:
	adrp	x8, _clean_baco_tbl@GOTPAGE
Lloh18:
	ldr	x8, [x8, _clean_baco_tbl@GOTPAGEOFF]
LBB0_9:
	ldr	w20, [x8]
	mov	x0, x20
	bl	_ARRAY_SIZE
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_soc15_baco_program_registers
	cbnz	x0, LBB0_1
LBB0_10:
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_BACO_STATE_IN,4,2              ; @BACO_STATE_IN
	.comm	_pre_baco_tbl,4,2               ; @pre_baco_tbl
	.comm	_PPSMC_MSG_EnterBaco,4,2        ; @PPSMC_MSG_EnterBaco
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_enter_baco_tbl,4,2             ; @enter_baco_tbl
	.comm	_BACO_STATE_OUT,4,2             ; @BACO_STATE_OUT
	.comm	_exit_baco_tbl,4,2              ; @exit_baco_tbl
	.comm	_clean_baco_tbl,4,2             ; @clean_baco_tbl
.subsections_via_symbols
