#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 /*<<< orphan*/ abort();
void compare(double r, double s, int *p, int *q, int n, int line) {
  int i;
  for (i = 0; i < n; i++)
    if (r != s || p[i] != q[i])
      abort();
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
mov    %ecx,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    118f <compare+0x7f>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    1175 <compare+0x65>
jp     1175 <compare+0x65>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x20(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     117c <compare+0x6c>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1181 <compare+0x71>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1137 <compare+0x27>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
push   %rax
test   %edx,%edx
jle    1141 <compare+0x31>
ucomisd %xmm1,%xmm0
jne    1143 <compare+0x33>
jp     1143 <compare+0x33>
mov    %edx,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rdi,%rcx,4),%edx
cmp    (%rsi,%rcx,4),%edx
jne    1143 <compare+0x33>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1130 <compare+0x20>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @compare(double %0, double %1, i32* nocapture %2, i32* nocapture %3, i32 %4, i32 %5) {
%7 = icmp sgt i32 %4, 0
br i1 %7, label %8, label %24
8: ; preds = %6
%9 = fcmp une double %0, %1
br i1 %9, label %22, label %10
10: ; preds = %8
%11 = zext i32 %4 to i64
br label %14
12: ; preds = %14
%13 = icmp eq i64 %21, %11
br i1 %13, label %24, label %14
14: ; preds = %10, %12
%15 = phi i64 [ 0, %10 ], [ %21, %12 ]
%16 = getelementptr inbounds i32, i32* %2, i64 %15
%17 = load i32, i32* %16
%18 = getelementptr inbounds i32, i32* %3, i64 %15
%19 = load i32, i32* %18
%20 = icmp eq i32 %17, %19
%21 = add nuw nsw i64 %15, 1
br i1 %20, label %12, label %22
22: ; preds = %14, %8
%23 = tail call i32 (...) @abort()
unreachable
24: ; preds = %12, %6
ret void
}