	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vega20_send_msg_to_smc
_vega20_send_msg_to_smc:                ## @vega20_send_msg_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	callq	_vega20_wait_for_response
	movq	_MP1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_mmMP1_SMN_C2PMSG_90@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	callq	_WREG32_SOC15
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_vega20_send_msg_to_smc_without_waiting
	movq	%rbx, %rdi
	callq	_vega20_wait_for_response
	movl	%eax, %ebx
	movq	_PPSMC_Result_OK@GOTPCREL(%rip), %r12
	cmpl	(%r12), %eax
	jne	LBB0_2
## %bb.1:
	movl	%ebx, %ecx
	jmp	LBB0_3
LBB0_2:
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	movl	%ebx, %edx
	callq	_pr_err
	movl	(%r12), %ecx
LBB0_3:
	movq	_EIO@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	subl	(%rdx), %eax
	cmpl	%ecx, %ebx
	cmovel	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MP1,4,2                        ## @MP1
	.comm	_mmMP1_SMN_C2PMSG_90,4,2        ## @mmMP1_SMN_C2PMSG_90
	.comm	_PPSMC_Result_OK,4,2            ## @PPSMC_Result_OK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to send message 0x%x, response 0x%x\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_vega20_send_msg_to_smc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vega20_send_msg_to_smc
_vega20_send_msg_to_smc:                ; @vega20_send_msg_to_smc
	.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	_vega20_wait_for_response
Lloh0:
	adrp	x8, _MP1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MP1@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _mmMP1_SMN_C2PMSG_90@GOTPAGE
Lloh4:
	ldr	x8, [x8, _mmMP1_SMN_C2PMSG_90@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	w1, #0
	mov	w3, #0
	bl	_WREG32_SOC15
	mov	x0, x20
	mov	x1, x19
	bl	_vega20_send_msg_to_smc_without_waiting
	mov	x0, x20
	bl	_vega20_wait_for_response
	mov	x20, x0
Lloh6:
	adrp	x21, _PPSMC_Result_OK@GOTPAGE
Lloh7:
	ldr	x21, [x21, _PPSMC_Result_OK@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w0, w8
	b.ne	LBB0_2
; %bb.1:
	mov	x8, x20
	b	LBB0_3
LBB0_2:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	mov	x2, x20
	bl	_pr_err
	ldr	w8, [x21]
LBB0_3:
Lloh10:
	adrp	x9, _EIO@GOTPAGE
Lloh11:
	ldr	x9, [x9, _EIO@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	cmp	w20, w8
	csneg	w0, wzr, w9, eq
	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	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_MP1,4,2                        ; @MP1
	.comm	_mmMP1_SMN_C2PMSG_90,4,2        ; @mmMP1_SMN_C2PMSG_90
	.comm	_PPSMC_Result_OK,4,2            ; @PPSMC_Result_OK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to send message 0x%x, response 0x%x\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_vega20_send_msg_to_smc
.subsections_via_symbols
