#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 *, float, double);
double squareRoot(float);
int main(void) {
  float x = 2.0;
  printf("squareRoot(%.1f) = %f\n", x, squareRoot(x));
  x = 144.0;
  printf("squareRoot(%.1f) = %f\n", x, squareRoot(x));
  x = 17.5;
  printf("squareRoot(%.1f) = %f\n", x, squareRoot(x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <squareRoot@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
movss  0xe98(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <squareRoot@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
movss  0xe5f(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <squareRoot@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
lea    0xe43(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movss  0xed7(%rip),%xmm0
call   1040 <squareRoot@plt>
movaps %xmm0,%xmm1
lea    0xed4(%rip),%rbx
mov    %rbx,%rdi
movss  0xebd(%rip),%xmm0
call   1030 <printf@plt>
movss  0xeb4(%rip),%xmm0
call   1040 <squareRoot@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movss  0xea1(%rip),%xmm0
call   1030 <printf@plt>
movss  0xe98(%rip),%xmm0
call   1040 <squareRoot@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movss  0xe85(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"squareRoot(%.1f) = %f\0A\00"
define i32 @main() {
%1 = tail call double @squareRoot(float 2.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float 2.000000e+00, double %1)
%3 = tail call double @squareRoot(float 1.440000e+02)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float 1.440000e+02, double %3)
%5 = tail call double @squareRoot(float 1.750000e+01)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float 1.750000e+01, double %5)
ret i32 0
}