#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 *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, double *);
int main() {
  int a1, a2, b1, b2;
  double p1, p2;
  scanf("%d %d %lf", &a1, &b1, &p1);
  scanf("%d %d %lf", &a2, &b2, &p2);
  printf("VALOR A PAGAR: R$ %.2lf\n", b1 * p1 + b2 * p2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <scanf@plt>
lea    0xeb2(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1040 <scanf@plt>
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
cvtsi2sdl -0x14(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%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),%xmm0
cvtsi2sdl (%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xe8c(%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 = [25 x i8] c"VALOR A PAGAR: R$ %.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
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %4, double* %6)
%9 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %5, double* %7)
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = load double, double* %6
%13 = load i32, i32* %5
%14 = sitofp i32 %13 to double
%15 = load double, double* %7
%16 = fmul double %14, %15
%17 = call double @llvm.fmuladd.f64(double %11, double %12, double %16)
%18 = fptosi double %17 to i32
%19 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %lf\00"
@.str.1 = [25 x i8] c"VALOR A PAGAR: R$ %.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* %3, double* %5)
%14 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %4, double* %6)
%15 = load i32, i32* %3
%16 = sitofp i32 %15 to double
%17 = load double, double* %5
%18 = load i32, i32* %4
%19 = sitofp i32 %18 to double
%20 = load double, double* %6
%21 = fmul double %20, %19
%22 = call double @llvm.fmuladd.f64(double %16, double %17, double %21)
%23 = fptosi double %22 to i32
%24 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %23)
ret i32 0
}