#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 */
double __XALT_epoch_xalt_1_5();
int /*<<< orphan*/ printf(char *, double);
double strtod(char *, char **);
int main(int argc, char *argv[]) {
  double t1 = __XALT_epoch_xalt_1_5();
  if (argc == 1) {
    printf("%.4f\n", t1);
    return 0;
  }
  double t0 = strtod(argv[1], (char **)NULL);
  printf("%.4f\n", t1 - t0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__XALT_epoch_xalt_1_5@plt>
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1179 <main+0x49>
movsd  -0x18(%rbp),%xmm0
lea    0xe98(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11ac <main+0x7c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <strtod@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
lea    0xe60(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <__XALT_epoch_xalt_1_5@plt>
cmp    $0x1,%ebp
je     1167 <main+0x37>
mov    0x8(%rbx),%rdi
xor    %esi,%esi
movsd  %xmm0,(%rsp)
call   1040 <strtod@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  (%rsp),%xmm0
lea    0xe92(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.4f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call double (...) @__XALT_epoch_xalt_1_5()
store double %8, double* %6
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load double, double* %6
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %12)
store i32 0, i32* %3
br label %23
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call double @strtod(i8* %17, i8** null)
store double %18, double* %7
%19 = load double, double* %6
%20 = load double, double* %7
%21 = fsub double %19, %20
%22 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %21)
store i32 0, i32* %3
br label %23
23: ; preds = %14, %11
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.4f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call double (...) @__XALT_epoch_xalt_1_5()
%4 = icmp eq i32 %0, 1
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call double @strtod(i8* nocapture %7, i8** null)
%9 = fsub double %3, %8
br label %10
10: ; preds = %2, %5
%11 = phi double [ %9, %5 ], [ %3, %2 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %11)
ret i32 0
}