char *clocktos(t)
long t;
{
  static char temp[22];
  register int i;
  register char *cp = temp + sizeof(temp);
  if (60 != 100)
    t = (t < 1000000000 / 60) ? (t * 100) / 60 : (t / 60) * 100;
  *--cp = '\0';
  for (i = -2; i <= 0 || t > 0; i++) {
    if (i == 0)
      *--cp = '.';
    *--cp = '0' + (char)(t % 10);
    t /= 10;
  }
  return cp;
}


x86 assembly (clang, -O0):
<clocktos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0x2f21(%rip),%rax
add    $0x16,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0xfe502a,-0x8(%rbp)
jge    113d <clocktos+0x3d>
imul   $0x64,-0x8(%rbp),%rax
mov    $0x3c,%ecx
cqto
idiv   %rcx
mov    %rax,-0x20(%rbp)
jmp    1153 <clocktos+0x53>
mov    -0x8(%rbp),%rax
mov    $0x3c,%ecx
cqto
idiv   %rcx
imul   $0x64,%rax,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,-0x1(%rax)
movl   $0xfffffffe,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x21(%rbp)
jle    118f <clocktos+0x8f>
cmpq   $0x0,-0x8(%rbp)
setg   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    119f <clocktos+0x9f>
jmp    1206 <clocktos+0x106>
cmpl   $0x0,-0xc(%rbp)
jne    11bc <clocktos+0xbc>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x2e,-0x1(%rax)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %dl,%al
movsbl %al,%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1175 <clocktos+0x75>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clocktos>:
cmp    $0xfe5029,%rdi
jg     1133 <clocktos+0x33>
imul   $0x64,%rdi,%rsi
movabs $0x8888888888888889,%rcx
88 88 88
mov    %rsi,%rax
imul   %rcx
mov    %rdx,%rcx
add    %rsi,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x5,%rcx
add    %rax,%rcx
jmp    114b <clocktos+0x4b>
movabs $0x8888888888888889,%rcx
88 88 88
mov    %rdi,%rax
mul    %rcx
shr    $0x5,%rdx
imul   $0x64,%rdx,%rcx
movb   $0x0,0x2ef3(%rip)
movabs $0x6666666666666667,%r8
66 66 66
mov    %rcx,%rax
imul   %r8
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x2,%rdx
add    %rdx,%rsi
lea    (%rsi,%rsi,1),%eax
lea    (%rax,%rax,4),%eax
mov    %ecx,%edi
sub    %eax,%edi
add    $0x30,%dil
mov    %rsi,%rax
imul   %r8
mov    %dil,0x2eb9(%rip)
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x2,%edx
add    %eax,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%esi
add    $0x30,%sil
mov    %sil,0x2e9a(%rip)
movabs $0xa3d70a3d70a3d70b,%rdx
0a d7 a3
mov    %rcx,%rax
imul   %rdx
mov    %rdx,%rsi
add    %rcx,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x6,%rsi
add    %rax,%rsi
movb   $0x2e,0x2e6e(%rip)
mov    %rsi,%rax
imul   %r8
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x2,%edx
add    %eax,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%esi
add    $0x30,%sil
mov    %sil,0x2e49(%rip)
cmp    $0x3e8,%rcx
jl     1267 <clocktos+0x167>
shr    $0x3,%rcx
movabs $0x20c49ba5e353f7cf,%rdx
9b c4 20
mov    %rcx,%rax
mul    %rdx
mov    %rdx,%rsi
shr    $0x4,%rsi
lea    0x2e1e(%rip),%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rsi,%rax
imul   %r8
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
lea    (%rdx,%rdx,1),%eax
lea    (%rax,%rax,4),%eax
mov    %esi,%edi
sub    %eax,%edi
add    $0x30,%dil
mov    %dil,-0x1(%rcx)
add    $0xffffffffffffffff,%rcx
cmp    $0x9,%rsi
mov    %rdx,%rsi
jg     1230 <clocktos+0x130>
mov    %rcx,%rax
ret
lea    0x2dd3(%rip),%rax
ret

LLVM IR (-O0):
@clocktos.temp = internal global [22 x i8] zeroinitializer
define i8* @clocktos(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i8*
store i64 %0, i64* %2
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @clocktos.temp, i64 1, i64 0), i8** %4
%5 = load i64, i64* %2
%6 = icmp slt i64 %5, 16666666
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i64, i64* %2
%9 = mul nsw i64 %8, 100
%10 = sdiv i64 %9, 60
br label %15
11: ; preds = %1
%12 = load i64, i64* %2
%13 = sdiv i64 %12, 60
%14 = mul nsw i64 %13, 100
br label %15
15: ; preds = %11, %7
%16 = phi i64 [ %10, %7 ], [ %14, %11 ]
store i64 %16, i64* %2
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i32 -1
store i8* %18, i8** %4
store i8 0, i8* %18
store i32 -2, i32* %3
br label %19
19: ; preds = %44, %15
%20 = load i32, i32* %3
%21 = icmp sle i32 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %19
%23 = load i64, i64* %2
%24 = icmp sgt i64 %23, 0
br label %25
25: ; preds = %22, %19
%26 = phi i1 [ true, %19 ], [ %24, %22 ]
br i1 %26, label %27, label %47
27: ; preds = %25
%28 = load i32, i32* %3
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %27
%31 = load i8*, i8** %4
%32 = getelementptr inbounds i8, i8* %31, i32 -1
store i8* %32, i8** %4
store i8 46, i8* %32
br label %33
33: ; preds = %30, %27
%34 = load i64, i64* %2
%35 = srem i64 %34, 10
%36 = trunc i64 %35 to i8
%37 = sext i8 %36 to i32
%38 = add nsw i32 48, %37
%39 = trunc i32 %38 to i8
%40 = load i8*, i8** %4
%41 = getelementptr inbounds i8, i8* %40, i32 -1
store i8* %41, i8** %4
store i8 %39, i8* %41
%42 = load i64, i64* %2
%43 = sdiv i64 %42, 10
store i64 %43, i64* %2
br label %44
44: ; preds = %33
%45 = load i32, i32* %3
%46 = add nsw i32 %45, 1
store i32 %46, i32* %3
br label %19
47: ; preds = %25
%48 = load i8*, i8** %4
ret i8* %48
}

LLVM IR (-O2):
@clocktos.temp = internal global [22 x i8] zeroinitializer
define i8* @clocktos(i64 %0) {
%2 = icmp slt i64 %0, 16666666
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = mul nsw i64 %0, 100
%5 = sdiv i64 %4, 60
br label %9
6: ; preds = %1
%7 = udiv i64 %0, 60
%8 = mul nuw nsw i64 %7, 100
br label %9
9: ; preds = %6, %3
%10 = phi i64 [ %5, %3 ], [ %8, %6 ]
store i8 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @clocktos.temp, i64 0, i64 21)
%11 = srem i64 %10, 10
%12 = trunc i64 %11 to i8
%13 = add nsw i8 %12, 48
store i8 %13, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @clocktos.temp, i64 0, i64 20)
%14 = sdiv i64 %10, 10
%15 = srem i64 %14, 10
%16 = trunc i64 %15 to i8
%17 = add nsw i8 %16, 48
store i8 %17, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @clocktos.temp, i64 0, i64 19)
%18 = sdiv i64 %10, 100
store i8 46, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @clocktos.temp, i64 0, i64 18)
%19 = srem i64 %18, 10
%20 = trunc i64 %19 to i8
%21 = add nsw i8 %20, 48
store i8 %21, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @clocktos.temp, i64 0, i64 17)
%22 = icmp sgt i64 %10, 999
br i1 %22, label %23, label %34
23: ; preds = %9
%24 = udiv i64 %10, 1000
br label %25
25: ; preds = %25, %23
%26 = phi i8* [ getelementptr inbounds ([22 x i8], [22 x i8]* @clocktos.temp, i64 0, i64 17), %23 ], [ %31, %25 ]
%27 = phi i64 [ %24, %23 ], [ %32, %25 ]
%28 = srem i64 %27, 10
%29 = trunc i64 %28 to i8
%30 = add nsw i8 %29, 48
%31 = getelementptr inbounds i8, i8* %26, i64 -1
store i8 %30, i8* %31
%32 = sdiv i64 %27, 10
%33 = icmp sgt i64 %27, 9
br i1 %33, label %25, label %34
34: ; preds = %25, %9
%35 = phi i8* [ getelementptr inbounds ([22 x i8], [22 x i8]* @clocktos.temp, i64 0, i64 17), %9 ], [ %31, %25 ]
ret i8* %35
}