void fd2dt(string, date, time) char *string;
double *date;
double *time;
{
  int iyr, imon, iday, ihr, imn;
  double sec;
  fd2i(string, &iyr, &imon, &iday, &ihr, &imn, &sec, 4);
  if (iyr < 0) {
    *date = (double)(-iyr) + 0.01 * (double)imon + 0.0001 * (double)iday;
    *date = -(*date);
  } else
    *date = (double)iyr + 0.01 * (double)imon + 0.0001 * (double)iday;
  *time = (double)ihr + 0.01 * (double)imn + 0.0001 * sec;
  return;
}


x86 assembly (clang, -O0):
<fd2dt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
lea    -0x28(%rbp),%r8
lea    -0x2c(%rbp),%r9
lea    -0x38(%rbp),%rax
mov    %rax,(%rsp)
movl   $0x4,0x8(%rsp)
mov    $0x0,%al
call   1030 <fd2i@plt>
cmpl   $0x0,-0x1c(%rbp)
jge    11c4 <fd2dt+0xb4>
xor    %eax,%eax
sub    -0x1c(%rbp),%eax
cvtsi2sd %eax,%xmm0
cvtsi2sdl -0x20(%rbp),%xmm1
movsd  0xe95(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
cvtsi2sdl -0x24(%rbp),%xmm0
movsd  0xe78(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    11fb <fd2dt+0xeb>
cvtsi2sdl -0x1c(%rbp),%xmm0
cvtsi2sdl -0x20(%rbp),%xmm1
movsd  0xe32(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
cvtsi2sdl -0x24(%rbp),%xmm0
movsd  0xe15(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
cvtsi2sdl -0x28(%rbp),%xmm0
cvtsi2sdl -0x2c(%rbp),%xmm1
movsd  0xdfb(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  0xdde(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd2dt>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
lea    0x18(%rsp),%rbx
lea    0x14(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
lea    0x10(%rsp),%r8
lea    0xc(%rsp),%r9
xor    %eax,%eax
push   $0x4
push   %rbx
call   1030 <fd2i@plt>
add    $0x10,%rsp
mov    0x14(%rsp),%eax
test   %eax,%eax
js     117d <fd2dt+0x6d>
cvtsi2sd %eax,%xmm1
cvtsi2sdl 0x8(%rsp),%xmm2
mulsd  0xe9b(%rip),%xmm2
cvtsi2sdl 0x4(%rsp),%xmm0
addsd  %xmm1,%xmm2
mulsd  0xe91(%rip),%xmm0
addsd  %xmm2,%xmm0
jmp    11af <fd2dt+0x9f>
neg    %eax
cvtsi2sd %eax,%xmm1
cvtsi2sdl 0x8(%rsp),%xmm2
mulsd  0xe6f(%rip),%xmm2
cvtsi2sdl 0x4(%rsp),%xmm0
mulsd  0xe69(%rip),%xmm0
addsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
xorpd  0xe61(%rip),%xmm0
movsd  %xmm0,(%r15)
xorps  %xmm0,%xmm0
cvtsi2sdl 0x10(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0xc(%rsp),%xmm1
mulsd  0xe32(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0x18(%rsp),%xmm0
mulsd  0xe28(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @fd2dt(i8* %0, double* %1, double* %2) {
%4 = alloca i8*
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double
store i8* %0, i8** %4
store double* %1, double** %5
store double* %2, double** %6
%13 = load i8*, i8** %4
%14 = call i32 (i8*, i32*, i32*, i32*, i32*, i32*, double*, i32, ...) bitcast (i32 (...)* @fd2i to i32 (i8*, i32*, i32*, i32*, i32*, i32*, double*, i32, ...)*)(i8* %13, i32* %7, i32* %8, i32* %9, i32* %10, i32* %11, double* %12, i32 4)
%15 = load i32, i32* %7
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %32
17: ; preds = %3
%18 = load i32, i32* %7
%19 = sub nsw i32 0, %18
%20 = sitofp i32 %19 to double
%21 = load i32, i32* %8
%22 = sitofp i32 %21 to double
%23 = call double @llvm.fmuladd.f64(double 1.000000e-02, double %22, double %20)
%24 = load i32, i32* %9
%25 = sitofp i32 %24 to double
%26 = call double @llvm.fmuladd.f64(double 1.000000e-04, double %25, double %23)
%27 = load double*, double** %5
store double %26, double* %27
%28 = load double*, double** %5
%29 = load double, double* %28
%30 = fneg double %29
%31 = load double*, double** %5
store double %30, double* %31
br label %42
32: ; preds = %3
%33 = load i32, i32* %7
%34 = sitofp i32 %33 to double
%35 = load i32, i32* %8
%36 = sitofp i32 %35 to double
%37 = call double @llvm.fmuladd.f64(double 1.000000e-02, double %36, double %34)
%38 = load i32, i32* %9
%39 = sitofp i32 %38 to double
%40 = call double @llvm.fmuladd.f64(double 1.000000e-04, double %39, double %37)
%41 = load double*, double** %5
store double %40, double* %41
br label %42
42: ; preds = %32, %17
%43 = load i32, i32* %10
%44 = sitofp i32 %43 to double
%45 = load i32, i32* %11
%46 = sitofp i32 %45 to double
%47 = call double @llvm.fmuladd.f64(double 1.000000e-02, double %46, double %44)
%48 = load double, double* %12
%49 = call double @llvm.fmuladd.f64(double 1.000000e-04, double %48, double %47)
%50 = load double*, double** %6
store double %49, double* %50
ret void
}

LLVM IR (-O2):
define void @fd2dt(i8* %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = bitcast i32* %7 to i8*
%14 = bitcast i32* %8 to i8*
%15 = bitcast double* %9 to i8*
%16 = call i32 (i8*, i32*, i32*, i32*, i32*, i32*, double*, i32, ...) bitcast (i32 (...)* @fd2i to i32 (i8*, i32*, i32*, i32*, i32*, i32*, double*, i32, ...)*)(i8* %0, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, double* %9, i32 4)
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %29
19: ; preds = %3
%20 = sub nsw i32 0, %17
%21 = sitofp i32 %20 to double
%22 = load i32, i32* %5
%23 = sitofp i32 %22 to double
%24 = call double @llvm.fmuladd.f64(double %23, double 1.000000e-02, double %21)
%25 = load i32, i32* %6
%26 = sitofp i32 %25 to double
%27 = call double @llvm.fmuladd.f64(double %26, double 1.000000e-04, double %24)
%28 = fneg double %27
br label %37
29: ; preds = %3
%30 = sitofp i32 %17 to double
%31 = load i32, i32* %5
%32 = sitofp i32 %31 to double
%33 = call double @llvm.fmuladd.f64(double %32, double 1.000000e-02, double %30)
%34 = load i32, i32* %6
%35 = sitofp i32 %34 to double
%36 = call double @llvm.fmuladd.f64(double %35, double 1.000000e-04, double %33)
br label %37
37: ; preds = %29, %19
%38 = phi double [ %36, %29 ], [ %28, %19 ]
store double %38, double* %1
%39 = load i32, i32* %7
%40 = sitofp i32 %39 to double
%41 = load i32, i32* %8
%42 = sitofp i32 %41 to double
%43 = call double @llvm.fmuladd.f64(double %42, double 1.000000e-02, double %40)
%44 = load double, double* %9
%45 = call double @llvm.fmuladd.f64(double %44, double 1.000000e-04, double %43)
store double %45, double* %2
ret void
}