#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 sqrt_v(int, float);
int main(void) {
  printf("sqrt (50) = %f\n", sqrt_v(50, 0.1f));
  printf("sqrt (50) = %f\n", sqrt_v(50, 0.01f));
  printf("sqrt (50) = %f\n", sqrt_v(50, 0.001f));
  printf("sqrt (50) = %f\n", sqrt_v(50, 0.0001f));
  printf("sqrt (50) = %f\n", sqrt_v(50, 0.00001f));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x32,%edi
movss  0xed4(%rip),%xmm0
call   1040 <sqrt_v@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x32,%edi
movss  0xeb2(%rip),%xmm0
call   1040 <sqrt_v@plt>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    $0x32,%edi
movss  0xe90(%rip),%xmm0
call   1040 <sqrt_v@plt>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    $0x32,%edi
movss  0xe6e(%rip),%xmm0
call   1040 <sqrt_v@plt>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
mov    $0x32,%edi
movss  0xe4c(%rip),%xmm0
call   1040 <sqrt_v@plt>
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movss  0xed7(%rip),%xmm0
mov    $0x32,%edi
call   1040 <sqrt_v@plt>
lea    0xeda(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xeba(%rip),%xmm0
mov    $0x32,%edi
call   1040 <sqrt_v@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xea4(%rip),%xmm0
mov    $0x32,%edi
call   1040 <sqrt_v@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xe8e(%rip),%xmm0
mov    $0x32,%edi
call   1040 <sqrt_v@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xe78(%rip),%xmm0
mov    $0x32,%edi
call   1040 <sqrt_v@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"sqrt (50) = %f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @sqrt_v(i32 50, float 0x3FB99999A0000000)
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call double @sqrt_v(i32 50, float 0x3F847AE140000000)
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %4)
%6 = call double @sqrt_v(i32 50, float 0x3F50624DE0000000)
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %6)
%8 = call double @sqrt_v(i32 50, float 0x3F1A36E2E0000000)
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %8)
%10 = call double @sqrt_v(i32 50, float 0x3EE4F8B580000000)
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"sqrt (50) = %f\0A\00"
define i32 @main() {
%1 = tail call double @sqrt_v(i32 50, float 0x3FB99999A0000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call double @sqrt_v(i32 50, float 0x3F847AE140000000)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %3)
%5 = tail call double @sqrt_v(i32 50, float 0x3F50624DE0000000)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %5)
%7 = tail call double @sqrt_v(i32 50, float 0x3F1A36E2E0000000)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %7)
%9 = tail call double @sqrt_v(i32 50, float 0x3EE4F8B580000000)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %9)
ret i32 0
}