void ts2i(tsec, iyr, imon, iday, ihr, imn, sec, ndsec) double tsec;
int *iyr;
int *imon;
int *iday;
int *ihr;
int *imn;
double *sec;
int ndsec;
{
  double t, days, ts, dts;
  int nc, nc4, nly, ny, m, im;
  ts = tsec + 61530883200.0;
  if (ts < 0.0)
    dts = -0.5;
  else
    dts = 0.5;
  if (ndsec < 1)
    t = dint(ts + dts) * 10000.0;
  else if (ndsec < 2)
    t = dint(ts * 10.0 + dts) * 1000.0;
  else if (ndsec < 3)
    t = dint(ts * 100.0 + dts) * 100.0;
  else if (ndsec < 4)
    t = dint(ts * 1000.0 + dts) * 10.0;
  else
    t = dint(ts * 10000.0 + dts);
  ts = t / 10000.0;
  *ihr = (int)(dmod(ts / 3600.0, 24.0));
  *imn = (int)(dmod(ts / 60.0, 60.0));
  *sec = dmod(ts, 60.0);
  days = dint((t / 864000000.0) + 0.000001);
  nc4 = (int)((days / 146097.0) + 0.00001);
  days = days - (146097.0 * (double)(nc4));
  nc = (int)((days / 36524.0) + 0.000001);
  if (nc > 3)
    nc = 3;
  days = days - (36524.0 * nc);
  nly = (int)((days / 1461.0) + 0.0000000001);
  days = days - (1461.0 * (double)nly);
  ny = (int)((days / 365.0) + 0.00000001);
  if (ny > 3)
    ny = 3;
  days = days - (365.0 * (double)ny);
  if (days < 0) {
    m = 0;
    *iday = 29;
  } else {
    *iday = (int)(days + 0.00000001) + 1;
    for (m = 1; m <= 12; m++) {
      im = (m + ((m - 1) / 5)) % 2;
      if (*iday - 1 < im + 30)
        break;
      *iday = *iday - im - 30;
    }
  }
  *imon = ((m + 1) % 12) + 1;
  *iyr = nc4 * 400 + nc * 100 + nly * 4 + ny + m / 11;
  fixdate(iyr, imon, iday, ihr, imn, sec, ndsec);
  return;
}


x86 assembly (clang, -O0):
<ts2i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x10(%rbp),%eax
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
movsd  0xe9d(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x50(%rbp),%xmm0
jbe    118d <ts2i+0x5d>
movsd  0xe8d(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    119a <ts2i+0x6a>
movsd  0xe73(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
cmpl   $0x1,0x10(%rbp)
jge    11cf <ts2i+0x9f>
movsd  -0x50(%rbp),%xmm0
addsd  -0x58(%rbp),%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe57(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    12d7 <ts2i+0x1a7>
cmpl   $0x2,0x10(%rbp)
jge    1214 <ts2i+0xe4>
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  0xe35(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe22(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    12d2 <ts2i+0x1a2>
cmpl   $0x3,0x10(%rbp)
jge    1259 <ts2i+0x129>
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  0xe00(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
cvtsi2sd %eax,%xmm0
movsd  0xde5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    12cd <ts2i+0x19d>
cmpl   $0x4,0x10(%rbp)
jge    129e <ts2i+0x16e>
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  0xdb3(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
cvtsi2sd %eax,%xmm0
movsd  0xd90(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    12c8 <ts2i+0x198>
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  0xd68(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    12cd <ts2i+0x19d>
jmp    12d2 <ts2i+0x1a2>
jmp    12d7 <ts2i+0x1a7>
movsd  -0x40(%rbp),%xmm0
movsd  0xd34(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  0xd7e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xd6a(%rip),%xmm1
mov    $0x2,%al
call   1050 <dmod@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x50(%rbp),%xmm0
movsd  0xd46(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xd3a(%rip),%xmm1
mov    $0x2,%al
call   1050 <dmod@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x50(%rbp),%xmm0
movsd  0xd1e(%rip),%xmm1
mov    $0x2,%al
call   1050 <dmod@plt>
cvtsi2sd %eax,%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
movsd  0xcf6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xcc2(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xcc1(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xcad(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x60(%rbp)
movsd  -0x48(%rbp),%xmm1
cvtsi2sdl -0x60(%rbp),%xmm0
movsd  0xc88(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xc66(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xc52(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x5c(%rbp)
cmpl   $0x3,-0x5c(%rbp)
jle    1402 <ts2i+0x2d2>
movl   $0x3,-0x5c(%rbp)
movsd  -0x48(%rbp),%xmm1
cvtsi2sdl -0x5c(%rbp),%xmm0
movsd  0xc94(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xc72(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xc5e(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x64(%rbp)
movsd  -0x48(%rbp),%xmm1
cvtsi2sdl -0x64(%rbp),%xmm0
movsd  0xc39(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xc17(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xc03(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x68(%rbp)
cmpl   $0x3,-0x68(%rbp)
jle    1499 <ts2i+0x369>
movl   $0x3,-0x68(%rbp)
movsd  -0x48(%rbp),%xmm1
cvtsi2sdl -0x68(%rbp),%xmm0
movsd  0xc05(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x48(%rbp),%xmm0
jbe    14dc <ts2i+0x3ac>
movl   $0x0,-0x6c(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x1d,(%rax)
jmp    156e <ts2i+0x43e>
movsd  0xb9c(%rip),%xmm0
addsd  -0x48(%rbp),%xmm0
cvttsd2si %xmm0,%ecx
add    $0x1,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x6c(%rbp)
cmpl   $0xc,-0x6c(%rbp)
jg     1569 <ts2i+0x439>
mov    -0x6c(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0x6c(%rbp),%eax
sub    $0x1,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x74(%rbp),%eax
add    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x70(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    -0x70(%rbp),%ecx
add    $0x1e,%ecx
cmp    %ecx,%eax
jge    1549 <ts2i+0x419>
jmp    1569 <ts2i+0x439>
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
sub    -0x70(%rbp),%ecx
sub    $0x1e,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    14fd <ts2i+0x3cd>
jmp    156e <ts2i+0x43e>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    -0x18(%rbp),%rax
mov    %edx,(%rax)
imul   $0x190,-0x60(%rbp),%ecx
imul   $0x64,-0x5c(%rbp),%eax
add    %eax,%ecx
mov    -0x64(%rbp),%eax
shl    $0x2,%eax
add    %eax,%ecx
add    -0x68(%rbp),%ecx
mov    -0x6c(%rbp),%eax
mov    $0xb,%esi
cltd
idiv   %esi
add    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
mov    0x10(%rbp),%eax
mov    %eax,(%rsp)
mov    $0x0,%al
call   1040 <fixdate@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts2i>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%rbp
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%rbx
mov    %rsi,%r13
mov    %rdi,%r14
addsd  0xea8(%rip),%xmm0
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
mov    0x50(%rsp),%edx
lea    0xf38(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm1
test   %edx,%edx
jle    11a5 <ts2i+0x75>
cmp    $0x1,%edx
jne    11c1 <ts2i+0x91>
mulsd  0xe92(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe70(%rip),%xmm0
jmp    122d <ts2i+0xfd>
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe49(%rip),%xmm0
jmp    122d <ts2i+0xfd>
cmp    $0x2,%edx
ja     11ea <ts2i+0xba>
mulsd  0xe52(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe38(%rip),%xmm0
jmp    122d <ts2i+0xfd>
cmp    $0x3,%edx
jne    1213 <ts2i+0xe3>
mulsd  0xe19(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe07(%rip),%xmm0
jmp    122d <ts2i+0xfd>
mulsd  0xded(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x10(%rsp)
divsd  0xdcd(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
divsd  0xddf(%rip),%xmm0
movsd  0xddf(%rip),%xmm1
mov    $0x2,%al
call   1050 <dmod@plt>
mov    %eax,(%r12)
movsd  0xdd4(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
divsd  %xmm1,%xmm0
mov    $0x2,%al
call   1050 <dmod@plt>
mov    %eax,(%r15)
movsd  0x8(%rsp),%xmm0
movsd  0xdb2(%rip),%xmm1
mov    $0x2,%al
call   1050 <dmod@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x0(%rbp)
movsd  0x10(%rsp),%xmm0
divsd  0xd99(%rip),%xmm0
addsd  0xd99(%rip),%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd %xmm0,%xmm1
divsd  0xd87(%rip),%xmm1
addsd  0xd87(%rip),%xmm1
cvttsd2si %xmm1,%r8d
cvttpd2dq %xmm1,%xmm1
cvtdq2pd %xmm1,%xmm1
mulsd  0xd7a(%rip),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
divsd  0xd72(%rip),%xmm0
addsd  0xd4a(%rip),%xmm0
cvttsd2si %xmm0,%edx
cmp    $0x3,%edx
mov    $0x3,%ecx
cmovge %ecx,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
mulsd  0xd54(%rip),%xmm0
addsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
divsd  0xd4c(%rip),%xmm1
addsd  0xd4c(%rip),%xmm1
cvttsd2si %xmm1,%r9d
cvttpd2dq %xmm1,%xmm1
cvtdq2pd %xmm1,%xmm1
mulsd  0xd3f(%rip),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
divsd  0xd37(%rip),%xmm0
addsd  0xd37(%rip),%xmm0
cvttsd2si %xmm0,%eax
cmp    $0x3,%eax
cmovl  %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mulsd  0xd26(%rip),%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1392 <ts2i+0x262>
movl   $0x1d,(%rbx)
xor    %edi,%edi
jmp    13ed <ts2i+0x2bd>
mov    %rbp,%r10
addsd  0xcfb(%rip),%xmm0
cvttsd2si %xmm0,%ebp
add    $0x1,%ebp
mov    %ebp,(%rbx)
mov    $0x1,%edi
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rdi),%eax
movsbl %al,%eax
imul   $0x67,%eax,%eax
movzwl %ax,%eax
mov    %eax,%esi
shr    $0xf,%esi
shr    $0x9,%eax
add    %sil,%al
movzbl %al,%eax
add    %edi,%eax
and    $0x1,%eax
lea    0x1e(%rax),%esi
cmp    %esi,%ebp
jle    13ea <ts2i+0x2ba>
sub    %eax,%ebp
add    $0xffffffe2,%ebp
mov    %ebp,(%rbx)
add    $0x1,%edi
cmp    $0xd,%edi
jne    13b0 <ts2i+0x280>
mov    $0xd,%edi
mov    %r10,%rbp
lea    0x1(%rdi),%eax
mov    $0xaaaaaaab,%esi
imul   %rax,%rsi
shr    $0x23,%rsi
shl    $0x2,%esi
lea    (%rsi,%rsi,2),%eax
neg    %eax
add    %edi,%eax
add    $0x2,%eax
mov    %eax,0x0(%r13)
imul   $0x190,%r8d,%eax
imul   $0x64,%edx,%edx
add    %eax,%edx
lea    (%rdx,%r9,4),%eax
add    %ecx,%eax
mov    %edi,%ecx
mov    $0xba2e8ba3,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    %eax,%edx
mov    %edx,(%r14)
mov    0x50(%rsp),%eax
mov    %eax,(%rsp)
mov    %r14,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
mov    %r12,%rcx
mov    %r15,%r8
mov    %rbp,%r9
xor    %eax,%eax
call   1040 <fixdate@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @ts2i(double %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, double* %6, i32 %7) {
%9 = alloca double
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca double*
%16 = alloca i32
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
store double %0, double* %9
store i32* %1, i32** %10
store i32* %2, i32** %11
store i32* %3, i32** %12
store i32* %4, i32** %13
store i32* %5, i32** %14
store double* %6, double** %15
store i32 %7, i32* %16
%27 = load double, double* %9
%28 = fadd double %27, 0x422CA70D89000000
store double %28, double* %19
%29 = load double, double* %19
%30 = fcmp olt double %29, 0.000000e+00
br i1 %30, label %31, label %32
31: ; preds = %8
store double -5.000000e-01, double* %20
br label %33
32: ; preds = %8
store double 5.000000e-01, double* %20
br label %33
33: ; preds = %32, %31
%34 = load i32, i32* %16
%35 = icmp slt i32 %34, 1
br i1 %35, label %36, label %43
36: ; preds = %33
%37 = load double, double* %19
%38 = load double, double* %20
%39 = fadd double %37, %38
%40 = call i32 (double, ...) bitcast (i32 (...)* @dint to i32 (double, ...)*)(double %39)
%41 = sitofp i32 %40 to double
%42 = fmul double %41, 1.000000e+04
store double %42, double* %17
br label %82
43: ; preds = %33
%44 = load i32, i32* %16
%45 = icmp slt i32 %44, 2
br i1 %45, label %46, label %53
46: ; preds = %43
%47 = load double, double* %19
%48 = load double, double* %20
%49 = call double @llvm.fmuladd.f64(double %47, double 1.000000e+01, double %48)
%50 = call i32 (double, ...) bitcast (i32 (...)* @dint to i32 (double, ...)*)(double %49)
%51 = sitofp i32 %50 to double
%52 = fmul double %51, 1.000000e+03
store double %52, double* %17
br label %81
53: ; preds = %43
%54 = load i32, i32* %16
%55 = icmp slt i32 %54, 3
br i1 %55, label %56, label %63
56: ; preds = %53
%57 = load double, double* %19
%58 = load double, double* %20
%59 = call double @llvm.fmuladd.f64(double %57, double 1.000000e+02, double %58)
%60 = call i32 (double, ...) bitcast (i32 (...)* @dint to i32 (double, ...)*)(double %59)
%61 = sitofp i32 %60 to double
%62 = fmul double %61, 1.000000e+02
store double %62, double* %17
br label %80
63: ; preds = %53
%64 = load i32, i32* %16
%65 = icmp slt i32 %64, 4
br i1 %65, label %66, label %73
66: ; preds = %63
%67 = load double, double* %19
%68 = load double, double* %20
%69 = call double @llvm.fmuladd.f64(double %67, double 1.000000e+03, double %68)
%70 = call i32 (double, ...) bitcast (i32 (...)* @dint to i32 (double, ...)*)(double %69)
%71 = sitofp i32 %70 to double
%72 = fmul double %71, 1.000000e+01
store double %72, double* %17
br label %79
73: ; preds = %63
%74 = load double, double* %19
%75 = load double, double* %20
%76 = call double @llvm.fmuladd.f64(double %74, double 1.000000e+04, double %75)
%77 = call i32 (double, ...) bitcast (i32 (...)* @dint to i32 (double, ...)*)(double %76)
%78 = sitofp i32 %77 to double
store double %78, double* %17
br label %79
79: ; preds = %73, %66
br label %80
80: ; preds = %79, %56
br label %81
81: ; preds = %80, %46
br label %82
82: ; preds = %81, %36
%83 = load double, double* %17
%84 = fdiv double %83, 1.000000e+04
store double %84, double* %19
%85 = load double, double* %19
%86 = fdiv double %85, 3.600000e+03
%87 = call i32 (double, double, ...) bitcast (i32 (...)* @dmod to i32 (double, double, ...)*)(double %86, double 2.400000e+01)
%88 = load i32*, i32** %13
store i32 %87, i32* %88
%89 = load double, double* %19
%90 = fdiv double %89, 6.000000e+01
%91 = call i32 (double, double, ...) bitcast (i32 (...)* @dmod to i32 (double, double, ...)*)(double %90, double 6.000000e+01)
%92 = load i32*, i32** %14
store i32 %91, i32* %92
%93 = load double, double* %19
%94 = call i32 (double, double, ...) bitcast (i32 (...)* @dmod to i32 (double, double, ...)*)(double %93, double 6.000000e+01)
%95 = sitofp i32 %94 to double
%96 = load double*, double** %15
store double %95, double* %96
%97 = load double, double* %17
%98 = fdiv double %97, 8.640000e+08
%99 = fadd double %98, 0x3EB0C6F7A0B5ED8D
%100 = call i32 (double, ...) bitcast (i32 (...)* @dint to i32 (double, ...)*)(double %99)
%101 = sitofp i32 %100 to double
store double %101, double* %18
%102 = load double, double* %18
%103 = fdiv double %102, 1.460970e+05
%104 = fadd double %103, 1.000000e-05
%105 = fptosi double %104 to i32
store i32 %105, i32* %22
%106 = load double, double* %18
%107 = load i32, i32* %22
%108 = sitofp i32 %107 to double
%109 = call double @llvm.fmuladd.f64(double -1.460970e+05, double %108, double %106)
store double %109, double* %18
%110 = load double, double* %18
%111 = fdiv double %110, 3.652400e+04
%112 = fadd double %111, 0x3EB0C6F7A0B5ED8D
%113 = fptosi double %112 to i32
store i32 %113, i32* %21
%114 = load i32, i32* %21
%115 = icmp sgt i32 %114, 3
br i1 %115, label %116, label %117
116: ; preds = %82
store i32 3, i32* %21
br label %117
117: ; preds = %116, %82
%118 = load double, double* %18
%119 = load i32, i32* %21
%120 = sitofp i32 %119 to double
%121 = call double @llvm.fmuladd.f64(double -3.652400e+04, double %120, double %118)
store double %121, double* %18
%122 = load double, double* %18
%123 = fdiv double %122, 1.461000e+03
%124 = fadd double %123, 1.000000e-10
%125 = fptosi double %124 to i32
store i32 %125, i32* %23
%126 = load double, double* %18
%127 = load i32, i32* %23
%128 = sitofp i32 %127 to double
%129 = call double @llvm.fmuladd.f64(double -1.461000e+03, double %128, double %126)
store double %129, double* %18
%130 = load double, double* %18
%131 = fdiv double %130, 3.650000e+02
%132 = fadd double %131, 1.000000e-08
%133 = fptosi double %132 to i32
store i32 %133, i32* %24
%134 = load i32, i32* %24
%135 = icmp sgt i32 %134, 3
br i1 %135, label %136, label %137
136: ; preds = %117
store i32 3, i32* %24
br label %137
137: ; preds = %136, %117
%138 = load double, double* %18
%139 = load i32, i32* %24
%140 = sitofp i32 %139 to double
%141 = call double @llvm.fmuladd.f64(double -3.650000e+02, double %140, double %138)
store double %141, double* %18
%142 = load double, double* %18
%143 = fcmp olt double %142, 0.000000e+00
br i1 %143, label %144, label %146
144: ; preds = %137
store i32 0, i32* %25
%145 = load i32*, i32** %12
store i32 29, i32* %145
br label %180
146: ; preds = %137
%147 = load double, double* %18
%148 = fadd double %147, 1.000000e-08
%149 = fptosi double %148 to i32
%150 = add nsw i32 %149, 1
%151 = load i32*, i32** %12
store i32 %150, i32* %151
store i32 1, i32* %25
br label %152
152: ; preds = %176, %146
%153 = load i32, i32* %25
%154 = icmp sle i32 %153, 12
br i1 %154, label %155, label %179
155: ; preds = %152
%156 = load i32, i32* %25
%157 = load i32, i32* %25
%158 = sub nsw i32 %157, 1
%159 = sdiv i32 %158, 5
%160 = add nsw i32 %156, %159
%161 = srem i32 %160, 2
store i32 %161, i32* %26
%162 = load i32*, i32** %12
%163 = load i32, i32* %162
%164 = sub nsw i32 %163, 1
%165 = load i32, i32* %26
%166 = add nsw i32 %165, 30
%167 = icmp slt i32 %164, %166
br i1 %167, label %168, label %169
168: ; preds = %155
br label %179
169: ; preds = %155
%170 = load i32*, i32** %12
%171 = load i32, i32* %170
%172 = load i32, i32* %26
%173 = sub nsw i32 %171, %172
%174 = sub nsw i32 %173, 30
%175 = load i32*, i32** %12
store i32 %174, i32* %175
br label %176
176: ; preds = %169
%177 = load i32, i32* %25
%178 = add nsw i32 %177, 1
store i32 %178, i32* %25
br label %152
179: ; preds = %168, %152
br label %180
180: ; preds = %179, %144
%181 = load i32, i32* %25
%182 = add nsw i32 %181, 1
%183 = srem i32 %182, 12
%184 = add nsw i32 %183, 1
%185 = load i32*, i32** %11
store i32 %184, i32* %185
%186 = load i32, i32* %22
%187 = mul nsw i32 %186, 400
%188 = load i32, i32* %21
%189 = mul nsw i32 %188, 100
%190 = add nsw i32 %187, %189
%191 = load i32, i32* %23
%192 = mul nsw i32 %191, 4
%193 = add nsw i32 %190, %192
%194 = load i32, i32* %24
%195 = add nsw i32 %193, %194
%196 = load i32, i32* %25
%197 = sdiv i32 %196, 11
%198 = add nsw i32 %195, %197
%199 = load i32*, i32** %10
store i32 %198, i32* %199
%200 = load i32*, i32** %10
%201 = load i32*, i32** %11
%202 = load i32*, i32** %12
%203 = load i32*, i32** %13
%204 = load i32*, i32** %14
%205 = load double*, double** %15
%206 = load i32, i32* %16
%207 = call i32 (i32*, i32*, i32*, i32*, i32*, double*, i32, ...) bitcast (i32 (...)* @fixdate to i32 (i32*, i32*, i32*, i32*, i32*, double*, i32, ...)*)(i32* %200, i32* %201, i32* %202, i32* %203, i32* %204, double* %205, i32 %206)
ret void
}

LLVM IR (-O2):
define void @ts2i(double %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, double* %6, i32 %7) {
%9 = fadd double %0, 0x422CA70D89000000
%10 = fcmp olt double %9, 0.000000e+00
%11 = select i1 %10, double -5.000000e-01, double 5.000000e-01
%12 = icmp slt i32 %7, 1
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = fadd double %9, %11
%15 = tail call i32 (double, ...) bitcast (i32 (...)* @dint to i32 (double, ...)*)(double %14)
%16 = sitofp i32 %15 to double
%17 = fmul double %16, 1.000000e+04
br label %43
18: ; preds = %8
%19 = icmp eq i32 %7, 1
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = tail call double @llvm.fmuladd.f64(double %9, double 1.000000e+01, double %11)
%22 = tail call i32 (double, ...) bitcast (i32 (...)* @dint to i32 (double, ...)*)(double %21)
%23 = sitofp i32 %22 to double
%24 = fmul double %23, 1.000000e+03
br label %43
25: ; preds = %18
%26 = icmp ult i32 %7, 3
br i1 %26, label %27, label %32
27: ; preds = %25
%28 = tail call double @llvm.fmuladd.f64(double %9, double 1.000000e+02, double %11)
%29 = tail call i32 (double, ...) bitcast (i32 (...)* @dint to i32 (double, ...)*)(double %28)
%30 = sitofp i32 %29 to double
%31 = fmul double %30, 1.000000e+02
br label %43
32: ; preds = %25
%33 = icmp eq i32 %7, 3
br i1 %33, label %34, label %39
34: ; preds = %32
%35 = tail call double @llvm.fmuladd.f64(double %9, double 1.000000e+03, double %11)
%36 = tail call i32 (double, ...) bitcast (i32 (...)* @dint to i32 (double, ...)*)(double %35)
%37 = sitofp i32 %36 to double
%38 = fmul double %37, 1.000000e+01
br label %43
39: ; preds = %32
%40 = tail call double @llvm.fmuladd.f64(double %9, double 1.000000e+04, double %11)
%41 = tail call i32 (double, ...) bitcast (i32 (...)* @dint to i32 (double, ...)*)(double %40)
%42 = sitofp i32 %41 to double
br label %43
43: ; preds = %20, %34, %39, %27, %13
%44 = phi double [ %17, %13 ], [ %24, %20 ], [ %31, %27 ], [ %38, %34 ], [ %42, %39 ]
%45 = fdiv double %44, 1.000000e+04
%46 = fdiv double %45, 3.600000e+03
%47 = tail call i32 (double, double, ...) bitcast (i32 (...)* @dmod to i32 (double, double, ...)*)(double %46, double 2.400000e+01)
store i32 %47, i32* %4
%48 = fdiv double %45, 6.000000e+01
%49 = tail call i32 (double, double, ...) bitcast (i32 (...)* @dmod to i32 (double, double, ...)*)(double %48, double 6.000000e+01)
store i32 %49, i32* %5
%50 = tail call i32 (double, double, ...) bitcast (i32 (...)* @dmod to i32 (double, double, ...)*)(double %45, double 6.000000e+01)
%51 = sitofp i32 %50 to double
store double %51, double* %6
%52 = fdiv double %44, 8.640000e+08
%53 = fadd double %52, 0x3EB0C6F7A0B5ED8D
%54 = tail call i32 (double, ...) bitcast (i32 (...)* @dint to i32 (double, ...)*)(double %53)
%55 = sitofp i32 %54 to double
%56 = fdiv double %55, 1.460970e+05
%57 = fadd double %56, 1.000000e-05
%58 = fptosi double %57 to i32
%59 = sitofp i32 %58 to double
%60 = tail call double @llvm.fmuladd.f64(double %59, double -1.460970e+05, double %55)
%61 = fdiv double %60, 3.652400e+04
%62 = fadd double %61, 0x3EB0C6F7A0B5ED8D
%63 = fptosi double %62 to i32
%64 = icmp slt i32 %63, 3
%65 = select i1 %64, i32 %63, i32 3
%66 = sitofp i32 %65 to double
%67 = tail call double @llvm.fmuladd.f64(double %66, double -3.652400e+04, double %60)
%68 = fdiv double %67, 1.461000e+03
%69 = fadd double %68, 1.000000e-10
%70 = fptosi double %69 to i32
%71 = sitofp i32 %70 to double
%72 = tail call double @llvm.fmuladd.f64(double %71, double -1.461000e+03, double %67)
%73 = fdiv double %72, 3.650000e+02
%74 = fadd double %73, 1.000000e-08
%75 = fptosi double %74 to i32
%76 = icmp slt i32 %75, 3
%77 = select i1 %76, i32 %75, i32 3
%78 = sitofp i32 %77 to double
%79 = tail call double @llvm.fmuladd.f64(double %78, double -3.650000e+02, double %72)
%80 = fcmp olt double %79, 0.000000e+00
br i1 %80, label %81, label %82
81: ; preds = %43
store i32 29, i32* %3
br label %102
82: ; preds = %43
%83 = fadd double %79, 1.000000e-08
%84 = fptosi double %83 to i32
%85 = add nsw i32 %84, 1
store i32 %85, i32* %3
br label %86
86: ; preds = %82, %97
%87 = phi i32 [ %85, %82 ], [ %99, %97 ]
%88 = phi i32 [ 1, %82 ], [ %100, %97 ]
%89 = trunc i32 %88 to i8
%90 = add i8 %89, -1
%91 = sdiv i8 %90, 5
%92 = add i8 %91, %89
%93 = and i8 %92, 1
%94 = zext i8 %93 to i32
%95 = or i32 %94, 30
%96 = icmp sgt i32 %87, %95
br i1 %96, label %97, label %102
97: ; preds = %86
%98 = sub nuw nsw i32 -30, %94
%99 = add i32 %98, %87
store i32 %99, i32* %3
%100 = add nuw nsw i32 %88, 1
%101 = icmp eq i32 %100, 13
br i1 %101, label %102, label %86
102: ; preds = %97, %86, %81
%103 = phi i32 [ 0, %81 ], [ %88, %86 ], [ 13, %97 ]
%104 = add nuw nsw i32 %103, 1
%105 = urem i32 %104, 12
%106 = add nuw nsw i32 %105, 1
store i32 %106, i32* %2
%107 = mul nsw i32 %58, 400
%108 = mul nsw i32 %65, 100
%109 = add nsw i32 %108, %107
%110 = shl nsw i32 %70, 2
%111 = add nsw i32 %109, %110
%112 = add nsw i32 %111, %77
%113 = udiv i32 %103, 11
%114 = add nsw i32 %112, %113
store i32 %114, i32* %1
%115 = tail call i32 (i32*, i32*, i32*, i32*, i32*, double*, i32, ...) bitcast (i32 (...)* @fixdate to i32 (i32*, i32*, i32*, i32*, i32*, double*, i32, ...)*)(i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, double* %6, i32 %7)
ret void
}