#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();
scalar_t__ memcmp(void *, void *, int);
void expect(double value, double expected) {
  if (expected != expected) {
    if (value == value)
      abort();
  } else if (value != value)
    abort();
  else if (memcmp((void *)&value, (void *)&expected, sizeof(double)) != 0)
    abort();
}


x86 assembly (clang, -O0):
<expect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    114d <expect+0x2d>
jp     114d <expect+0x2d>
jmp    116f <expect+0x4f>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jne    116a <expect+0x4a>
jp     116a <expect+0x4a>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11be <expect+0x9e>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jne    118a <expect+0x6a>
jp     118a <expect+0x6a>
jmp    1191 <expect+0x71>
mov    $0x0,%al
call   1030 <abort@plt>
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
je     11b4 <expect+0x94>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11b9 <expect+0x99>
jmp    11be <expect+0x9e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
ucomisd %xmm1,%xmm1
jp     115a <expect+0x3a>
ucomisd %xmm0,%xmm0
jp     1160 <expect+0x40>
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x8,%edx
call   1040 <memcmp@plt>
test   %rax,%rax
jne    1160 <expect+0x40>
add    $0x18,%rsp
ret
ucomisd %xmm0,%xmm0
jp     1155 <expect+0x35>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @expect(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %4
%7 = fcmp une double %5, %6
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load double, double* %3
%10 = load double, double* %3
%11 = fcmp oeq double %9, %10
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %8
br label %30
15: ; preds = %2
%16 = load double, double* %3
%17 = load double, double* %3
%18 = fcmp une double %16, %17
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %15
%22 = bitcast double* %3 to i8*
%23 = bitcast double* %4 to i8*
%24 = call i64 @memcmp(i8* %22, i8* %23, i32 8)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %21
%27 = call i32 (...) @abort()
unreachable
28: ; preds = %21
br label %29
29: ; preds = %28
br label %30
30: ; preds = %29, %14
ret void
}

LLVM IR (-O2):
define void @expect(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = fcmp uno double %1, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = fcmp ord double %0, 0.000000e+00
br i1 %7, label %8, label %21
8: ; preds = %6
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %2
%11 = fcmp uno double %0, 0.000000e+00
br i1 %11, label %12, label %14
12: ; preds = %10
%13 = tail call i32 (...) @abort()
unreachable
14: ; preds = %10
%15 = bitcast double* %3 to i8*
%16 = bitcast double* %4 to i8*
%17 = call i64 @memcmp(i8* %15, i8* %16, i32 8)
%18 = icmp eq i64 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %14
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %14, %6
ret void
}