#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 *, float);
main() {
  int a, i;
  float e;
  i = 0;
  a = 0;
  while (i < 100) {
    i++;
    while (a < i) {
      a++;
      a *= a;
    }
    e += 1.0 / a;
  }
  printf("%.11f", e);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1190 <main+0x80>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1164 <main+0x54>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <main+0x30>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xe8f(%rip),%xmm1
divsd  %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    112d <main+0x1d>
movss  -0x10(%rbp),%xmm0
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edx,%edx
movsd  0xee5(%rip),%xmm1
xor    %eax,%eax
jmp    1142 <main+0x32>
nop
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
movapd %xmm1,%xmm3
divsd  %xmm2,%xmm3
cvtss2sd %xmm0,%xmm0
addsd  %xmm3,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    %ecx,%edx
cmp    $0x64,%ecx
je     115c <main+0x4c>
lea    0x1(%rdx),%ecx
cmp    %edx,%eax
jg     1120 <main+0x10>
nopl   0x0(%rax)
add    $0x1,%eax
imul   %eax,%eax
cmp    %edx,%eax
jbe    1150 <main+0x40>
jmp    1120 <main+0x10>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.11f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %2
br label %5
5: ; preds = %21, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %29
8: ; preds = %5
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %11
11: ; preds = %15, %8
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
%18 = load i32, i32* %2
%19 = load i32, i32* %2
%20 = mul nsw i32 %19, %18
store i32 %20, i32* %2
br label %11
21: ; preds = %11
%22 = load i32, i32* %2
%23 = sitofp i32 %22 to double
%24 = fdiv double 1.000000e+00, %23
%25 = load float, float* %4
%26 = fpext float %25 to double
%27 = fadd double %26, %24
%28 = fptrunc double %27 to float
store float %28, float* %4
br label %5
29: ; preds = %5
%30 = load float, float* %4
%31 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.11f\00"
define i32 @main() {
br label %1
1: ; preds = %0, %12
%2 = phi float [ undef, %0 ], [ %18, %12 ]
%3 = phi i32 [ 0, %0 ], [ %5, %12 ]
%4 = phi i32 [ 0, %0 ], [ %13, %12 ]
%5 = add nuw nsw i32 %3, 1
%6 = icmp sgt i32 %4, %3
br i1 %6, label %12, label %7
7: ; preds = %1, %7
%8 = phi i32 [ %10, %7 ], [ %4, %1 ]
%9 = add nsw i32 %8, 1
%10 = mul nsw i32 %9, %9
%11 = icmp ugt i32 %10, %3
br i1 %11, label %12, label %7
12: ; preds = %7, %1
%13 = phi i32 [ %4, %1 ], [ %10, %7 ]
%14 = sitofp i32 %13 to double
%15 = fdiv double 1.000000e+00, %14
%16 = fpext float %2 to double
%17 = fadd double %15, %16
%18 = fptrunc double %17 to float
%19 = icmp eq i32 %5, 100
br i1 %19, label %20, label %1
20: ; preds = %12
%21 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %18)
ret i32 0
}