#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(2.0) = %f\n", squareRoot(2.0, 0.00001));
  printf("squareRoot(2.0) = %f\n", squareRoot(2.0, 0.0001));
  printf("squareRoot(2.0) = %f\n", squareRoot(2.0, 0.001));
  printf("squareRoot(2.0) = %f\n", squareRoot(2.0, 0.01));
  printf("squareRoot(2.0) = %f\n", squareRoot(2.0, 0.1));
  printf("squareRoot(144.0) = %f\n", squareRoot(144.0, 0.1));
  printf("squareRoot(17.5) = %f\n", squareRoot(17.5, 0.1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee1(%rip),%xmm0
movsd  0xef9(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xef5(%rip),%rdi
call   1030 <printf@plt>
movsd  0xec0(%rip),%xmm0
movsd  0xed0(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe9f(%rip),%xmm0
movsd  0xea7(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe7e(%rip),%xmm0
movsd  0xe7e(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe5d(%rip),%xmm0
movsd  0xe45(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe34(%rip),%xmm0
movsd  0xe24(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe03(%rip),%xmm0
movsd  0xe03(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xf03(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xec3(%rip),%xmm1
movsd  0xeab(%rip),%xmm0
call   1040 <squareRoot@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xeae(%rip),%xmm1
movsd  0xe8e(%rip),%xmm0
call   1040 <squareRoot@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xe99(%rip),%xmm1
movsd  0xe71(%rip),%xmm0
call   1040 <squareRoot@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xe84(%rip),%xmm1
movsd  0xe54(%rip),%xmm0
call   1040 <squareRoot@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xe6f(%rip),%xmm0
movsd  0xe5f(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe56(%rip),%xmm0
movsd  0xe3e(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"squareRoot(2.0) = %f\0A\00"
@.str.1 = [24 x i8] c"squareRoot(144.0) = %f\0A\00"
@.str.2 = [23 x i8] c"squareRoot(17.5) = %f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @squareRoot(double 2.000000e+00, double 1.000000e-05)
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call double @squareRoot(double 2.000000e+00, double 1.000000e-04)
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %4)
%6 = call double @squareRoot(double 2.000000e+00, double 1.000000e-03)
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %6)
%8 = call double @squareRoot(double 2.000000e+00, double 1.000000e-02)
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %8)
%10 = call double @squareRoot(double 2.000000e+00, double 1.000000e-01)
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %10)
%12 = call double @squareRoot(double 1.440000e+02, double 1.000000e-01)
%13 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %12)
%14 = call double @squareRoot(double 1.750000e+01, double 1.000000e-01)
%15 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"squareRoot(2.0) = %f\0A\00"
@.str.1 = [24 x i8] c"squareRoot(144.0) = %f\0A\00"
@.str.2 = [23 x i8] c"squareRoot(17.5) = %f\0A\00"
define i32 @main() {
%1 = tail call double @squareRoot(double 2.000000e+00, double 1.000000e-05)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call double @squareRoot(double 2.000000e+00, double 1.000000e-04)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %3)
%5 = tail call double @squareRoot(double 2.000000e+00, double 1.000000e-03)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %5)
%7 = tail call double @squareRoot(double 2.000000e+00, double 1.000000e-02)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %7)
%9 = tail call double @squareRoot(double 2.000000e+00, double 1.000000e-01)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %9)
%11 = tail call double @squareRoot(double 1.440000e+02, double 1.000000e-01)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %11)
%13 = tail call double @squareRoot(double 1.750000e+01, double 1.000000e-01)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double %13)
ret i32 0
}