#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 *, double);
double squareRoot(double, double);
int main(void) {
  printf("squareRoot of 2.0 with epsilon set to 0.1 = %.16f\n",
         squareRoot(2.0, 0.1));
  printf("squareRoot of 2.0 with epsilon set to 0.001 = %.16f\n",
         squareRoot(2.0, 0.001));
  printf("squareRoot of 2.0 with epsilon set to 0.00001 = %.16f\n",
         squareRoot(2.0, 0.00001));
  printf("squareRoot of 2.0 with epsilon set to 0.0000001 = %.16f\n",
         squareRoot(2.0, 0.0000001));
  printf("squareRoot of 2.0 with epsilon set to 0.000000001 = %.16f\n",
         squareRoot(2.0, 0.000000001));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  0xee9(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
movsd  0xea8(%rip),%xmm0
movsd  0xec0(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xef7(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe87(%rip),%xmm0
movsd  0xe97(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xf0b(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe66(%rip),%xmm0
movsd  0xe6e(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xf21(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe45(%rip),%xmm0
movsd  0xe45(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xf39(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xef3(%rip),%rdi
call   1030 <printf@plt>
movsd  0xec6(%rip),%xmm1
movsd  0xeae(%rip),%xmm0
call   1040 <squareRoot@plt>
lea    0xf05(%rip),%rdi
call   1030 <printf@plt>
movsd  0xead(%rip),%xmm1
movsd  0xe8d(%rip),%xmm0
call   1040 <squareRoot@plt>
lea    0xf19(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe94(%rip),%xmm1
movsd  0xe6c(%rip),%xmm0
call   1040 <squareRoot@plt>
lea    0xf2f(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe7b(%rip),%xmm1
movsd  0xe4b(%rip),%xmm0
call   1040 <squareRoot@plt>
lea    0xf47(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"squareRoot of 2.0 with epsilon set to 0.1 = %.16f\0A\00"
@.str.1 = [53 x i8] c"squareRoot of 2.0 with epsilon set to 0.001 = %.16f\0A\00"
@.str.2 = [55 x i8] c"squareRoot of 2.0 with epsilon set to 0.00001 = %.16f\0A\00"
@.str.3 = [57 x i8] c"squareRoot of 2.0 with epsilon set to 0.0000001 = %.16f\0A\00"
@.str.4 = [59 x i8] c"squareRoot of 2.0 with epsilon set to 0.000000001 = %.16f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @squareRoot(double 2.000000e+00, double 1.000000e-01)
%3 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call double @squareRoot(double 2.000000e+00, double 1.000000e-03)
%5 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = call double @squareRoot(double 2.000000e+00, double 1.000000e-05)
%7 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), double %6)
%8 = call double @squareRoot(double 2.000000e+00, double 0x3E7AD7F29ABCAF48)
%9 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0), double %8)
%10 = call double @squareRoot(double 2.000000e+00, double 1.000000e-09)
%11 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [51 x i8] c"squareRoot of 2.0 with epsilon set to 0.1 = %.16f\0A\00"
@.str.1 = [53 x i8] c"squareRoot of 2.0 with epsilon set to 0.001 = %.16f\0A\00"
@.str.2 = [55 x i8] c"squareRoot of 2.0 with epsilon set to 0.00001 = %.16f\0A\00"
@.str.3 = [57 x i8] c"squareRoot of 2.0 with epsilon set to 0.0000001 = %.16f\0A\00"
@.str.4 = [59 x i8] c"squareRoot of 2.0 with epsilon set to 0.000000001 = %.16f\0A\00"
define i32 @main() {
%1 = tail call double @squareRoot(double 2.000000e+00, double 1.000000e-01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call double @squareRoot(double 2.000000e+00, double 1.000000e-03)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = tail call double @squareRoot(double 2.000000e+00, double 1.000000e-05)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), double %5)
%7 = tail call double @squareRoot(double 2.000000e+00, double 0x3E7AD7F29ABCAF48)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0), double %7)
%9 = tail call double @squareRoot(double 2.000000e+00, double 1.000000e-09)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0), double %9)
ret i32 0
}