#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*/ assert(int);
double daysPastEpoch(double);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void check(double expected, double date) {
  double actual = daysPastEpoch(date);
  if (expected == actual)
    return;
  fprintf(stderr, "unit test of daysPastEpoch failed\n");
  fprintf(stderr, "expected = %f\n", expected);
  fprintf(stderr, "actual   = %f\n", actual);
  assert(expected == actual);
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <daysPastEpoch@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    116c <check+0x3c>
jp     116c <check+0x3c>
jmp    11d7 <check+0xa7>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
lea    0xe84(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
movsd  -0x8(%rbp),%xmm0
lea    0xe8b(%rip),%rsi
mov    $0x1,%al
call   1040 <fprintf@plt>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
movsd  -0x18(%rbp),%xmm0
lea    0xe7e(%rip),%rsi
mov    $0x1,%al
call   1040 <fprintf@plt>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,(%rsp)
movapd %xmm1,%xmm0
call   1050 <daysPastEpoch@plt>
ucomisd (%rsp),%xmm0
jne    1152 <check+0x22>
jp     1152 <check+0x22>
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e87(%rip),%rbx
mov    (%rbx),%edi
lea    0xe9e(%rip),%rsi
xor    %eax,%eax
movsd  %xmm0,0x8(%rsp)
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeab(%rip),%rsi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xea5(%rip),%rsi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1040 <fprintf@plt>
xor    %edi,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <assert@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"unit test of daysPastEpoch failed\0A\00"
@.str.1 = [15 x i8] c"expected = %f\0A\00"
@.str.2 = [15 x i8] c"actual = %f\0A\00"
define void @check(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = call double @daysPastEpoch(double %6)
store double %7, double* %5
%8 = load double, double* %3
%9 = load double, double* %5
%10 = fcmp oeq double %8, %9
br i1 %10, label %11, label %12
11: ; preds = %2
br label %26
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = load double, double* %3
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %16)
%18 = load i32, i32* @stderr
%19 = load double, double* %5
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %19)
%21 = load double, double* %3
%22 = load double, double* %5
%23 = fcmp oeq double %21, %22
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
br label %26
26: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"unit test of daysPastEpoch failed\0A\00"
@.str.1 = [15 x i8] c"expected = %f\0A\00"
@.str.2 = [15 x i8] c"actual = %f\0A\00"
define void @check(double %0, double %1) {
%3 = tail call double @daysPastEpoch(double %1)
%4 = fcmp oeq double %3, %0
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %0)
%10 = load i32, i32* @stderr
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %3)
%12 = tail call i32 @assert(i32 0)
br label %13
13: ; preds = %2, %5
ret void
}