double mst2jd(sdj)
double sdj;
{
  double tsd, djd, st0, dj0, dj;
  dj0 = (double)((int)sdj) + 0.5;
  st0 = jd2mst(dj0);
  tsd = (sdj - dj0) * 86400.0;
  if (tsd < 0.0)
    tsd = tsd + 86400.0;
  djd = ((tsd - st0) / 1.0027379093) / 86400.0;
  dj = dj0 + djd;
  if (dj < dj0)
    dj = dj + (1.0 / 1.0027379093);
  return (dj);
}


x86 assembly (clang, -O0):
<mst2jd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xeda(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    $0x1,%al
call   1030 <jd2mst@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  0xea2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1187 <mst2jd+0x77>
movsd  0xe83(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  0xe77(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe5b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11e3 <mst2jd+0xd3>
movsd  0xe3f(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mst2jd>:
sub    $0x28,%rsp
movapd %xmm0,0x10(%rsp)
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm0
addsd  0xed6(%rip),%xmm0
movapd %xmm0,(%rsp)
mov    $0x1,%al
call   1030 <jd2mst@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd (%rsp),%xmm5
movapd 0x10(%rsp),%xmm6
subsd  %xmm5,%xmm6
movsd  0xeb4(%rip),%xmm1
mulsd  %xmm1,%xmm6
movapd %xmm6,%xmm2
addsd  %xmm1,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm6,%xmm4
cmpltsd %xmm3,%xmm4
andpd  %xmm4,%xmm2
andnpd %xmm6,%xmm4
orpd   %xmm2,%xmm4
subsd  %xmm0,%xmm4
divsd  0xe8b(%rip),%xmm4
divsd  %xmm1,%xmm4
addsd  %xmm5,%xmm4
movsd  0xe83(%rip),%xmm1
addsd  %xmm4,%xmm1
movapd %xmm4,%xmm0
cmpltsd %xmm5,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm4,%xmm0
orpd   %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @mst2jd(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %2
%8 = load double, double* %2
%9 = fptosi double %8 to i32
%10 = sitofp i32 %9 to double
%11 = fadd double %10, 5.000000e-01
store double %11, double* %6
%12 = load double, double* %6
%13 = call i32 (double, ...) bitcast (i32 (...)* @jd2mst to i32 (double, ...)*)(double %12)
%14 = sitofp i32 %13 to double
store double %14, double* %5
%15 = load double, double* %2
%16 = load double, double* %6
%17 = fsub double %15, %16
%18 = fmul double %17, 8.640000e+04
store double %18, double* %3
%19 = load double, double* %3
%20 = fcmp olt double %19, 0.000000e+00
br i1 %20, label %21, label %24
21: ; preds = %1
%22 = load double, double* %3
%23 = fadd double %22, 8.640000e+04
store double %23, double* %3
br label %24
24: ; preds = %21, %1
%25 = load double, double* %3
%26 = load double, double* %5
%27 = fsub double %25, %26
%28 = fdiv double %27, 0x3FF00B36E7EE7256
%29 = fdiv double %28, 8.640000e+04
store double %29, double* %4
%30 = load double, double* %6
%31 = load double, double* %4
%32 = fadd double %30, %31
store double %32, double* %7
%33 = load double, double* %7
%34 = load double, double* %6
%35 = fcmp olt double %33, %34
br i1 %35, label %36, label %39
36: ; preds = %24
%37 = load double, double* %7
%38 = fadd double %37, 0x3FEFE9A1DD9CB013
store double %38, double* %7
br label %39
39: ; preds = %36, %24
%40 = load double, double* %7
ret double %40
}

LLVM IR (-O2):
define double @mst2jd(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fadd double %3, 5.000000e-01
%5 = tail call i32 (double, ...) bitcast (i32 (...)* @jd2mst to i32 (double, ...)*)(double %4)
%6 = sitofp i32 %5 to double
%7 = fsub double %0, %4
%8 = fmul double %7, 8.640000e+04
%9 = fcmp olt double %8, 0.000000e+00
%10 = fadd double %8, 8.640000e+04
%11 = select i1 %9, double %10, double %8
%12 = fsub double %11, %6
%13 = fdiv double %12, 0x3FF00B36E7EE7256
%14 = fdiv double %13, 8.640000e+04
%15 = fadd double %4, %14
%16 = fcmp olt double %15, %4
%17 = fadd double %15, 0x3FEFE9A1DD9CB013
%18 = select i1 %16, double %17, double %15
ret double %18
}