#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, float);
int /*<<< orphan*/ printf(char *, float, double);
int main() {
  int x;
  float ex;
  ex = -1.0;
  for (x = 0; x < 10; x++) {
    printf("2 to the %.1f power is %.2f\n", ex, pow(2, ex));
    ex += 0.2;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11a6 <main+0x86>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe7d(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1143 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movss  0xed7(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
lea    0xeeb(%rip),%rbx
mov    %rbx,%rdi
movss  0xeb8(%rip),%xmm0
call   1030 <printf@plt>
movss  0xeaf(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movss  0xe97(%rip),%xmm0
call   1030 <printf@plt>
movss  0xe8e(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movss  0xe76(%rip),%xmm0
call   1030 <printf@plt>
movss  0xe6d(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movss  0xe55(%rip),%xmm0
call   1030 <printf@plt>
movss  0xe4c(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movss  0xe34(%rip),%xmm0
call   1030 <printf@plt>
movss  0xe2b(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movss  0xe13(%rip),%xmm0
call   1030 <printf@plt>
movss  0xe0a(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movss  0xdf2(%rip),%xmm0
call   1030 <printf@plt>
movss  0xde9(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movss  0xdd1(%rip),%xmm0
call   1030 <printf@plt>
movss  0xdc8(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movss  0xdb0(%rip),%xmm0
call   1030 <printf@plt>
movss  0xda7(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movss  0xd8f(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"2 to the %.1f power is %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store float -1.000000e+00, float* %3
store i32 0, i32* %2
br label %4
4: ; preds = %16, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = load float, float* %3
%9 = load float, float* %3
%10 = call double @pow(i32 2, float %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float %8, double %10)
%12 = load float, float* %3
%13 = fpext float %12 to double
%14 = fadd double %13, 2.000000e-01
%15 = fptrunc double %14 to float
store float %15, float* %3
br label %16
16: ; preds = %7
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %4
19: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"2 to the %.1f power is %.2f\0A\00"
define i32 @main() {
%1 = tail call double @pow(i32 2, float -1.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float -1.000000e+00, double %1)
%3 = tail call double @pow(i32 2, float 0xBFE99999A0000000)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float 0xBFE99999A0000000, double %3)
%5 = tail call double @pow(i32 2, float 0xBFE3333340000000)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float 0xBFE3333340000000, double %5)
%7 = tail call double @pow(i32 2, float 0xBFD99999C0000000)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float 0xBFD99999C0000000, double %7)
%9 = tail call double @pow(i32 2, float 0xBFC99999E0000000)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float 0xBFC99999E0000000, double %9)
%11 = tail call double @pow(i32 2, float 0xBE619999A0000000)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float 0xBE619999A0000000, double %11)
%13 = tail call double @pow(i32 2, float 0x3FC9999960000000)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float 0x3FC9999960000000, double %13)
%15 = tail call double @pow(i32 2, float 0x3FD9999980000000)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float 0x3FD9999980000000, double %15)
%17 = tail call double @pow(i32 2, float 0x3FE3333320000000)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float 0x3FE3333320000000, double %17)
%19 = tail call double @pow(i32 2, float 0x3FE9999980000000)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float 0x3FE9999980000000, double %19)
ret i32 0
}