#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 */
double pow(int, int);
int /*<<< orphan*/ printf(char *, double);
int main() {
  double res1 = (1000.0) * (1 + 5 * 0.0585) - 1000;
  double res2 = 1000.0 * (1 + 2 * 0.0468) * (1 + 3 * 0.054) - 1000;
  double res3 = 1000.0 * (1 + 3 * 0.054) * (1 + 2 * 0.0468) - 1000;
  double res4 = 1000.0 * pow(1 + 0.0414, 5) - 1000;
  double res5 = 1000.0 * pow(1 + 0.0072 / 4, 20) - 1000;
  printf("%lf\n", res1);
  printf("%lf\n", res2);
  printf("%lf\n", res3);
  printf("%lf\n", res4);
  printf("%lf\n", res5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xebf(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x1,%edi
mov    $0x5,%esi
call   1040 <pow@plt>
movsd  0xe93(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    $0x1,%edi
mov    $0x14,%esi
call   1040 <pow@plt>
movsd  0xe67(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe63(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xe55(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xe44(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xe33(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xe22(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x5,%esi
call   1040 <pow@plt>
mulsd  0xec4(%rip),%xmm0
addsd  0xec4(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%edi
mov    $0x14,%esi
call   1040 <pow@plt>
mulsd  0xe9f(%rip),%xmm0
addsd  0xe9f(%rip),%xmm0
movsd  %xmm0,(%rsp)
lea    0xeab(%rip),%rbx
movsd  0xe93(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xe8b(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
movsd  0xe78(%rip),%xmm0
call   1030 <printf@plt>
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
mov    %rbx,%rdi
movsd  (%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
store double 2.925000e+02, double* %2
store double 0x4070EC36113404E8, double* %3
store double 0x4070EC36113404E8, double* %4
%7 = call double @pow(i32 1, i32 5)
%8 = call double @llvm.fmuladd.f64(double 1.000000e+03, double %7, double -1.000000e+03)
store double %8, double* %5
%9 = call double @pow(i32 1, i32 20)
%10 = call double @llvm.fmuladd.f64(double 1.000000e+03, double %9, double -1.000000e+03)
store double %10, double* %6
%11 = load double, double* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %11)
%13 = load double, double* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %13)
%15 = load double, double* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %15)
%17 = load double, double* %5
%18 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %17)
%19 = load double, double* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = tail call double @pow(i32 1, i32 5)
%2 = tail call double @llvm.fmuladd.f64(double %1, double 1.000000e+03, double -1.000000e+03)
%3 = tail call double @pow(i32 1, i32 20)
%4 = tail call double @llvm.fmuladd.f64(double %3, double 1.000000e+03, double -1.000000e+03)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double 2.925000e+02)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double 0x4070EC36113404E8)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double 0x4070EC36113404E8)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %2)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}