#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 r5, r3, r2, r1, r0, p, p1, p2, p3, p4, p5;
  p = 1000;
  r0 = 0.0072;
  r1 = 0.0414;
  r2 = 0.0468;
  r3 = 0.054;
  r5 = 0.0585;
  p1 = p * ((1 + r5) * 5);
  p2 = p * (1 + 2 * r2) * (1 + 3 * r3);
  p3 = p * (1 + 3 * r3) * (1 + 2 * r2);
  p4 = p * pow(1 + r1, 5);
  p5 = p * pow(1 + r0 / 4, 4 * 5);
  printf("p1 = %f\n", p1);
  printf("p2 = %f\n", p2);
  printf("p3 = %f\n", p3);
  printf("p4 = %f\n", p4);
  printf("p5 = %f\n", p5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  0xf18(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xf03(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeee(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec4(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeaf(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xe7d(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
movsd  0xe88(%rip),%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xe4d(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe48(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe2c(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe1d(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe01(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xde8(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xdc9(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%edi
mov    $0x5,%esi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  0xd96(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xd82(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
mov    $0x14,%esi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
lea    0xda3(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x40(%rbp),%xmm0
lea    0xd9b(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x48(%rbp),%xmm0
lea    0xd93(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x50(%rbp),%xmm0
lea    0xd8b(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x58(%rbp),%xmm0
lea    0xd83(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    $0x1,%edi
mov    $0x5,%esi
call   1040 <pow@plt>
mulsd  0xec5(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    $0x1,%edi
mov    $0x14,%esi
call   1040 <pow@plt>
mulsd  0xea8(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0xeb3(%rip),%rdi
movsd  0xe9b(%rip),%xmm0
call   1030 <printf@plt>
lea    0xea8(%rip),%rdi
movsd  0xe8f(%rip),%xmm0
call   1030 <printf@plt>
lea    0xe9d(%rip),%rdi
movsd  0xe7b(%rip),%xmm0
call   1030 <printf@plt>
lea    0xe92(%rip),%rdi
movsd  0x10(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xe89(%rip),%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"p1 = %f\0A\00"
@.str.1 = [9 x i8] c"p2 = %f\0A\00"
@.str.2 = [9 x i8] c"p3 = %f\0A\00"
@.str.3 = [9 x i8] c"p4 = %f\0A\00"
@.str.4 = [9 x i8] c"p5 = %f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double 1.000000e+03, double* %6
store double 7.200000e-03, double* %5
store double 4.140000e-02, double* %4
store double 4.680000e-02, double* %3
store double 5.400000e-02, double* %2
store double 5.850000e-02, double* %1
%12 = load double, double* %6
%13 = load double, double* %1
%14 = fadd double 1.000000e+00, %13
%15 = fmul double %14, 5.000000e+00
%16 = fmul double %12, %15
store double %16, double* %7
%17 = load double, double* %6
%18 = load double, double* %3
%19 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %18, double 1.000000e+00)
%20 = fmul double %17, %19
%21 = load double, double* %2
%22 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %21, double 1.000000e+00)
%23 = fmul double %20, %22
store double %23, double* %8
%24 = load double, double* %6
%25 = load double, double* %2
%26 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %25, double 1.000000e+00)
%27 = fmul double %24, %26
%28 = load double, double* %3
%29 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %28, double 1.000000e+00)
%30 = fmul double %27, %29
store double %30, double* %9
%31 = load double, double* %6
%32 = load double, double* %4
%33 = fadd double 1.000000e+00, %32
%34 = fptosi double %33 to i32
%35 = call double @pow(i32 %34, i32 5)
%36 = fmul double %31, %35
store double %36, double* %10
%37 = load double, double* %6
%38 = load double, double* %5
%39 = fdiv double %38, 4.000000e+00
%40 = fadd double 1.000000e+00, %39
%41 = fptosi double %40 to i32
%42 = call double @pow(i32 %41, i32 20)
%43 = fmul double %37, %42
store double %43, double* %11
%44 = load double, double* %7
%45 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %44)
%46 = load double, double* %8
%47 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %46)
%48 = load double, double* %9
%49 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %48)
%50 = load double, double* %10
%51 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %50)
%52 = load double, double* %11
%53 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), double %52)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"p1 = %f\0A\00"
@.str.1 = [9 x i8] c"p2 = %f\0A\00"
@.str.2 = [9 x i8] c"p3 = %f\0A\00"
@.str.3 = [9 x i8] c"p4 = %f\0A\00"
@.str.4 = [9 x i8] c"p5 = %f\0A\00"
define i32 @main() {
%1 = tail call double @pow(i32 1, i32 5)
%2 = fmul double %1, 1.000000e+03
%3 = tail call double @pow(i32 1, i32 20)
%4 = fmul double %3, 1.000000e+03
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double 5.292500e+03)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double 0x4093DB0D844D013A)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double 0x4093DB0D844D013A)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %2)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), double %4)
ret i32 0
}