#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();
void check(double *a, double *b) {
  int i;
  for (i = 0; i < 128; i++)
    if (a[i] - b[i] > 0.0000000000000001 || b[i] - a[i] > 0.0000000000000001)
      abort();
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x80,-0x14(%rbp)
jge    11a6 <check+0x96>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  0xeaa(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     118c <check+0x7c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  0xe7e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1193 <check+0x83>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1198 <check+0x88>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <check+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
push   %rax
xor    %eax,%eax
movsd  0xee5(%rip),%xmm0
nopl   0x0(%rax,%rax,1)
movsd  (%rdi,%rax,8),%xmm2
movsd  (%rsi,%rax,8),%xmm1
movapd %xmm2,%xmm3
subsd  %xmm1,%xmm3
ucomisd %xmm0,%xmm3
ja     1174 <check+0x64>
subsd  %xmm2,%xmm1
ucomisd %xmm0,%xmm1
ja     1174 <check+0x64>
movsd  0x8(%rdi,%rax,8),%xmm2
movsd  0x8(%rsi,%rax,8),%xmm1
movapd %xmm2,%xmm3
subsd  %xmm1,%xmm3
ucomisd %xmm0,%xmm3
ja     1174 <check+0x64>
subsd  %xmm2,%xmm1
ucomisd %xmm0,%xmm1
ja     1174 <check+0x64>
add    $0x2,%rax
cmp    $0x80,%rax
jne    1120 <check+0x10>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @check(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca i32
store double* %0, double** %3
store double* %1, double** %4
store i32 0, i32* %5
br label %6
6: ; preds = %38, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 128
br i1 %8, label %9, label %41
9: ; preds = %6
%10 = load double*, double** %3
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds double, double* %10, i64 %12
%14 = load double, double* %13
%15 = load double*, double** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %15, i64 %17
%19 = load double, double* %18
%20 = fsub double %14, %19
%21 = fcmp ogt double %20, 0x3C9CD2B297D889BC
br i1 %21, label %35, label %22
22: ; preds = %9
%23 = load double*, double** %4
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
%27 = load double, double* %26
%28 = load double*, double** %3
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds double, double* %28, i64 %30
%32 = load double, double* %31
%33 = fsub double %27, %32
%34 = fcmp ogt double %33, 0x3C9CD2B297D889BC
br i1 %34, label %35, label %37
35: ; preds = %22, %9
%36 = call i32 (...) @abort()
unreachable
37: ; preds = %22
br label %38
38: ; preds = %37
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %6
41: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @check(double* nocapture %0, double* nocapture %1) {
br label %17
3: ; preds = %17
%4 = or i64 %18, 1
%5 = getelementptr inbounds double, double* %0, i64 %4
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 %4
%8 = load double, double* %7
%9 = fsub double %6, %8
%10 = fcmp ogt double %9, 0x3C9CD2B297D889BC
%11 = fsub double %8, %6
%12 = fcmp ogt double %11, 0x3C9CD2B297D889BC
%13 = or i1 %10, %12
br i1 %13, label %28, label %14
14: ; preds = %3
%15 = add nuw nsw i64 %18, 2
%16 = icmp eq i64 %15, 128
br i1 %16, label %30, label %17
17: ; preds = %14, %2
%18 = phi i64 [ 0, %2 ], [ %15, %14 ]
%19 = getelementptr inbounds double, double* %0, i64 %18
%20 = load double, double* %19
%21 = getelementptr inbounds double, double* %1, i64 %18
%22 = load double, double* %21
%23 = fsub double %20, %22
%24 = fcmp ogt double %23, 0x3C9CD2B297D889BC
%25 = fsub double %22, %20
%26 = fcmp ogt double %25, 0x3C9CD2B297D889BC
%27 = or i1 %24, %26
br i1 %27, label %28, label %3
28: ; preds = %3, %17
%29 = tail call i32 (...) @abort()
unreachable
30: ; preds = %14
ret void
}