#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 INFINITY;
double NAN;
double fsqrt(double);
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("sqrt("
         "0.0"
         ")=%f\n",
         fsqrt(0.0));
  printf("sqrt("
         "1.0"
         ")=%f\n",
         fsqrt(1.0));
  printf("sqrt("
         "2.0"
         ")=%f\n",
         fsqrt(2.0));
  printf("sqrt("
         "3.0"
         ")=%f\n",
         fsqrt(3.0));
  printf("sqrt("
         "4.0"
         ")=%f\n",
         fsqrt(4.0));
  printf("sqrt("
         "100.0"
         ")=%f\n",
         fsqrt(100.0));
  printf("sqrt("
         "-1.0"
         ")=%f\n",
         fsqrt(-1.0));
  printf("sqrt("
         "NAN"
         ")=%f\n",
         fsqrt(NAN));
  printf("sqrt("
         "INFINITY"
         ")=%f\n",
         fsqrt(INFINITY));
  printf("sqrt("
         "-INFINITY"
         ")=%f\n",
         fsqrt(-INFINITY));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
call   1040 <fsqrt@plt>
lea    0xef2(%rip),%rdi
call   1030 <printf@plt>
movsd  0xedd(%rip),%xmm0
call   1040 <fsqrt@plt>
lea    0xee7(%rip),%rdi
call   1030 <printf@plt>
movsd  0xebc(%rip),%xmm0
call   1040 <fsqrt@plt>
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe9b(%rip),%xmm0
call   1040 <fsqrt@plt>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe7a(%rip),%xmm0
call   1040 <fsqrt@plt>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe59(%rip),%xmm0
call   1040 <fsqrt@plt>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe38(%rip),%xmm0
call   1040 <fsqrt@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e18(%rip),%rax
movsd  (%rax),%xmm0
call   1040 <fsqrt@plt>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2de4(%rip),%rax
movsd  (%rax),%xmm0
call   1040 <fsqrt@plt>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    0x2dc8(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1040 <fsqrt@plt>
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xorps  %xmm0,%xmm0
call   1040 <fsqrt@plt>
lea    0xf10(%rip),%rdi
call   1030 <printf@plt>
movsd  0xec3(%rip),%xmm0
call   1040 <fsqrt@plt>
lea    0xf05(%rip),%rdi
call   1030 <printf@plt>
movsd  0xeb2(%rip),%xmm0
call   1040 <fsqrt@plt>
lea    0xefa(%rip),%rdi
call   1030 <printf@plt>
movsd  0xea1(%rip),%xmm0
call   1040 <fsqrt@plt>
lea    0xeef(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe90(%rip),%xmm0
call   1040 <fsqrt@plt>
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe7f(%rip),%xmm0
call   1040 <fsqrt@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe6e(%rip),%xmm0
call   1040 <fsqrt@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e26(%rip),%rax
movsd  (%rax),%xmm0
call   1040 <fsqrt@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2df2(%rip),%rbx
movsd  (%rbx),%xmm0
call   1040 <fsqrt@plt>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movsd  (%rbx),%xmm0
xorps  0xe22(%rip),%xmm0
call   1040 <fsqrt@plt>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"sqrt(0.0)=%f\0A\00"
@.str.1 = [14 x i8] c"sqrt(1.0)=%f\0A\00"
@.str.2 = [14 x i8] c"sqrt(2.0)=%f\0A\00"
@.str.3 = [14 x i8] c"sqrt(3.0)=%f\0A\00"
@.str.4 = [14 x i8] c"sqrt(4.0)=%f\0A\00"
@.str.5 = [16 x i8] c"sqrt(100.0)=%f\0A\00"
@.str.6 = [15 x i8] c"sqrt(-1.0)=%f\0A\00"
@.str.7 = [14 x i8] c"sqrt(NAN)=%f\0A\00"
@NAN = global double 0.000000e+00
@.str.8 = [19 x i8] c"sqrt(INFINITY)=%f\0A\00"
@INFINITY = global double 0.000000e+00
@.str.9 = [20 x i8] c"sqrt(-INFINITY)=%f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @fsqrt(double 0.000000e+00)
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call double @fsqrt(double 1.000000e+00)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = call double @fsqrt(double 2.000000e+00)
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %6)
%8 = call double @fsqrt(double 3.000000e+00)
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), double %8)
%10 = call double @fsqrt(double 4.000000e+00)
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double %10)
%12 = call double @fsqrt(double 1.000000e+02)
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), double %12)
%14 = call double @fsqrt(double -1.000000e+00)
%15 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), double %14)
%16 = load double, double* @NAN
%17 = call double @fsqrt(double %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), double %17)
%19 = load double, double* @INFINITY
%20 = call double @fsqrt(double %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), double %20)
%22 = load double, double* @INFINITY
%23 = fneg double %22
%24 = call double @fsqrt(double %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0), double %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"sqrt(0.0)=%f\0A\00"
@.str.1 = [14 x i8] c"sqrt(1.0)=%f\0A\00"
@.str.2 = [14 x i8] c"sqrt(2.0)=%f\0A\00"
@.str.3 = [14 x i8] c"sqrt(3.0)=%f\0A\00"
@.str.4 = [14 x i8] c"sqrt(4.0)=%f\0A\00"
@.str.5 = [16 x i8] c"sqrt(100.0)=%f\0A\00"
@.str.6 = [15 x i8] c"sqrt(-1.0)=%f\0A\00"
@.str.7 = [14 x i8] c"sqrt(NAN)=%f\0A\00"
@NAN = global double 0.000000e+00
@.str.8 = [19 x i8] c"sqrt(INFINITY)=%f\0A\00"
@INFINITY = global double 0.000000e+00
@.str.9 = [20 x i8] c"sqrt(-INFINITY)=%f\0A\00"
define i32 @main() {
%1 = tail call double @fsqrt(double 0.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call double @fsqrt(double 1.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = tail call double @fsqrt(double 2.000000e+00)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %5)
%7 = tail call double @fsqrt(double 3.000000e+00)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), double %7)
%9 = tail call double @fsqrt(double 4.000000e+00)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double %9)
%11 = tail call double @fsqrt(double 1.000000e+02)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), double %11)
%13 = tail call double @fsqrt(double -1.000000e+00)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), double %13)
%15 = load double, double* @NAN
%16 = tail call double @fsqrt(double %15)
%17 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), double %16)
%18 = load double, double* @INFINITY
%19 = tail call double @fsqrt(double %18)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), double %19)
%21 = load double, double* @INFINITY
%22 = fneg double %21
%23 = tail call double @fsqrt(double %22)
%24 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0), double %23)
ret i32 0
}