#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(values[i]) * sqrt(sqrt(values[i])))
      abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%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    123e <main+0xfe>
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>
movsd  %xmm0,-0x58(%rbp)
mov    -0x44(%rbp),%eax
movsd  -0x40(%rbp,%rax,8),%xmm0
call   1060 <sqrt@plt>
call   1060 <sqrt@plt>
movsd  -0x58(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jne    1224 <main+0xe4>
jp     1224 <main+0xe4>
jmp    122b <main+0xeb>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1230 <main+0xf0>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11bb <main+0x7b>
xor    %eax,%eax
add    $0x60,%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 0xea6(%rip),%xmm0
jne    11c3 <main+0xa3>
jp     11c3 <main+0xa3>
movsd  0xea2(%rip),%xmm0
call   1040 <convert_it@plt>
ucomisd 0xe9d(%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 = %41, %2
%17 = load i32, i32* %7
%18 = icmp ult i32 %17, 6
br i1 %18, label %19, label %44
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 = load i32, i32* %7
%31 = zext i32 %30 to i64
%32 = getelementptr inbounds [6 x double], [6 x double]* %6, i64 0, i64 %31
%33 = load double, double* %32
%34 = call double @sqrt(double %33)
%35 = call double @sqrt(double %34)
%36 = fmul double %29, %35
%37 = fcmp une double %24, %36
br i1 %37, label %38, label %40
38: ; preds = %19
%39 = call i32 (...) @abort()
unreachable
40: ; preds = %19
br label %41
41: ; preds = %40
%42 = load i32, i32* %7
%43 = add i32 %42, 1
store i32 %43, i32* %7
br label %16
44: ; 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, 0x40023C6E3224F9D0
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, 0x3FFA670DC914DE16
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, 0x3FFD2B116D6FE944
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, 0x4006A09E667F3BCD
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, 6.400000e+01
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, 0x3F74EC207BEF1230
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
}