#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 */
double fabs(double);
int vequalold(double v1[3], double v2[3], double t) {
  int e = 1;
  for (int i = 0; i < 3; i++) {
    e &= (fabs(v1[i] - v2[i]) <= t);
  }
  return e;
}


x86 assembly (clang, -O0):
<vequalold>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    1173 <vequalold+0x73>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm1
movaps 0xeb6(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    111f <vequalold+0x1f>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vequalold>:
movupd (%rdi),%xmm1
movupd (%rsi),%xmm2
subpd  %xmm2,%xmm1
movapd 0xeec(%rip),%xmm2
andpd  %xmm2,%xmm1
movapd %xmm0,%xmm3
unpcklpd %xmm0,%xmm3
cmplepd %xmm3,%xmm1
movmskpd %xmm1,%eax
cmp    $0x3,%al
movsd  0x10(%rdi),%xmm1
subsd  0x10(%rsi),%xmm1
sete   %al
andpd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
setae  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @vequalold(double* %0, double* %1, double %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store double %2, double* %6
store i32 1, i32* %7
store i32 0, i32* %8
br label %9
9: ; preds = %30, %3
%10 = load i32, i32* %8
%11 = icmp slt i32 %10, 3
br i1 %11, label %12, label %33
12: ; preds = %9
%13 = load double*, double** %4
%14 = load i32, i32* %8
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* %13, i64 %15
%17 = load double, double* %16
%18 = load double*, double** %5
%19 = load i32, i32* %8
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %18, i64 %20
%22 = load double, double* %21
%23 = fsub double %17, %22
%24 = call double @llvm.fabs.f64(double %23)
%25 = load double, double* %6
%26 = fcmp ole double %24, %25
%27 = zext i1 %26 to i32
%28 = load i32, i32* %7
%29 = and i32 %28, %27
store i32 %29, i32* %7
br label %30
30: ; preds = %12
%31 = load i32, i32* %8
%32 = add nsw i32 %31, 1
store i32 %32, i32* %8
br label %9
33: ; preds = %9
%34 = load i32, i32* %7
ret i32 %34
}

LLVM IR (-O2):
define i32 @vequalold(double* nocapture %0, double* nocapture %1, double %2) {
%4 = bitcast double* %0 to <2 x double>*
%5 = load <2 x double>, <2 x double>* %4
%6 = bitcast double* %1 to <2 x double>*
%7 = load <2 x double>, <2 x double>* %6
%8 = fsub <2 x double> %5, %7
%9 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %8)
%10 = insertelement <2 x double> poison, double %2, i64 0
%11 = shufflevector <2 x double> %10, <2 x double> poison, <2 x i32> zeroinitializer
%12 = fcmp ole <2 x double> %9, %11
%13 = shufflevector <2 x i1> %12, <2 x i1> poison, <2 x i32> <i32 1, i32 undef>
%14 = and <2 x i1> %12, %13
%15 = extractelement <2 x i1> %14, i64 0
%16 = getelementptr inbounds double, double* %0, i64 2
%17 = load double, double* %16
%18 = getelementptr inbounds double, double* %1, i64 2
%19 = load double, double* %18
%20 = fsub double %17, %19
%21 = tail call double @llvm.fabs.f64(double %20)
%22 = fcmp ole double %21, %2
%23 = and i1 %15, %22
%24 = zext i1 %23 to i32
ret i32 %24
}