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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee1(%rip),%xmm0
movsd  0xec9(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
movsd  0xeb8(%rip),%xmm0
movsd  0xea8(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe87(%rip),%xmm0
movsd  0xe87(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xec1(%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    0xee3(%rip),%rdi
call   1030 <printf@plt>
movsd  0xec6(%rip),%xmm0
movsd  0xeb6(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
movsd  0xead(%rip),%xmm0
movsd  0xe95(%rip),%xmm1
call   1040 <squareRoot@plt>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
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 1.440000e+02, double 1.000000e-05)
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = call double @squareRoot(double 1.750000e+01, double 1.000000e-05)
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double %6)
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 1.440000e+02, double 1.000000e-05)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = tail call double @squareRoot(double 1.750000e+01, double 1.000000e-05)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double %5)
ret i32 0
}