#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef float int16_t;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, float);
scalar_t__ scanf(char *, float *, float *, float *);
int main() {
  int16_t a, b;
  float c, s = 0.0;
  while (scanf("%d %d %f", &a, &b, &c) != EOF) {
    s += c * b;
  }
  printf("VALOR A PAGAR: R$ %.2f\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%rax
je     1180 <main+0x60>
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
movss  -0x14(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1137 <main+0x17>
movss  -0x14(%rbp),%xmm0
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
call   1040 <scanf@plt>
mov    0x2e9b(%rip),%r13
xorps  %xmm0,%xmm0
cmp    0x0(%r13),%rax
je     11a2 <main+0x82>
xorps  %xmm0,%xmm0
lea    0xea0(%rip),%r14
lea    0xc(%rsp),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
nopl   (%rax)
movss  (%rsp),%xmm1
mulss  0x4(%rsp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,0x8(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
call   1040 <scanf@plt>
movss  0x8(%rsp),%xmm0
cmp    0x0(%r13),%rax
jne    1170 <main+0x50>
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %f\00"
@EOF = global i64 0
@.str.1 = [24 x i8] c"VALOR A PAGAR: R$ %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %5
br label %6
6: ; preds = %10, %0
%7 = call i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float* %2, float* %3, float* %4)
%8 = load i64, i64* @EOF
%9 = icmp ne i64 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load float, float* %4
%12 = load float, float* %3
%13 = load float, float* %5
%14 = call float @llvm.fmuladd.f32(float %11, float %12, float %13)
store float %14, float* %5
br label %6
15: ; preds = %6
%16 = load float, float* %5
%17 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), float %16)
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %f\00"
@EOF = global i64 0
@.str.1 = [24 x i8] c"VALOR A PAGAR: R$ %.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = call i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float* %1, float* %2, float* %3)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %18, label %10
10: ; preds = %0, %10
%11 = phi float [ %14, %10 ], [ 0.000000e+00, %0 ]
%12 = load float, float* %3
%13 = load float, float* %2
%14 = call float @llvm.fmuladd.f32(float %12, float %13, float %11)
%15 = call i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float* %1, float* %2, float* %3)
%16 = load i64, i64* @EOF
%17 = icmp eq i64 %15, %16
br i1 %17, label %18, label %10
18: ; preds = %10, %0
%19 = phi float [ 0.000000e+00, %0 ], [ %14, %10 ]
%20 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), float %19)
ret i32 0
}