const char *strtime(unsigned long long *time) {
  const char *prefix = "n";
  if (*time >= 100000) {
    prefix = "µ";
    *time /= 1000;
  }
  if (*time >= 100000) {
    prefix = "m";
    *time /= 1000;
  }
  if (*time >= 100000) {
    prefix = " ";
    *time /= 1000;
  }
  return prefix;
}


x86 assembly (clang, -O0):
<strtime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x186a0,(%rax)
jb     114e <strtime+0x4e>
lea    0xed7(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    (%rax),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x186a0,(%rax)
jb     1189 <strtime+0x89>
lea    0xe9f(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    (%rax),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x186a0,(%rax)
jb     11c4 <strtime+0xc4>
lea    0xe66(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    (%rax),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtime>:
mov    (%rdi),%rcx
cmp    $0x186a0,%rcx
jb     1179 <strtime+0x79>
mov    %rcx,%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rdx
9b c4 20
mul    %rdx
shr    $0x4,%rdx
mov    %rdx,(%rdi)
cmp    $0x5f5e100,%rcx
jb     1181 <strtime+0x81>
movabs $0x431bde82d7b634db,%rdx
de 1b 43
mov    %rcx,%rax
mul    %rdx
shr    $0x12,%rdx
mov    %rdx,(%rdi)
mov    %rcx,%rax
shr    $0xb,%rax
cmp    $0x2e90edd,%rax
jb     1189 <strtime+0x89>
shr    $0x9,%rcx
movabs $0x44b82fa09b5a53,%rdx
mov    %rcx,%rax
mul    %rdx
shr    $0xb,%rdx
mov    %rdx,(%rdi)
lea    0xe8f(%rip),%rax
ret
lea    0xe80(%rip),%rax
ret
lea    0xe7a(%rip),%rax
ret
lea    0xe75(%rip),%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"n\00"
@.str.1 = [3 x i8] c"\C2\B5\00"
@.str.2 = [2 x i8] c"m\00"
@.str.3 = [2 x i8] c" \00"
define i8* @strtime(i64* %0) {
%2 = alloca i64*
%3 = alloca i8*
store i64* %0, i64** %2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i64*, i64** %2
%5 = load i64, i64* %4
%6 = icmp uge i64 %5, 100000
br i1 %6, label %7, label %11
7: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %3
%8 = load i64*, i64** %2
%9 = load i64, i64* %8
%10 = udiv i64 %9, 1000
store i64 %10, i64* %8
br label %11
11: ; preds = %7, %1
%12 = load i64*, i64** %2
%13 = load i64, i64* %12
%14 = icmp uge i64 %13, 100000
br i1 %14, label %15, label %19
15: ; preds = %11
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %3
%16 = load i64*, i64** %2
%17 = load i64, i64* %16
%18 = udiv i64 %17, 1000
store i64 %18, i64* %16
br label %19
19: ; preds = %15, %11
%20 = load i64*, i64** %2
%21 = load i64, i64* %20
%22 = icmp uge i64 %21, 100000
br i1 %22, label %23, label %27
23: ; preds = %19
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %3
%24 = load i64*, i64** %2
%25 = load i64, i64* %24
%26 = udiv i64 %25, 1000
store i64 %26, i64* %24
br label %27
27: ; preds = %23, %19
%28 = load i8*, i8** %3
ret i8* %28
}

LLVM IR (-O2):
@.str = [2 x i8] c"n\00"
@.str.1 = [3 x i8] c"\C2\B5\00"
@.str.2 = [2 x i8] c"m\00"
@.str.3 = [2 x i8] c" \00"
define i8* @strtime(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = icmp ugt i64 %2, 99999
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = udiv i64 %2, 1000
store i64 %5, i64* %0
%6 = icmp ugt i64 %2, 99999999
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = udiv i64 %2, 1000000
store i64 %8, i64* %0
%9 = icmp ugt i64 %2, 99999999999
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = udiv i64 %2, 1000000000
store i64 %11, i64* %0
br label %12
12: ; preds = %1, %4, %10, %7
%13 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), %10 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %7 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %13
}