int qd_eq(const double *a, const double *b) {
  return ((a[0] == b[0]) && (a[1] == b[1]) && (a[2] == b[2]) && (a[3] == b[3]))
             ? 1
             : 0;
}


x86 assembly (clang, -O0):
<qd_eq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
ucomisd (%rcx),%xmm0
mov    %al,-0x11(%rbp)
jne    1190 <qd_eq+0x90>
jp     1190 <qd_eq+0x90>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
ucomisd 0x8(%rcx),%xmm0
mov    %al,-0x11(%rbp)
jne    1190 <qd_eq+0x90>
jp     1190 <qd_eq+0x90>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
ucomisd 0x10(%rcx),%xmm0
mov    %al,-0x11(%rbp)
jne    1190 <qd_eq+0x90>
jp     1190 <qd_eq+0x90>
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd 0x18(%rax),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qd_eq>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
ucomisd (%rsi),%xmm0
jne    113d <qd_eq+0x3d>
jp     113d <qd_eq+0x3d>
movsd  0x8(%rdi),%xmm0
ucomisd 0x8(%rsi),%xmm0
jne    113d <qd_eq+0x3d>
jp     113d <qd_eq+0x3d>
movsd  0x10(%rdi),%xmm0
ucomisd 0x10(%rsi),%xmm0
jne    113d <qd_eq+0x3d>
jp     113d <qd_eq+0x3d>
movsd  0x18(%rsi),%xmm0
cmpeqsd 0x18(%rdi),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @qd_eq(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fcmp oeq double %7, %10
br i1 %11, label %12, label %36
12: ; preds = %2
%13 = load double*, double** %3
%14 = getelementptr inbounds double, double* %13, i64 1
%15 = load double, double* %14
%16 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = fcmp oeq double %15, %18
br i1 %19, label %20, label %36
20: ; preds = %12
%21 = load double*, double** %3
%22 = getelementptr inbounds double, double* %21, i64 2
%23 = load double, double* %22
%24 = load double*, double** %4
%25 = getelementptr inbounds double, double* %24, i64 2
%26 = load double, double* %25
%27 = fcmp oeq double %23, %26
br i1 %27, label %28, label %36
28: ; preds = %20
%29 = load double*, double** %3
%30 = getelementptr inbounds double, double* %29, i64 3
%31 = load double, double* %30
%32 = load double*, double** %4
%33 = getelementptr inbounds double, double* %32, i64 3
%34 = load double, double* %33
%35 = fcmp oeq double %31, %34
br label %36
36: ; preds = %28, %20, %12, %2
%37 = phi i1 [ false, %20 ], [ false, %12 ], [ false, %2 ], [ %35, %28 ]
%38 = zext i1 %37 to i64
%39 = select i1 %37, i32 1, i32 0
ret i32 %39
}

LLVM IR (-O2):
define i32 @qd_eq(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp oeq double %3, %4
br i1 %5, label %6, label %25
6: ; preds = %2
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = fcmp oeq double %8, %10
br i1 %11, label %12, label %25
12: ; preds = %6
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %1, i64 2
%16 = load double, double* %15
%17 = fcmp oeq double %14, %16
br i1 %17, label %18, label %25
18: ; preds = %12
%19 = getelementptr inbounds double, double* %0, i64 3
%20 = load double, double* %19
%21 = getelementptr inbounds double, double* %1, i64 3
%22 = load double, double* %21
%23 = fcmp oeq double %20, %22
%24 = zext i1 %23 to i32
br label %25
25: ; preds = %18, %12, %6, %2
%26 = phi i32 [ 0, %12 ], [ 0, %6 ], [ 0, %2 ], [ %24, %18 ]
ret i32 %26
}