	.file	"extr_rv770_smc.c_rv770_send_msg_to_smc.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	rv770_send_msg_to_smc
	.type	rv770_send_msg_to_smc, @function
rv770_send_msg_to_smc:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	rv770_is_smc_running@PLT
	test	eax, eax
	jne	.L2
	mov	rax, QWORD PTR PPSMC_Result_Failed[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	r13d, DWORD PTR HOST_SMC_MSG_MASK[rip]
	mov	edi, r12d
	call	HOST_SMC_MSG@PLT
	mov	edi, DWORD PTR SMC_MSG[rip]
	not	r13d
	mov	esi, eax
	mov	edx, r13d
	call	WREG32_P@PLT
	mov	eax, DWORD PTR 0[rbp]
	test	eax, eax
	jle	.L4
	xor	ebx, ebx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L9:
	mov	edi, 1
	add	ebx, 1
	call	udelay@PLT
	cmp	DWORD PTR 0[rbp], ebx
	jle	.L4
.L5:
	mov	edi, DWORD PTR SMC_MSG[rip]
	call	RREG32@PLT
	mov	ecx, DWORD PTR HOST_SMC_RESP_SHIFT[rip]
	and	eax, DWORD PTR HOST_SMC_RESP_MASK[rip]
	sar	eax, cl
	test	eax, eax
	je	.L9
.L4:
	mov	edi, DWORD PTR SMC_MSG[rip]
	call	RREG32@PLT
	mov	ecx, DWORD PTR HOST_SMC_RESP_SHIFT[rip]
	and	eax, DWORD PTR HOST_SMC_RESP_MASK[rip]
	add	rsp, 8
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	sar	eax, cl
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	cdqe
	ret
	.cfi_endproc
.LFE0:
	.size	rv770_send_msg_to_smc, .-rv770_send_msg_to_smc
	.comm	SMC_MSG,4,4
	.comm	PPSMC_Result_Failed,8,8
	.comm	HOST_SMC_RESP_SHIFT,4,4
	.comm	HOST_SMC_RESP_MASK,4,4
	.comm	HOST_SMC_MSG_MASK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_rv770_smc.c_rv770_send_msg_to_smc.c"
	.text
	.align	2
	.global	rv770_send_msg_to_smc
	.syntax unified
	.arm
	.fpu softvfp
	.type	rv770_send_msg_to_smc, %function
rv770_send_msg_to_smc:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r1
	mov	r5, r0
	bl	rv770_is_smc_running
	cmp	r0, #0
	bne	.L2
	ldr	r3, .L13
	ldr	r0, [r3]
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	ldr	r6, .L13+4
	mov	r0, r4
	ldr	r4, [r6]
	bl	HOST_SMC_MSG
	ldr	r3, .L13+8
	mov	r1, r0
	ldr	r2, [r3]
	mov	r0, r4
	mvn	r2, r2
	bl	WREG32_P
	ldr	r3, [r5]
	cmp	r3, #0
	ble	.L11
	mov	r4, #0
	ldr	r8, .L13+12
	ldr	r7, .L13+16
	b	.L5
.L12:
	mov	r0, #1
	bl	udelay
	ldr	r3, [r5]
	cmp	r3, r4
	ble	.L4
.L5:
	ldr	r0, [r6]
	bl	RREG32
	ldr	r2, [r8]
	ldr	r3, [r7]
	and	r0, r0, r2
	asrs	r3, r0, r3
	add	r4, r4, #1
	beq	.L12
.L4:
	ldr	r0, [r6]
	bl	RREG32
	ldr	r2, [r8]
	ldr	r3, [r7]
	and	r0, r0, r2
	asr	r0, r0, r3
	pop	{r4, r5, r6, r7, r8, pc}
.L11:
	ldr	r8, .L13+12
	ldr	r7, .L13+16
	b	.L4
.L14:
	.align	2
.L13:
	.word	PPSMC_Result_Failed
	.word	SMC_MSG
	.word	HOST_SMC_MSG_MASK
	.word	HOST_SMC_RESP_MASK
	.word	HOST_SMC_RESP_SHIFT
	.size	rv770_send_msg_to_smc, .-rv770_send_msg_to_smc
	.comm	SMC_MSG,4,4
	.comm	PPSMC_Result_Failed,4,4
	.comm	HOST_SMC_RESP_SHIFT,4,4
	.comm	HOST_SMC_RESP_MASK,4,4
	.comm	HOST_SMC_MSG_MASK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
