#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*/ abort();
double convert_it(double);
double sqrt(double);
int main(int argc, char *argv[]) {
  double values[6] = {3.0, 1.95, 2.227, 4.0, 256.0, .0008797};
  unsigned i;
  for (i = 0; i < 6; i++)
    if (convert_it(values[i]) != sqrt(sqrt(values[i])))
      abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
movsd  0xeba(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xea5(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe90(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe7b(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe66(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe51(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x6,-0x44(%rbp)
jae    1222 <main+0xe2>
mov    -0x44(%rbp),%eax
movsd  -0x40(%rbp,%rax,8),%xmm0
call   1050 <convert_it@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0x44(%rbp),%eax
movsd  -0x40(%rbp,%rax,8),%xmm0
call   1060 <sqrt@plt>
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jne    1208 <main+0xc8>
jp     1208 <main+0xc8>
jmp    120f <main+0xcf>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1214 <main+0xd4>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11bb <main+0x7b>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <convert_it@plt>
ucomisd 0xed2(%rip),%xmm0
jne    11c3 <main+0xa3>
jp     11c3 <main+0xa3>
movsd  0xec6(%rip),%xmm0
call   1040 <convert_it@plt>
ucomisd 0xec1(%rip),%xmm0
jne    11c3 <main+0xa3>
jp     11c3 <main+0xa3>
movsd  0xebd(%rip),%xmm0
call   1040 <convert_it@plt>
ucomisd 0xeb8(%rip),%xmm0
jne    11c3 <main+0xa3>
jp     11c3 <main+0xa3>
movsd  0xeb4(%rip),%xmm0
call   1040 <convert_it@plt>
ucomisd 0xeaf(%rip),%xmm0
jne    11c3 <main+0xa3>
jp     11c3 <main+0xa3>
movsd  0xeab(%rip),%xmm0
call   1040 <convert_it@plt>
ucomisd 0xe8e(%rip),%xmm0
jne    11c3 <main+0xa3>
jp     11c3 <main+0xa3>
movsd  0xe9a(%rip),%xmm0
call   1040 <convert_it@plt>
ucomisd 0xe95(%rip),%xmm0
jne    11c3 <main+0xa3>
jp     11c3 <main+0xa3>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [6 x double]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [6 x double]* %6 to i8*
%9 = bitcast i8* %8 to [6 x double]*
%10 = getelementptr inbounds [6 x double], [6 x double]* %9, i32 0, i32 0
store double 3.000000e+00, double* %10
%11 = getelementptr inbounds [6 x double], [6 x double]* %9, i32 0, i32 1
store double 1.950000e+00, double* %11
%12 = getelementptr inbounds [6 x double], [6 x double]* %9, i32 0, i32 2
store double 2.227000e+00, double* %12
%13 = getelementptr inbounds [6 x double], [6 x double]* %9, i32 0, i32 3
store double 4.000000e+00, double* %13
%14 = getelementptr inbounds [6 x double], [6 x double]* %9, i32 0, i32 4
store double 2.560000e+02, double* %14
%15 = getelementptr inbounds [6 x double], [6 x double]* %9, i32 0, i32 5
store double 8.797000e-04, double* %15
store i32 0, i32* %7
br label %16
16: ; preds = %35, %2
%17 = load i32, i32* %7
%18 = icmp ult i32 %17, 6
br i1 %18, label %19, label %38
19: ; preds = %16
%20 = load i32, i32* %7
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds [6 x double], [6 x double]* %6, i64 0, i64 %21
%23 = load double, double* %22
%24 = call double @convert_it(double %23)
%25 = load i32, i32* %7
%26 = zext i32 %25 to i64
%27 = getelementptr inbounds [6 x double], [6 x double]* %6, i64 0, i64 %26
%28 = load double, double* %27
%29 = call double @sqrt(double %28)
%30 = call double @sqrt(double %29)
%31 = fcmp une double %24, %30
br i1 %31, label %32, label %34
32: ; preds = %19
%33 = call i32 (...) @abort()
unreachable
34: ; preds = %19
br label %35
35: ; preds = %34
%36 = load i32, i32* %7
%37 = add i32 %36, 1
store i32 %37, i32* %7
br label %16
38: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double @convert_it(double 3.000000e+00)
%4 = fcmp une double %3, 0x3FF50EA39FCBF166
br i1 %4, label %21, label %5
5: ; preds = %2
%6 = tail call double @convert_it(double 1.950000e+00)
%7 = fcmp une double %6, 0x3FF2E8424D90F95D
br i1 %7, label %21, label %8
8: ; preds = %5
%9 = tail call double @convert_it(double 2.227000e+00)
%10 = fcmp une double %9, 0x3FF38BAF7AED356D
br i1 %10, label %21, label %11
11: ; preds = %8
%12 = tail call double @convert_it(double 4.000000e+00)
%13 = fcmp une double %12, 0x3FF6A09E667F3BCD
br i1 %13, label %21, label %14
14: ; preds = %11
%15 = tail call double @convert_it(double 2.560000e+02)
%16 = fcmp une double %15, 4.000000e+00
br i1 %16, label %21, label %17
17: ; preds = %14
%18 = tail call double @convert_it(double 8.797000e-04)
%19 = fcmp une double %18, 0x3FC60B4E47977AB5
br i1 %19, label %21, label %20
20: ; preds = %17
ret i32 0
21: ; preds = %17, %14, %11, %8, %5, %2
%22 = tail call i32 (...) @abort()
unreachable
}