#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 */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, int *, int *, double *);
int main(void) {
  int CP, NP, Cp, Np;
  double V, v, T, t, VT;
  scanf("%d %d %lf", &CP, &NP, &V);
  scanf("%d %d %lf", &Cp, &Np, &v);
  T = (NP * V);
  t = (Np * v);
  VT = T + t;
  printf("VALOR A PAGAR: R$ %0.2lf\n", VT);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <scanf@plt>
lea    0xeb2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1040 <scanf@plt>
cvtsi2sdl -0xc(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rbx
lea    0x1c(%rsp),%rsi
lea    0x4(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rsp,%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
call   1040 <scanf@plt>
cvtsi2sdl 0x4(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
cvtsi2sdl (%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  %xmm1,%xmm0
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%d %d %lf\00"
@.str.1 = [26 x i8] c"VALOR A PAGAR: R$ %0.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store i32 0, i32* %1
%11 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, double* %6)
%12 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %4, i32* %5, double* %7)
%13 = load i32, i32* %3
%14 = sitofp i32 %13 to double
%15 = load double, double* %6
%16 = fmul double %14, %15
store double %16, double* %8
%17 = load i32, i32* %5
%18 = sitofp i32 %17 to double
%19 = load double, double* %7
%20 = fmul double %18, %19
store double %20, double* %9
%21 = load double, double* %8
%22 = load double, double* %9
%23 = fadd double %21, %22
store double %23, double* %10
%24 = load double, double* %10
%25 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), double %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %lf\00"
@.str.1 = [26 x i8] c"VALOR A PAGAR: R$ %0.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = bitcast i32* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast double* %5 to i8*
%12 = bitcast double* %6 to i8*
%13 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, double* %5)
%14 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, double* %6)
%15 = load i32, i32* %2
%16 = sitofp i32 %15 to double
%17 = load double, double* %5
%18 = fmul double %17, %16
%19 = load i32, i32* %4
%20 = sitofp i32 %19 to double
%21 = load double, double* %6
%22 = fmul double %21, %20
%23 = fadd double %18, %22
%24 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), double %23)
ret i32 0
}