char *fd2oft(string)
char *string;
{
  int iyr, imon, iday, ihr, imn;
  double sec;
  fd2i(string, &iyr, &imon, &iday, &ihr, &imn, &sec, 3);
  string = (char *)calloc(32, sizeof(char));
  sprintf(string, "%02d:%02d:%06.3f", ihr, imn, sec);
  return (string);
}


x86 assembly (clang, -O0):
<fd2oft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r8
lea    -0x1c(%rbp),%r9
lea    -0x28(%rbp),%rax
mov    %rax,(%rsp)
movl   $0x3,0x8(%rsp)
mov    $0x0,%al
call   1050 <fd2i@plt>
mov    $0x20,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
movsd  -0x28(%rbp),%xmm0
lea    0xe6c(%rip),%rsi
mov    $0x1,%al
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd2oft>:
push   %rbx
sub    $0x20,%rsp
lea    0x8(%rsp),%rbx
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x14(%rsp),%rcx
lea    0x4(%rsp),%r8
mov    %rsp,%r9
xor    %eax,%eax
push   $0x3
push   %rbx
call   1050 <fd2i@plt>
add    $0x10,%rsp
mov    $0x20,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
movsd  0x8(%rsp),%xmm0
lea    0xe7b(%rip),%rsi
mov    %rax,%rdi
mov    $0x1,%al
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"%02d:%02d:%06.3f\00"
define i8* @fd2oft(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store i8* %0, i8** %2
%9 = load i8*, i8** %2
%10 = call i32 (i8*, i32*, i32*, i32*, i32*, i32*, double*, i32, ...) bitcast (i32 (...)* @fd2i to i32 (i8*, i32*, i32*, i32*, i32*, i32*, double*, i32, ...)*)(i8* %9, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, double* %8, i32 3)
%11 = call i8* @calloc(i64 32, i64 1)
store i8* %11, i8** %2
%12 = load i8*, i8** %2
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = load double, double* %8
%16 = call i32 (i8*, i8*, ...) @sprintf(i8* %12, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14, double %15)
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@.str = [17 x i8] c"%02d:%02d:%06.3f\00"
define i8* @fd2oft(i8* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = bitcast double* %7 to i8*
%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* %0, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, double* %7, i32 3)
%15 = call dereferenceable_or_null(32) i8* @calloc(i64 32, i64 1)
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = load double, double* %7
%19 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %15, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17, double %18)
ret i8* %15
}