#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 main() {
  double ipi, valor1, valor2, valorFinal, quantidade1, quantidade2;
  int codigo1, codigo2;
  scanf("%lf", &ipi);
  scanf("%d", &codigo1);
  scanf("%lf", &valor1);
  scanf("%lf", &quantidade1);
  scanf("%d", &codigo2);
  scanf("%lf", &valor2);
  scanf("%lf", &quantidade2);
  ipi = ipi / 100.0 + 1.0;
  valorFinal = valor1 * quantidade1 + valor2 * quantidade2;
  valorFinal = valorFinal * ipi;
  printf("O VALOR TOTAL A SER PAGO = %0.2f\n", valorFinal);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xecc(%rip),%rdi
lea    -0x3c(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb6(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea4(%rip),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe96(%rip),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe80(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe6e(%rip),%rdi
lea    -0x38(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xe4e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe3a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xe0c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xee2(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xed0(%rip),%r14
lea    0x34(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x30(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm1
divsd  0xe54(%rip),%xmm1
addsd  0xe54(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x28(%rsp),%xmm0
movsd  0x20(%rsp),%xmm2
mulsd  0x10(%rsp),%xmm2
mulsd  0x18(%rsp),%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
lea    0xe36(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [34 x i8] c"O VALOR TOTAL A SER PAGO = %0.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %6)
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %7)
%17 = load double, double* %2
%18 = fdiv double %17, 1.000000e+02
%19 = fadd double %18, 1.000000e+00
store double %19, double* %2
%20 = load double, double* %3
%21 = load double, double* %6
%22 = load double, double* %4
%23 = load double, double* %7
%24 = fmul double %22, %23
%25 = call double @llvm.fmuladd.f64(double %20, double %21, double %24)
store double %25, double* %5
%26 = load double, double* %5
%27 = load double, double* %2
%28 = fmul double %26, %27
store double %28, double* %5
%29 = load double, double* %5
%30 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [34 x i8] c"O VALOR TOTAL A SER PAGO = %0.2f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i32
%7 = alloca i32
%8 = bitcast double* %1 to i8*
%9 = bitcast double* %2 to i8*
%10 = bitcast double* %3 to i8*
%11 = bitcast double* %4 to i8*
%12 = bitcast double* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = bitcast i32* %7 to i8*
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %5)
%22 = load double, double* %1
%23 = fdiv double %22, 1.000000e+02
%24 = fadd double %23, 1.000000e+00
store double %24, double* %1
%25 = load double, double* %2
%26 = load double, double* %4
%27 = load double, double* %3
%28 = load double, double* %5
%29 = fmul double %27, %28
%30 = call double @llvm.fmuladd.f64(double %25, double %26, double %29)
%31 = fmul double %24, %30
%32 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double %31)
ret i32 0
}