#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 */
float my_sqrt(double);
int /*<<< orphan*/ printf(char *, float);
float sin_sqrt();
int main() {
  float x = my_sqrt(2.0);
  printf("Root of 2.0: %f\n", x);
  x = my_sqrt(5.0);
  printf("Root of 5.0: %f\n", x);
  x = my_sqrt(25.0);
  printf("Root of 25.0: %f\n", x);
  x = sin_sqrt();
  printf("sin function: %f\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
call   1040 <my_sqrt@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe9e(%rip),%xmm0
call   1040 <my_sqrt@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe73(%rip),%xmm0
call   1040 <my_sqrt@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <sin_sqrt@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xec7(%rip),%xmm0
call   1040 <my_sqrt@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
movsd  0xeb6(%rip),%xmm0
call   1040 <my_sqrt@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
movsd  0xea5(%rip),%xmm0
call   1040 <my_sqrt@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <sin_sqrt@plt>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Root of 2.0: %f\0A\00"
@.str.1 = [17 x i8] c"Root of 5.0: %f\0A\00"
@.str.2 = [18 x i8] c"Root of 25.0: %f\0A\00"
@.str.3 = [18 x i8] c"sin function: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call float @my_sqrt(double 2.000000e+00)
store float %3, float* %2
%4 = load float, float* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float %4)
%6 = call float @my_sqrt(double 5.000000e+00)
store float %6, float* %2
%7 = load float, float* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), float %7)
%9 = call float @my_sqrt(double 2.500000e+01)
store float %9, float* %2
%10 = load float, float* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), float %10)
%12 = call float (...) @sin_sqrt()
store float %12, float* %2
%13 = load float, float* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), float %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Root of 2.0: %f\0A\00"
@.str.1 = [17 x i8] c"Root of 5.0: %f\0A\00"
@.str.2 = [18 x i8] c"Root of 25.0: %f\0A\00"
@.str.3 = [18 x i8] c"sin function: %f\0A\00"
define i32 @main() {
%1 = tail call float @my_sqrt(double 2.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float %1)
%3 = tail call float @my_sqrt(double 5.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), float %3)
%5 = tail call float @my_sqrt(double 2.500000e+01)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), float %5)
%7 = tail call float (...) @sin_sqrt()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), float %7)
ret i32 0
}