#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 const);
int vec3_cmpV(const double u[3], const double v[3], double precision) {
  int ret, i;
  ret = 0;
  for (i = 0; i < 3; i++)
    if (fabs(u[i] - v[i]) > precision)
      ret = ret + 1;
  return ret;
}


x86 assembly (clang, -O0):
<vec3_cmpV>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    1175 <vec3_cmpV+0x75>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movaps 0xeb6(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1162 <vec3_cmpV+0x62>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1167 <vec3_cmpV+0x67>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    111f <vec3_cmpV+0x1f>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_cmpV>:
movupd (%rdi),%xmm1
movupd (%rsi),%xmm2
subpd  %xmm2,%xmm1
movapd 0xeec(%rip),%xmm2
andpd  %xmm2,%xmm1
movsd  0x10(%rdi),%xmm3
subsd  0x10(%rsi),%xmm3
andpd  %xmm2,%xmm3
xor    %eax,%eax
ucomisd %xmm0,%xmm3
unpcklpd %xmm0,%xmm0
cmpltpd %xmm1,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
andpd  0xecb(%rip),%xmm1
psubd  %xmm0,%xmm1
movd   %xmm1,%ecx
seta   %al
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @vec3_cmpV(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 0, i32* %7
store i32 0, i32* %8
br label %9
9: ; preds = %31, %3
%10 = load i32, i32* %8
%11 = icmp slt i32 %10, 3
br i1 %11, label %12, label %34
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 ogt double %24, %25
br i1 %26, label %27, label %30
27: ; preds = %12
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
br label %30
30: ; preds = %27, %12
br label %31
31: ; preds = %30
%32 = load i32, i32* %8
%33 = add nsw i32 %32, 1
store i32 %33, i32* %8
br label %9
34: ; preds = %9
%35 = load i32, i32* %7
ret i32 %35
}

LLVM IR (-O2):
define i32 @vec3_cmpV(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 ogt <2 x double> %9, %11
%13 = zext <2 x i1> %12 to <2 x i32>
%14 = shufflevector <2 x i32> %13, <2 x i32> poison, <2 x i32> <i32 1, i32 undef>
%15 = add nuw nsw <2 x i32> %14, %13
%16 = extractelement <2 x i32> %15, i64 0
%17 = getelementptr inbounds double, double* %0, i64 2
%18 = load double, double* %17
%19 = getelementptr inbounds double, double* %1, i64 2
%20 = load double, double* %19
%21 = fsub double %18, %20
%22 = tail call double @llvm.fabs.f64(double %21)
%23 = fcmp ogt double %22, %2
%24 = zext i1 %23 to i32
%25 = add nuw nsw i32 %16, %24
ret i32 %25
}