#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*/ date2epoch(int, int, int, int, int, int, int, double *);
void delta_t(int y1, int j1, int h1, int m1, int s1, int ms1, int y0, int j0,
             int h0, int m0, int s0, int ms0, double *tdiff) {
  double t1, t0;
  date2epoch(y1, 1, 1, h1, m1, s1, ms1, &t1);
  date2epoch(y0, 1, 1, h0, m0, s0, ms0, &t0);
  *tdiff = t1 - t0 + (j1 - j0) * 86400;
}


x86 assembly (clang, -O0):
<delta_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0x18(%rbp),%r10d
mov    $0x1,%edx
lea    -0x20(%rbp),%rax
mov    %edx,%esi
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <date2epoch@plt>
mov    0x10(%rbp),%edi
mov    0x20(%rbp),%ecx
mov    0x28(%rbp),%r8d
mov    0x30(%rbp),%r9d
mov    0x38(%rbp),%r10d
mov    $0x1,%edx
lea    -0x28(%rbp),%rax
mov    %edx,%esi
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <date2epoch@plt>
movsd  -0x20(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%eax
sub    0x18(%rbp),%eax
imul   $0x15180,%eax,%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
mov    0x40(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delta_t>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9d,%eax
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%ebx
mov    0x50(%rsp),%r13d
mov    0x60(%rsp),%r14d
mov    0x68(%rsp),%r15d
mov    0x70(%rsp),%r12d
lea    0x10(%rsp),%rbp
mov    $0x1,%esi
mov    $0x1,%edx
push   %rbp
push   %rax
call   1030 <date2epoch@plt>
add    $0x10,%rsp
lea    0x8(%rsp),%rax
mov    %r13d,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r14d,%ecx
mov    %r15d,%r8d
mov    %r12d,%r9d
push   %rax
mov    0x80(%rsp),%eax
push   %rax
call   1030 <date2epoch@plt>
add    $0x10,%rsp
movsd  0x10(%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
sub    0x58(%rsp),%ebx
imul   $0x15180,%ebx,%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm0,%xmm1
mov    0x80(%rsp),%rax
movsd  %xmm1,(%rax)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @delta_t(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, double* %12) {
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca double*
%27 = alloca double
%28 = alloca double
store i32 %0, i32* %14
store i32 %1, i32* %15
store i32 %2, i32* %16
store i32 %3, i32* %17
store i32 %4, i32* %18
store i32 %5, i32* %19
store i32 %6, i32* %20
store i32 %7, i32* %21
store i32 %8, i32* %22
store i32 %9, i32* %23
store i32 %10, i32* %24
store i32 %11, i32* %25
store double* %12, double** %26
%29 = load i32, i32* %14
%30 = load i32, i32* %16
%31 = load i32, i32* %17
%32 = load i32, i32* %18
%33 = load i32, i32* %19
%34 = call i32 @date2epoch(i32 %29, i32 1, i32 1, i32 %30, i32 %31, i32 %32, i32 %33, double* %27)
%35 = load i32, i32* %20
%36 = load i32, i32* %22
%37 = load i32, i32* %23
%38 = load i32, i32* %24
%39 = load i32, i32* %25
%40 = call i32 @date2epoch(i32 %35, i32 1, i32 1, i32 %36, i32 %37, i32 %38, i32 %39, double* %28)
%41 = load double, double* %27
%42 = load double, double* %28
%43 = fsub double %41, %42
%44 = load i32, i32* %15
%45 = load i32, i32* %21
%46 = sub nsw i32 %44, %45
%47 = mul nsw i32 %46, 86400
%48 = sitofp i32 %47 to double
%49 = fadd double %43, %48
%50 = load double*, double** %26
store double %49, double* %50
ret void
}

LLVM IR (-O2):
define void @delta_t(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, double* nocapture writeonly %12) {
%14 = alloca double
%15 = alloca double
%16 = bitcast double* %14 to i8*
%17 = bitcast double* %15 to i8*
%18 = call i32 @date2epoch(i32 %0, i32 1, i32 1, i32 %2, i32 %3, i32 %4, i32 %5, double* %14)
%19 = call i32 @date2epoch(i32 %6, i32 1, i32 1, i32 %8, i32 %9, i32 %10, i32 %11, double* %15)
%20 = load double, double* %14
%21 = load double, double* %15
%22 = fsub double %20, %21
%23 = sub nsw i32 %1, %7
%24 = mul nsw i32 %23, 86400
%25 = sitofp i32 %24 to double
%26 = fadd double %22, %25
store double %26, double* %12
ret void
}