void jd2i(dj, iyr, imon, iday, ihr, imn, sec, ndsec) double dj;
int *iyr;
int *imon;
int *iday;
int *ihr;
int *imn;
double *sec;
int ndsec;
{
  double tsec;
  double frac, dts, ts, sday;
  int jd, l, n, i, j;
  tsec = jd2ts(dj);
  if (tsec < 0.0)
    dts = -0.5;
  else
    dts = 0.5;
  if (ndsec < 1)
    ts = dint(tsec + dts);
  else if (ndsec < 2)
    ts = dint(tsec * 10.0 + dts) / 10.0;
  else if (ndsec < 3)
    ts = dint(tsec * 100.0 + dts) / 100.0;
  else if (ndsec < 4)
    ts = dint(tsec * 1000.0 + dts) / 1000.0;
  else
    ts = dint(tsec * 10000.0 + dts) / 10000.0;
  dj = ts2jd(ts);
  frac = dmod(dj, 1.0);
  if (frac < 0.5) {
    jd = (int)(dj - frac);
    sday = (frac + 0.5) * 86400.0;
  } else {
    jd = (int)(dj - frac) + 1;
    sday = (frac - 0.5) * 86400.0;
  }
  *ihr = (int)(sday / 3600.0);
  sday = sday - (double)(*ihr * 3600);
  *imn = (int)(sday / 60.0);
  *sec = sday - (double)(*imn * 60);
  l = jd + 68569;
  n = (4 * l) / 146097;
  l = l - (146097 * n + 3) / 4;
  i = (4000 * (l + 1)) / 1461001;
  l = l - (1461 * i) / 4 + 31;
  j = (80 * l) / 2447;
  *iday = l - (2447 * j) / 80;
  l = j / 11;
  *imon = j + 2 - (12 * l);
  *iyr = 100 * (n - 49) + i + l;
  return;
}


x86 assembly (clang, -O0):
<jd2i>:
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  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1040 <jd2ts@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    11a0 <jd2i+0x60>
movsd  0xe72(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    11ad <jd2i+0x6d>
movsd  0xe58(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
cmpl   $0x1,0x10(%rbp)
jge    11d6 <jd2i+0x96>
movsd  -0x40(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    12ea <jd2i+0x1aa>
cmpl   $0x2,0x10(%rbp)
jge    121b <jd2i+0xdb>
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  0xe36(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe1b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    12e5 <jd2i+0x1a5>
cmpl   $0x3,0x10(%rbp)
jge    1260 <jd2i+0x120>
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  0xde9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
cvtsi2sd %eax,%xmm0
movsd  0xdce(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    12e0 <jd2i+0x1a0>
cmpl   $0x4,0x10(%rbp)
jge    12a5 <jd2i+0x165>
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  0xd9c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
cvtsi2sd %eax,%xmm0
movsd  0xd81(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    12db <jd2i+0x19b>
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  0xd59(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
cvtsi2sd %eax,%xmm0
movsd  0xd3e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    12e0 <jd2i+0x1a0>
jmp    12e5 <jd2i+0x1a5>
jmp    12ea <jd2i+0x1aa>
movsd  -0x58(%rbp),%xmm0
mov    $0x1,%al
call   1060 <ts2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xd24(%rip),%xmm1
mov    $0x2,%al
call   1050 <dmod@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xcdc(%rip),%xmm0
ucomisd -0x48(%rbp),%xmm0
jbe    1363 <jd2i+0x223>
movsd  -0x8(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x64(%rbp)
movsd  0xcb8(%rip),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  0xce3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1399 <jd2i+0x259>
movsd  -0x8(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
cvttsd2si %xmm0,%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xc7c(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xca8(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0xca2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x60(%rbp),%xmm0
mov    -0x28(%rbp),%rax
imul   $0xe10,(%rax),%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0xc63(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x60(%rbp),%xmm0
mov    -0x30(%rbp),%rax
imul   $0x3c,(%rax),%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x64(%rbp),%eax
add    $0x10bd9,%eax
mov    %eax,-0x68(%rbp)
mov    -0x68(%rbp),%eax
shl    $0x2,%eax
mov    $0x23ab1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x6c(%rbp)
mov    -0x68(%rbp),%eax
mov    %eax,-0x7c(%rbp)
imul   $0x23ab1,-0x6c(%rbp),%eax
add    $0x3,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x7c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x68(%rbp)
mov    -0x68(%rbp),%eax
add    $0x1,%eax
imul   $0xfa0,%eax,%eax
mov    $0x164b09,%ecx
cltd
idiv   %ecx
mov    %eax,-0x70(%rbp)
mov    -0x68(%rbp),%eax
mov    %eax,-0x78(%rbp)
imul   $0x5b5,-0x70(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x78(%rbp),%eax
sub    %ecx,%eax
add    $0x1f,%eax
mov    %eax,-0x68(%rbp)
imul   $0x50,-0x68(%rbp),%eax
mov    $0x98f,%ecx
cltd
idiv   %ecx
mov    %eax,-0x74(%rbp)
mov    -0x68(%rbp),%ecx
imul   $0x98f,-0x74(%rbp),%eax
mov    $0x50,%esi
cltd
idiv   %esi
sub    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x74(%rbp),%eax
mov    $0xb,%ecx
cltd
idiv   %ecx
mov    %eax,-0x68(%rbp)
mov    -0x74(%rbp),%ecx
add    $0x2,%ecx
imul   $0xc,-0x68(%rbp),%eax
sub    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x6c(%rbp),%eax
sub    $0x31,%eax
imul   $0x64,%eax,%ecx
add    -0x70(%rbp),%ecx
add    -0x68(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jd2i>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%r13
mov    %r8,%rbx
mov    %rcx,%rbp
mov    %rdx,%r12
mov    %rsi,%r15
mov    %rdi,0x10(%rsp)
mov    0x50(%rsp),%r14d
mov    $0x1,%al
call   1040 <jd2ts@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
shr    $0x1f,%eax
lea    0xe81(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm1
test   %r14d,%r14d
jle    11b6 <jd2i+0x76>
cmp    $0x1,%r14d
jne    11ce <jd2i+0x8e>
mulsd  0xea1(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xe87(%rip),%xmm0
jmp    1244 <jd2i+0x104>
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
jmp    1244 <jd2i+0x104>
cmp    $0x2,%r14d
ja     11f8 <jd2i+0xb8>
mulsd  0xe54(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xe3a(%rip),%xmm0
jmp    1244 <jd2i+0x104>
cmp    $0x3,%r14d
jne    1222 <jd2i+0xe2>
mulsd  0xe22(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xe08(%rip),%xmm0
jmp    1244 <jd2i+0x104>
mulsd  0xdf6(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <dint@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xddc(%rip),%xmm0
mov    $0x1,%al
call   1060 <ts2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xde0(%rip),%xmm1
mov    $0x2,%al
call   1050 <dmod@plt>
xor    %edx,%edx
xor    %ecx,%ecx
test   %eax,%eax
setle  %dl
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
setg   %cl
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
lea    (%rax,%rcx,1),%esi
lea    0xd7e(%rip),%rdi
addsd  (%rdi,%rdx,8),%xmm0
mulsd  0xda9(%rip),%xmm0
movapd %xmm0,%xmm1
divsd  0xda5(%rip),%xmm1
cvttsd2si %xmm1,%edx
imul   $0xe10,%edx,%edi
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
subsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
divsd  0xd8c(%rip),%xmm1
cvttsd2si %xmm1,%edi
mov    %edx,0x0(%rbp)
imul   $0x3c,%edi,%edx
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
mov    %edi,(%rbx)
subsd  %xmm1,%xmm0
lea    (%rax,%rcx,1),%edx
add    $0x10bd9,%edx
lea    0x42f64(,%rsi,4),%eax
cltq
imul   $0x396b06bd,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
sar    $0xf,%eax
add    %ecx,%eax
imul   $0x23ab1,%eax,%ecx
lea    0x3(%rcx),%esi
add    $0x6,%ecx
test   %esi,%esi
cmovns %esi,%ecx
sar    $0x2,%ecx
sub    %ecx,%edx
imul   $0xfa0,%edx,%ecx
mov    %ecx,%esi
add    $0xfa0,%esi
movslq %esi,%rsi
imul   $0xffffffffb7bbe2dd,%rsi,%rsi
shr    $0x20,%rsi
add    %esi,%ecx
add    $0xfa0,%ecx
mov    %ecx,%esi
shr    $0x1f,%esi
sar    $0x14,%ecx
add    %esi,%ecx
imul   $0x5b5,%ecx,%esi
lea    0x3(%rsi),%edi
test   %esi,%esi
cmovns %esi,%edi
movsd  %xmm0,0x0(%r13)
sar    $0x2,%edi
neg    %edi
add    %edx,%edi
add    $0x1f,%edi
mov    %edi,%edx
shl    $0x4,%edx
lea    (%rdx,%rdx,4),%edx
movslq %edx,%rdx
imul   $0x1ac83d19,%rdx,%rsi
mov    %rsi,%rbp
shr    $0x3f,%rbp
shr    $0x20,%rsi
sar    $0x8,%esi
add    %ebp,%esi
imul   $0x98f,%esi,%ebp
movslq %ebp,%rbp
imul   $0xffffffff99999999,%rbp,%rbp
mov    %rbp,%rbx
shr    $0x3f,%rbx
shr    $0x20,%rbp
sar    $0x5,%ebp
add    %ebx,%ebp
add    %edi,%ebp
mov    %ebp,(%r12)
imul   $0xffffffff9bd2d7d7,%rdx,%rdi
shr    $0x20,%rdi
add    %edi,%edx
mov    %edx,%edi
shr    $0x1f,%edi
sar    $0xe,%edx
add    %edi,%edx
lea    0x0(,%rdx,4),%edi
lea    (%rdi,%rdi,2),%edi
sub    %edi,%esi
add    $0x2,%esi
mov    %esi,(%r15)
imul   $0x64,%eax,%eax
add    %ecx,%eax
add    %edx,%eax
add    $0xffffecdc,%eax
mov    0x10(%rsp),%rcx
mov    %eax,(%rcx)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @jd2i(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 double
%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 = call i32 (double, ...) bitcast (i32 (...)* @jd2ts to i32 (double, ...)*)(double %27)
%29 = sitofp i32 %28 to double
store double %29, double* %17
%30 = load double, double* %17
%31 = fcmp olt double %30, 0.000000e+00
br i1 %31, label %32, label %33
32: ; preds = %8
store double -5.000000e-01, double* %19
br label %34
33: ; preds = %8
store double 5.000000e-01, double* %19
br label %34
34: ; preds = %33, %32
%35 = load i32, i32* %16
%36 = icmp slt i32 %35, 1
br i1 %36, label %37, label %43
37: ; preds = %34
%38 = load double, double* %17
%39 = load double, double* %19
%40 = fadd double %38, %39
%41 = call i32 (double, ...) bitcast (i32 (...)* @dint to i32 (double, ...)*)(double %40)
%42 = sitofp i32 %41 to double
store double %42, double* %20
br label %83
43: ; preds = %34
%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* %17
%48 = load double, double* %19
%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 = fdiv double %51, 1.000000e+01
store double %52, double* %20
br label %82
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* %17
%58 = load double, double* %19
%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 = fdiv double %61, 1.000000e+02
store double %62, double* %20
br label %81
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* %17
%68 = load double, double* %19
%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 = fdiv double %71, 1.000000e+03
store double %72, double* %20
br label %80
73: ; preds = %63
%74 = load double, double* %17
%75 = load double, double* %19
%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
%79 = fdiv double %78, 1.000000e+04
store double %79, double* %20
br label %80
80: ; preds = %73, %66
br label %81
81: ; preds = %80, %56
br label %82
82: ; preds = %81, %46
br label %83
83: ; preds = %82, %37
%84 = load double, double* %20
%85 = call i32 (double, ...) bitcast (i32 (...)* @ts2jd to i32 (double, ...)*)(double %84)
%86 = sitofp i32 %85 to double
store double %86, double* %9
%87 = load double, double* %9
%88 = call i32 (double, double, ...) bitcast (i32 (...)* @dmod to i32 (double, double, ...)*)(double %87, double 1.000000e+00)
%89 = sitofp i32 %88 to double
store double %89, double* %18
%90 = load double, double* %18
%91 = fcmp olt double %90, 5.000000e-01
br i1 %91, label %92, label %100
92: ; preds = %83
%93 = load double, double* %9
%94 = load double, double* %18
%95 = fsub double %93, %94
%96 = fptosi double %95 to i32
store i32 %96, i32* %22
%97 = load double, double* %18
%98 = fadd double %97, 5.000000e-01
%99 = fmul double %98, 8.640000e+04
store double %99, double* %21
br label %109
100: ; preds = %83
%101 = load double, double* %9
%102 = load double, double* %18
%103 = fsub double %101, %102
%104 = fptosi double %103 to i32
%105 = add nsw i32 %104, 1
store i32 %105, i32* %22
%106 = load double, double* %18
%107 = fsub double %106, 5.000000e-01
%108 = fmul double %107, 8.640000e+04
store double %108, double* %21
br label %109
109: ; preds = %100, %92
%110 = load double, double* %21
%111 = fdiv double %110, 3.600000e+03
%112 = fptosi double %111 to i32
%113 = load i32*, i32** %13
store i32 %112, i32* %113
%114 = load double, double* %21
%115 = load i32*, i32** %13
%116 = load i32, i32* %115
%117 = mul nsw i32 %116, 3600
%118 = sitofp i32 %117 to double
%119 = fsub double %114, %118
store double %119, double* %21
%120 = load double, double* %21
%121 = fdiv double %120, 6.000000e+01
%122 = fptosi double %121 to i32
%123 = load i32*, i32** %14
store i32 %122, i32* %123
%124 = load double, double* %21
%125 = load i32*, i32** %14
%126 = load i32, i32* %125
%127 = mul nsw i32 %126, 60
%128 = sitofp i32 %127 to double
%129 = fsub double %124, %128
%130 = load double*, double** %15
store double %129, double* %130
%131 = load i32, i32* %22
%132 = add nsw i32 %131, 68569
store i32 %132, i32* %23
%133 = load i32, i32* %23
%134 = mul nsw i32 4, %133
%135 = sdiv i32 %134, 146097
store i32 %135, i32* %24
%136 = load i32, i32* %23
%137 = load i32, i32* %24
%138 = mul nsw i32 146097, %137
%139 = add nsw i32 %138, 3
%140 = sdiv i32 %139, 4
%141 = sub nsw i32 %136, %140
store i32 %141, i32* %23
%142 = load i32, i32* %23
%143 = add nsw i32 %142, 1
%144 = mul nsw i32 4000, %143
%145 = sdiv i32 %144, 1461001
store i32 %145, i32* %25
%146 = load i32, i32* %23
%147 = load i32, i32* %25
%148 = mul nsw i32 1461, %147
%149 = sdiv i32 %148, 4
%150 = sub nsw i32 %146, %149
%151 = add nsw i32 %150, 31
store i32 %151, i32* %23
%152 = load i32, i32* %23
%153 = mul nsw i32 80, %152
%154 = sdiv i32 %153, 2447
store i32 %154, i32* %26
%155 = load i32, i32* %23
%156 = load i32, i32* %26
%157 = mul nsw i32 2447, %156
%158 = sdiv i32 %157, 80
%159 = sub nsw i32 %155, %158
%160 = load i32*, i32** %12
store i32 %159, i32* %160
%161 = load i32, i32* %26
%162 = sdiv i32 %161, 11
store i32 %162, i32* %23
%163 = load i32, i32* %26
%164 = add nsw i32 %163, 2
%165 = load i32, i32* %23
%166 = mul nsw i32 12, %165
%167 = sub nsw i32 %164, %166
%168 = load i32*, i32** %11
store i32 %167, i32* %168
%169 = load i32, i32* %24
%170 = sub nsw i32 %169, 49
%171 = mul nsw i32 100, %170
%172 = load i32, i32* %25
%173 = add nsw i32 %171, %172
%174 = load i32, i32* %23
%175 = add nsw i32 %173, %174
%176 = load i32*, i32** %10
store i32 %175, i32* %176
ret void
}

LLVM IR (-O2):
define void @jd2i(double %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5, double* nocapture writeonly %6, i32 %7) {
%9 = tail call i32 (double, ...) bitcast (i32 (...)* @jd2ts to i32 (double, ...)*)(double %0)
%10 = sitofp i32 %9 to double
%11 = icmp slt i32 %9, 0
%12 = select i1 %11, double -5.000000e-01, double 5.000000e-01
%13 = icmp slt i32 %7, 1
br i1 %13, label %14, label %18
14: ; preds = %8
%15 = fadd double %12, %10
%16 = tail call i32 (double, ...) bitcast (i32 (...)* @dint to i32 (double, ...)*)(double %15)
%17 = sitofp i32 %16 to double
br label %44
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 %10, double 1.000000e+01, double %12)
%22 = tail call i32 (double, ...) bitcast (i32 (...)* @dint to i32 (double, ...)*)(double %21)
%23 = sitofp i32 %22 to double
%24 = fdiv double %23, 1.000000e+01
br label %44
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 %10, double 1.000000e+02, double %12)
%29 = tail call i32 (double, ...) bitcast (i32 (...)* @dint to i32 (double, ...)*)(double %28)
%30 = sitofp i32 %29 to double
%31 = fdiv double %30, 1.000000e+02
br label %44
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 %10, double 1.000000e+03, double %12)
%36 = tail call i32 (double, ...) bitcast (i32 (...)* @dint to i32 (double, ...)*)(double %35)
%37 = sitofp i32 %36 to double
%38 = fdiv double %37, 1.000000e+03
br label %44
39: ; preds = %32
%40 = tail call double @llvm.fmuladd.f64(double %10, double 1.000000e+04, double %12)
%41 = tail call i32 (double, ...) bitcast (i32 (...)* @dint to i32 (double, ...)*)(double %40)
%42 = sitofp i32 %41 to double
%43 = fdiv double %42, 1.000000e+04
br label %44
44: ; preds = %20, %34, %39, %27, %14
%45 = phi double [ %17, %14 ], [ %24, %20 ], [ %31, %27 ], [ %38, %34 ], [ %43, %39 ]
%46 = tail call i32 (double, ...) bitcast (i32 (...)* @ts2jd to i32 (double, ...)*)(double %45)
%47 = sitofp i32 %46 to double
%48 = tail call i32 (double, double, ...) bitcast (i32 (...)* @dmod to i32 (double, double, ...)*)(double %47, double 1.000000e+00)
%49 = sitofp i32 %48 to double
%50 = icmp slt i32 %48, 1
%51 = fsub double %47, %49
%52 = fptosi double %51 to i32
%53 = select i1 %50, double 5.000000e-01, double -5.000000e-01
%54 = xor i1 %50, true
%55 = zext i1 %54 to i32
%56 = add nsw i32 %52, %55
%57 = fadd double %53, %49
%58 = fmul double %57, 8.640000e+04
%59 = fdiv double %58, 3.600000e+03
%60 = fptosi double %59 to i32
store i32 %60, i32* %4
%61 = mul nsw i32 %60, 3600
%62 = sitofp i32 %61 to double
%63 = fsub double %58, %62
%64 = fdiv double %63, 6.000000e+01
%65 = fptosi double %64 to i32
store i32 %65, i32* %5
%66 = mul nsw i32 %65, 60
%67 = sitofp i32 %66 to double
%68 = fsub double %63, %67
store double %68, double* %6
%69 = add nsw i32 %56, 68569
%70 = shl nsw i32 %69, 2
%71 = sdiv i32 %70, 146097
%72 = mul nsw i32 %71, 146097
%73 = add nsw i32 %72, 3
%74 = sdiv i32 %73, -4
%75 = add i32 %74, %69
%76 = mul i32 %75, 4000
%77 = add i32 %76, 4000
%78 = sdiv i32 %77, 1461001
%79 = mul nsw i32 %78, 1461
%80 = sdiv i32 %79, -4
%81 = add i32 %75, 31
%82 = add i32 %81, %80
%83 = mul nsw i32 %82, 80
%84 = sdiv i32 %83, 2447
%85 = mul nsw i32 %84, 2447
%86 = sdiv i32 %85, -80
%87 = add i32 %86, %82
store i32 %87, i32* %3
%88 = sdiv i32 %83, 26917
%89 = add nsw i32 %84, 2
%90 = mul nsw i32 %88, -12
%91 = add nsw i32 %89, %90
store i32 %91, i32* %2
%92 = mul nsw i32 %71, 100
%93 = add nsw i32 %92, -4900
%94 = add nsw i32 %93, %78
%95 = add nsw i32 %94, %88
store i32 %95, i32* %1
ret void
}