	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smu_v11_0_baco_set_state
_smu_v11_0_baco_set_state:              ## @smu_v11_0_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r12
	callq	_smu_v11_0_baco_get_state
	xorl	%ebx, %ebx
	cmpl	%r14d, %eax
	je	LBB0_7
## %bb.1:
	leaq	4(%r12), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	_SMU_BACO_STATE_ENTER@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_3
## %bb.2:
	movq	_SMU_MSG_EnterBaco@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BACO_SEQ_BACO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_smu_send_smc_msg_with_param
	jmp	LBB0_4
LBB0_3:
	movq	_SMU_MSG_ExitBaco@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_smu_send_smc_msg
LBB0_4:
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	movl	%r14d, (%r12)
LBB0_6:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_7:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SMU_BACO_STATE_ENTER,4,2       ## @SMU_BACO_STATE_ENTER
	.comm	_SMU_MSG_EnterBaco,4,2          ## @SMU_MSG_EnterBaco
	.comm	_BACO_SEQ_BACO,4,2              ## @BACO_SEQ_BACO
	.comm	_SMU_MSG_ExitBaco,4,2           ## @SMU_MSG_ExitBaco
	.no_dead_strip	_smu_v11_0_baco_set_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smu_v11_0_baco_set_state
_smu_v11_0_baco_set_state:              ; @smu_v11_0_baco_set_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	x20, x0
	bl	_smu_v11_0_baco_get_state
	cmp	w0, w19
	b.ne	LBB0_2
; %bb.1:
	mov	w22, #0
	b	LBB0_7
LBB0_2:
	add	x21, x20, #4
	mov	x0, x21
	bl	_mutex_lock
Lloh0:
	adrp	x8, _SMU_BACO_STATE_ENTER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SMU_BACO_STATE_ENTER@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_4
; %bb.3:
Lloh3:
	adrp	x8, _SMU_MSG_EnterBaco@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SMU_MSG_EnterBaco@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _BACO_SEQ_BACO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BACO_SEQ_BACO@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_smu_send_smc_msg_with_param
	mov	x22, x0
	cbnz	w0, LBB0_6
	b	LBB0_5
LBB0_4:
Lloh9:
	adrp	x8, _SMU_MSG_ExitBaco@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SMU_MSG_ExitBaco@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_smu_send_smc_msg
	mov	x22, x0
	cbnz	w0, LBB0_6
LBB0_5:
	str	w19, [x20]
LBB0_6:
	mov	x0, x21
	bl	_mutex_unlock
LBB0_7:
	mov	x0, x22
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_SMU_BACO_STATE_ENTER,4,2       ; @SMU_BACO_STATE_ENTER
	.comm	_SMU_MSG_EnterBaco,4,2          ; @SMU_MSG_EnterBaco
	.comm	_BACO_SEQ_BACO,4,2              ; @BACO_SEQ_BACO
	.comm	_SMU_MSG_ExitBaco,4,2           ; @SMU_MSG_ExitBaco
	.no_dead_strip	_smu_v11_0_baco_set_state
.subsections_via_symbols
