#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, double);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ system(char *);
void main() {
  double sum = 0.0, p;
  int i;
  i = 0;
  for (i = 0; i <= 100; i++)
    ;
  {
    p = pow(i, 1.0 / 3.0);
    sum = sum + i * i * p;
  }
  printf("SUM is: %f\n", sum);
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jg     116b <main+0x3b>
jmp    115d <main+0x2d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114e <main+0x1e>
mov    -0x14(%rbp),%edi
movsd  0xe8a(%rip),%xmm0
call   1050 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xe5a(%rip),%rdi
call   1040 <printf@plt>
lea    0xe5a(%rip),%rdi
call   1030 <system@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xec7(%rip),%xmm0
mov    $0x65,%edi
call   1050 <pow@plt>
mulsd  0xebd(%rip),%xmm0
xorpd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"SUM is: %f\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define void @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca i32
store double 0.000000e+00, double* %1
store i32 0, i32* %3
store i32 0, i32* %3
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 100
br i1 %6, label %7, label %11
7: ; preds = %4
br label %8
8: ; preds = %7
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %4
11: ; preds = %4
%12 = load i32, i32* %3
%13 = call double @pow(i32 %12, double 0x3FD5555555555555)
store double %13, double* %2
%14 = load double, double* %1
%15 = load i32, i32* %3
%16 = load i32, i32* %3
%17 = mul nsw i32 %15, %16
%18 = sitofp i32 %17 to double
%19 = load double, double* %2
%20 = call double @llvm.fmuladd.f64(double %18, double %19, double %14)
store double %20, double* %1
%21 = load double, double* %1
%22 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %21)
%23 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"SUM is: %f\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define void @main() {
%1 = tail call double @pow(i32 101, double 0x3FD5555555555555)
%2 = tail call double @llvm.fmuladd.f64(double %1, double 1.020100e+04, double 0.000000e+00)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %2)
%4 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}