#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 */
typedef double time_t;

/* Variables and functions */
int CHAR_BIT;
int DBL_MANT_DIG;
int LDBL_MANT_DIG;
double subtract(double, double);
double __difftime(time_t time1, time_t time0) {
  if ((sizeof(time_t) * CHAR_BIT) <= DBL_MANT_DIG ||
      (((time_t)0.5 == 0.5) && sizeof(time_t) < sizeof(long double)))
    return (double)time1 - (double)time0;
  if ((sizeof(time_t) * CHAR_BIT) <= LDBL_MANT_DIG || ((time_t)0.5 == 0.5))
    return (long double)time1 - (long double)time0;
  return time1 < time0 ? -subtract(time0, time1) : subtract(time1, time0);
}


x86 assembly (clang, -O0):
<__difftime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    0x2eaf(%rip),%rax
movslq (%rax),%rax
shl    $0x3,%rax
mov    0x2eb1(%rip),%rcx
movslq (%rcx),%rcx
cmp    %rcx,%rax
jbe    1152 <__difftime+0x42>
mov    $0x1,%al
test   $0x1,%al
jne    1152 <__difftime+0x42>
jmp    1166 <__difftime+0x56>
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1212 <__difftime+0x102>
mov    0x2e6b(%rip),%rax
movslq (%rax),%rax
shl    $0x3,%rax
mov    0x2e55(%rip),%rcx
movslq (%rcx),%rcx
cmp    %rcx,%rax
jbe    1196 <__difftime+0x86>
mov    $0x1,%al
test   $0x1,%al
jne    1196 <__difftime+0x86>
jmp    11b0 <__difftime+0xa0>
fldl   -0x10(%rbp)
fldl   -0x18(%rbp)
fsubrp %st,%st(1)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1212 <__difftime+0x102>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11f4 <__difftime+0xe4>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <subtract@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1208 <__difftime+0xf8>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <subtract@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__difftime>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
@DBL_MANT_DIG = global i32 0
@LDBL_MANT_DIG = global i32 0
define double @__difftime(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load i32, i32* @CHAR_BIT
%7 = sext i32 %6 to i64
%8 = mul i64 8, %7
%9 = load i32, i32* @DBL_MANT_DIG
%10 = sext i32 %9 to i64
%11 = icmp ule i64 %8, %10
br i1 %11, label %13, label %12
12: ; preds = %2
br i1 true, label %13, label %17
13: ; preds = %12, %2
%14 = load double, double* %4
%15 = load double, double* %5
%16 = fsub double %14, %15
store double %16, double* %3
br label %47
17: ; preds = %12
%18 = load i32, i32* @CHAR_BIT
%19 = sext i32 %18 to i64
%20 = mul i64 8, %19
%21 = load i32, i32* @LDBL_MANT_DIG
%22 = sext i32 %21 to i64
%23 = icmp ule i64 %20, %22
br i1 %23, label %25, label %24
24: ; preds = %17
br i1 true, label %25, label %32
25: ; preds = %24, %17
%26 = load double, double* %4
%27 = fpext double %26 to x86_fp80
%28 = load double, double* %5
%29 = fpext double %28 to x86_fp80
%30 = fsub x86_fp80 %27, %29
%31 = fptrunc x86_fp80 %30 to double
store double %31, double* %3
br label %47
32: ; preds = %24
%33 = load double, double* %4
%34 = load double, double* %5
%35 = fcmp olt double %33, %34
br i1 %35, label %36, label %41
36: ; preds = %32
%37 = load double, double* %5
%38 = load double, double* %4
%39 = call double @subtract(double %37, double %38)
%40 = fneg double %39
br label %45
41: ; preds = %32
%42 = load double, double* %4
%43 = load double, double* %5
%44 = call double @subtract(double %42, double %43)
br label %45
45: ; preds = %41, %36
%46 = phi double [ %40, %36 ], [ %44, %41 ]
store double %46, double* %3
br label %47
47: ; preds = %45, %25, %13
%48 = load double, double* %3
ret double %48
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
@DBL_MANT_DIG = global i32 0
@LDBL_MANT_DIG = global i32 0
define double @__difftime(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}