#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 volatile convert_it(double);
double fabs(double volatile);
double sqrt(double);
int main(int argc, char *argv[]) {
  double values[6] = {3.0, 1.95, 2.227, 4.0, 256.0, .0008797};
  double PREC = 0.999999;
  unsigned i;
  for (i = 0; i < 6; i++) {
    volatile double x, y;
    x = sqrt(values[i]);
    y = sqrt(sqrt(values[i]));
    if (fabs(convert_it(values[i]) / (x * y)) < PREC)
      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  0xec2(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xead(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe98(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe83(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe6e(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe59(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe44(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
cmpl   $0x6,-0x4c(%rbp)
jae    1254 <main+0x114>
mov    -0x4c(%rbp),%eax
movsd  -0x40(%rbp,%rax,8),%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x58(%rbp)
mov    -0x4c(%rbp),%eax
movsd  -0x40(%rbp,%rax,8),%xmm0
call   1060 <sqrt@plt>
call   1060 <sqrt@plt>
movsd  %xmm0,-0x60(%rbp)
mov    -0x4c(%rbp),%eax
movsd  -0x40(%rbp,%rax,8),%xmm0
call   1050 <convert_it@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movaps 0xe19(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1241 <main+0x101>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1246 <main+0x106>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    11c8 <main+0x88>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x3ffbb67ae8584caa,%rax
b6 fb 3f
mov    %rax,0x10(%rsp)
movabs $0x3ff50ea39fcbf166,%rax
0e f5 3f
mov    %rax,0x8(%rsp)
movsd  0xeb6(%rip),%xmm0
call   1040 <convert_it@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
divsd  %xmm1,%xmm0
andpd  0xed9(%rip),%xmm0
movsd  0xe99(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1321 <main+0x201>
movabs $0x3ff657c0b2625eb4,%rax
57 f6 3f
mov    %rax,0x10(%rsp)
movabs $0x3ff2e8424d90f95d,%rax
e8 f2 3f
mov    %rax,0x8(%rsp)
movsd  0xe71(%rip),%xmm0
call   1040 <convert_it@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
divsd  %xmm1,%xmm0
andpd  0xe84(%rip),%xmm0
movsd  0xe44(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1321 <main+0x201>
movabs $0x3ff7e084446fcd18,%rax
e0 f7 3f
mov    %rax,0x10(%rsp)
movabs $0x3ff38baf7aed356d,%rax
8b f3 3f
mov    %rax,0x8(%rsp)
movsd  0xe24(%rip),%xmm0
call   1040 <convert_it@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
divsd  %xmm1,%xmm0
andpd  0xe2f(%rip),%xmm0
movsd  0xdef(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1321 <main+0x201>
movabs $0x4000000000000000,%rax
mov    %rax,0x10(%rsp)
movabs $0x3ff6a09e667f3bcd,%rax
a0 f6 3f
mov    %rax,0x8(%rsp)
movsd  0xdd7(%rip),%xmm0
call   1040 <convert_it@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
divsd  %xmm1,%xmm0
andpd  0xdda(%rip),%xmm0
movsd  0xd9a(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1321 <main+0x201>
movabs $0x4030000000000000,%rax
mov    %rax,0x10(%rsp)
movabs $0x4010000000000000,%rax
mov    %rax,0x8(%rsp)
movsd  0xd8a(%rip),%xmm0
call   1040 <convert_it@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
divsd  %xmm1,%xmm0
andpd  0xd85(%rip),%xmm0
movsd  0xd45(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1321 <main+0x201>
movabs $0x3f9e5f1f4201fd00,%rax
5f 9e 3f
mov    %rax,0x10(%rsp)
movabs $0x3fc60b4e47977ab5,%rax
0b c6 3f
mov    %rax,0x8(%rsp)
movsd  0xd41(%rip),%xmm0
call   1040 <convert_it@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
divsd  %xmm1,%xmm0
andpd  0xd34(%rip),%xmm0
movsd  0xcf4(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1321 <main+0x201>
xor    %eax,%eax
add    $0x18,%rsp
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 double
%8 = alloca i32
%9 = alloca double
%10 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = bitcast [6 x double]* %6 to i8*
%12 = bitcast i8* %11 to [6 x double]*
%13 = getelementptr inbounds [6 x double], [6 x double]* %12, i32 0, i32 0
store double 3.000000e+00, double* %13
%14 = getelementptr inbounds [6 x double], [6 x double]* %12, i32 0, i32 1
store double 1.950000e+00, double* %14
%15 = getelementptr inbounds [6 x double], [6 x double]* %12, i32 0, i32 2
store double 2.227000e+00, double* %15
%16 = getelementptr inbounds [6 x double], [6 x double]* %12, i32 0, i32 3
store double 4.000000e+00, double* %16
%17 = getelementptr inbounds [6 x double], [6 x double]* %12, i32 0, i32 4
store double 2.560000e+02, double* %17
%18 = getelementptr inbounds [6 x double], [6 x double]* %12, i32 0, i32 5
store double 8.797000e-04, double* %18
store double 0x3FEFFFFDE7210BE9, double* %7
store i32 0, i32* %8
br label %19
19: ; preds = %49, %2
%20 = load i32, i32* %8
%21 = icmp ult i32 %20, 6
br i1 %21, label %22, label %52
22: ; preds = %19
%23 = load i32, i32* %8
%24 = zext i32 %23 to i64
%25 = getelementptr inbounds [6 x double], [6 x double]* %6, i64 0, i64 %24
%26 = load double, double* %25
%27 = call double @sqrt(double %26)
store volatile double %27, double* %9
%28 = load i32, i32* %8
%29 = zext i32 %28 to i64
%30 = getelementptr inbounds [6 x double], [6 x double]* %6, i64 0, i64 %29
%31 = load double, double* %30
%32 = call double @sqrt(double %31)
%33 = call double @sqrt(double %32)
store volatile double %33, double* %10
%34 = load i32, i32* %8
%35 = zext i32 %34 to i64
%36 = getelementptr inbounds [6 x double], [6 x double]* %6, i64 0, i64 %35
%37 = load double, double* %36
%38 = call double @convert_it(double %37)
%39 = load volatile double, double* %9
%40 = load volatile double, double* %10
%41 = fmul double %39, %40
%42 = fdiv double %38, %41
%43 = call double @llvm.fabs.f64(double %42)
%44 = load double, double* %7
%45 = fcmp olt double %43, %44
br i1 %45, label %46, label %48
46: ; preds = %22
%47 = call i32 (...) @abort()
unreachable
48: ; preds = %22
br label %49
49: ; preds = %48
%50 = load i32, i32* %8
%51 = add i32 %50, 1
store i32 %51, i32* %8
br label %19
52: ; preds = %19
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %3 to i8*
%6 = bitcast double* %4 to i8*
store volatile double 0x3FFBB67AE8584CAA, double* %3
store volatile double 0x3FF50EA39FCBF166, double* %4
%7 = tail call double @convert_it(double 3.000000e+00)
%8 = load volatile double, double* %3
%9 = load volatile double, double* %4
%10 = fmul double %8, %9
%11 = fdiv double %7, %10
%12 = tail call double @llvm.fabs.f64(double %11)
%13 = fcmp olt double %12, 0x3FEFFFFDE7210BE9
br i1 %13, label %14, label %16
14: ; preds = %48, %40, %32, %24, %16, %2
%15 = tail call i32 (...) @abort()
unreachable
16: ; preds = %2
store volatile double 0x3FF657C0B2625EB4, double* %3
store volatile double 0x3FF2E8424D90F95D, double* %4
%17 = tail call double @convert_it(double 1.950000e+00)
%18 = load volatile double, double* %3
%19 = load volatile double, double* %4
%20 = fmul double %18, %19
%21 = fdiv double %17, %20
%22 = tail call double @llvm.fabs.f64(double %21)
%23 = fcmp olt double %22, 0x3FEFFFFDE7210BE9
br i1 %23, label %14, label %24
24: ; preds = %16
store volatile double 0x3FF7E084446FCD18, double* %3
store volatile double 0x3FF38BAF7AED356D, double* %4
%25 = tail call double @convert_it(double 2.227000e+00)
%26 = load volatile double, double* %3
%27 = load volatile double, double* %4
%28 = fmul double %26, %27
%29 = fdiv double %25, %28
%30 = tail call double @llvm.fabs.f64(double %29)
%31 = fcmp olt double %30, 0x3FEFFFFDE7210BE9
br i1 %31, label %14, label %32
32: ; preds = %24
store volatile double 2.000000e+00, double* %3
store volatile double 0x3FF6A09E667F3BCD, double* %4
%33 = tail call double @convert_it(double 4.000000e+00)
%34 = load volatile double, double* %3
%35 = load volatile double, double* %4
%36 = fmul double %34, %35
%37 = fdiv double %33, %36
%38 = tail call double @llvm.fabs.f64(double %37)
%39 = fcmp olt double %38, 0x3FEFFFFDE7210BE9
br i1 %39, label %14, label %40
40: ; preds = %32
store volatile double 1.600000e+01, double* %3
store volatile double 4.000000e+00, double* %4
%41 = tail call double @convert_it(double 2.560000e+02)
%42 = load volatile double, double* %3
%43 = load volatile double, double* %4
%44 = fmul double %42, %43
%45 = fdiv double %41, %44
%46 = tail call double @llvm.fabs.f64(double %45)
%47 = fcmp olt double %46, 0x3FEFFFFDE7210BE9
br i1 %47, label %14, label %48
48: ; preds = %40
store volatile double 0x3F9E5F1F4201FD00, double* %3
store volatile double 0x3FC60B4E47977AB5, double* %4
%49 = tail call double @convert_it(double 8.797000e-04)
%50 = load volatile double, double* %3
%51 = load volatile double, double* %4
%52 = fmul double %50, %51
%53 = fdiv double %49, %52
%54 = tail call double @llvm.fabs.f64(double %53)
%55 = fcmp olt double %54, 0x3FEFFFFDE7210BE9
br i1 %55, label %14, label %56
56: ; preds = %48
ret i32 0
}