#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 */
scalar_t__ feq(double, double);
int qeq(double *q, double a, double b, double c, double d) {
  return feq(q[0], a) && feq(q[1], b) && feq(q[2], c) && feq(q[3], d);
}


x86 assembly (clang, -O0):
<qeq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <feq@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x29(%rbp)
je     11bb <qeq+0xab>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <feq@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x29(%rbp)
je     11bb <qeq+0xab>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <feq@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x29(%rbp)
je     11bb <qeq+0xab>
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1030 <feq@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qeq>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movsd  %xmm3,(%rsp)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
movaps %xmm0,%xmm1
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
call   1030 <feq@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     117f <qeq+0x6f>
movsd  0x8(%rbx),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <feq@plt>
test   %rax,%rax
je     117f <qeq+0x6f>
movsd  0x10(%rbx),%xmm0
movsd  0x8(%rsp),%xmm1
call   1030 <feq@plt>
test   %rax,%rax
je     117f <qeq+0x6f>
movsd  0x18(%rbx),%xmm0
movsd  (%rsp),%xmm1
call   1030 <feq@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

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

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