#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 */
int equalsArrayDouble(double *a, double *b, size_t len) {
  size_t i;
  for (i = 0; i < len; ++i) {
    if (a[i] != b[i])
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<equalsArrayDouble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1173 <equalsArrayDouble+0x73>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
jne    1151 <equalsArrayDouble+0x51>
jp     1151 <equalsArrayDouble+0x51>
jmp    115d <equalsArrayDouble+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    117a <equalsArrayDouble+0x7a>
jmp    1162 <equalsArrayDouble+0x62>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1118 <equalsArrayDouble+0x18>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equalsArrayDouble>:
mov    $0x1,%eax
test   %rdx,%rdx
je     1127 <equalsArrayDouble+0x27>
xor    %ecx,%ecx
nopl   0x0(%rax)
movsd  (%rdi,%rcx,8),%xmm0
ucomisd (%rsi,%rcx,8),%xmm0
jne    1128 <equalsArrayDouble+0x28>
jp     1128 <equalsArrayDouble+0x28>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <equalsArrayDouble+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @equalsArrayDouble(double* %0, double* %1, i64 %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
%7 = alloca i64
%8 = alloca i64
store double* %0, double** %5
store double* %1, double** %6
store i64 %2, i64* %7
store i64 0, i64* %8
br label %9
9: ; preds = %25, %3
%10 = load i64, i64* %8
%11 = load i64, i64* %7
%12 = icmp ult i64 %10, %11
br i1 %12, label %13, label %28
13: ; preds = %9
%14 = load double*, double** %5
%15 = load i64, i64* %8
%16 = getelementptr inbounds double, double* %14, i64 %15
%17 = load double, double* %16
%18 = load double*, double** %6
%19 = load i64, i64* %8
%20 = getelementptr inbounds double, double* %18, i64 %19
%21 = load double, double* %20
%22 = fcmp une double %17, %21
br i1 %22, label %23, label %24
23: ; preds = %13
store i32 0, i32* %4
br label %29
24: ; preds = %13
br label %25
25: ; preds = %24
%26 = load i64, i64* %8
%27 = add i64 %26, 1
store i64 %27, i64* %8
br label %9
28: ; preds = %9
store i32 1, i32* %4
br label %29
29: ; preds = %28, %23
%30 = load i32, i32* %4
ret i32 %30
}

LLVM IR (-O2):
define i32 @equalsArrayDouble(double* nocapture %0, double* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %15, label %7
5: ; preds = %7
%6 = icmp eq i64 %14, %2
br i1 %6, label %15, label %7
7: ; preds = %3, %5
%8 = phi i64 [ %14, %5 ], [ 0, %3 ]
%9 = getelementptr inbounds double, double* %0, i64 %8
%10 = load double, double* %9
%11 = getelementptr inbounds double, double* %1, i64 %8
%12 = load double, double* %11
%13 = fcmp une double %10, %12
%14 = add nuw i64 %8, 1
br i1 %13, label %15, label %5
15: ; preds = %7, %5, %3
%16 = phi i32 [ 1, %3 ], [ 1, %5 ], [ 0, %7 ]
ret i32 %16
}