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


x86 assembly (clang, -O0):
<qd_eq_qd_d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
xor    %eax,%eax
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0x11(%rbp)
jne    1188 <qd_eq_qd_d+0x88>
jp     1188 <qd_eq_qd_d+0x88>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jne    1188 <qd_eq_qd_d+0x88>
jp     1188 <qd_eq_qd_d+0x88>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jne    1188 <qd_eq_qd_d+0x88>
jp     1188 <qd_eq_qd_d+0x88>
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%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_qd_d>:
movsd  (%rdi),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
jne    113e <qd_eq_qd_d+0x3e>
jp     113e <qd_eq_qd_d+0x3e>
movsd  0x8(%rdi),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    113e <qd_eq_qd_d+0x3e>
jp     113e <qd_eq_qd_d+0x3e>
movsd  0x10(%rdi),%xmm1
ucomisd %xmm0,%xmm1
jne    113e <qd_eq_qd_d+0x3e>
jp     113e <qd_eq_qd_d+0x3e>
xorpd  %xmm0,%xmm0
cmpeqsd 0x18(%rdi),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @qd_eq_qd_d(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 = fcmp oeq double %7, %8
br i1 %9, label %10, label %25
10: ; preds = %2
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = fcmp oeq double %13, 0.000000e+00
br i1 %14, label %15, label %25
15: ; preds = %10
%16 = load double*, double** %3
%17 = getelementptr inbounds double, double* %16, i64 2
%18 = load double, double* %17
%19 = fcmp oeq double %18, 0.000000e+00
br i1 %19, label %20, label %25
20: ; preds = %15
%21 = load double*, double** %3
%22 = getelementptr inbounds double, double* %21, i64 3
%23 = load double, double* %22
%24 = fcmp oeq double %23, 0.000000e+00
br label %25
25: ; preds = %20, %15, %10, %2
%26 = phi i1 [ false, %15 ], [ false, %10 ], [ false, %2 ], [ %24, %20 ]
%27 = zext i1 %26 to i64
%28 = select i1 %26, i32 1, i32 0
ret i32 %28
}

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