#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 InvSqrt(float);
int /*<<< orphan*/ printf(char *, float, double);
float sqrt(float);
int main(void) {
  float x = 1.0f;
  int i;
  for (i = 0; i < 20; ++i) {
    printf("%.10f\t%.10f\n", 1.0f / sqrt(x), InvSqrt(x));
    x *= 10.0f;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xeb9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    11b9 <main+0x89>
movss  -0x8(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movss  0xe8e(%rip),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <InvSqrt@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
movss  0xe63(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
movss  0xec5(%rip),%xmm0
mov    $0x14,%ebp
lea    0xec5(%rip),%rbx
jmp    1194 <main+0x64>
nopl   0x0(%rax)
call   1050 <sqrt@plt>
movss  0xea3(%rip),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
movss  (%rsp),%xmm0
call   1040 <InvSqrt@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movss  0x4(%rsp),%xmm0
call   1030 <printf@plt>
movss  (%rsp),%xmm0
mulss  0xe75(%rip),%xmm0
add    $0xffffffff,%ebp
je     11a8 <main+0x78>
ucomiss 0xe6d(%rip),%xmm0
movss  %xmm0,(%rsp)
jb     1150 <main+0x20>
sqrtss %xmm0,%xmm0
jmp    1155 <main+0x25>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"%.10f\09%.10f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %9, %1 ]
%3 = phi float [ 1.000000e+00, %0 ], [ %8, %1 ]
%4 = tail call float @sqrt(float %3)
%5 = fdiv float 1.000000e+00, %4
%6 = tail call double @InvSqrt(float %3)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), float %5, double %6)
%8 = fmul float %3, 1.000000e+01
%9 = add nuw nsw i32 %2, 1
%10 = icmp eq i32 %9, 20
br i1 %10, label %11, label %1
11: ; preds = %1
ret i32 0
}