#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int snprintf(char *, int, char *, int, int, int, int);
int printOtherTime(char *buf, int len, long long int ftime) {
  int hours;
  int minutes;
  int seconds;
  int secondBillionths;
  secondBillionths = (int)(ftime % (long long)4000000);
  seconds = (int)(ftime / (long long)4000000);
  minutes = seconds / 60;
  hours = minutes / 60;
  secondBillionths *= (long long)25;
  seconds %= 60;
  minutes %= 60;
  return snprintf(buf, len, "%i:%i:%i.%08i", hours, minutes, seconds,
                  secondBillionths);
}


x86 assembly (clang, -O0):
<printOtherTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x3d0900,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x3d0900,%ecx
cqto
idiv   %rcx
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
movslq -0x28(%rbp),%rax
imul   $0x19,%rax,%rax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x24(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
mov    -0x28(%rbp),%eax
lea    0xe5a(%rip),%rdx
mov    %eax,(%rsp)
call   1030 <snprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printOtherTime>:
push   %rax
mov    %rdx,%r8
movabs $0x431bde82d7b634db,%rcx
de 1b 43
mov    %rdx,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x14,%rdx
add    %rax,%rdx
imul   $0x3d0900,%edx,%eax
sub    %eax,%r8d
movslq %edx,%r9
imul   $0xffffffff91a2b3c5,%r9,%rcx
shr    $0x20,%rcx
add    %r9d,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0xb,%ecx
add    %eax,%ecx
lea    (%r8,%r8,4),%eax
lea    (%rax,%rax,4),%r10d
imul   $0xffffffff88888889,%r9,%rdx
shr    $0x20,%rdx
add    %r9d,%edx
mov    %edx,%eax
shr    $0x1f,%eax
sar    $0x5,%edx
add    %eax,%edx
imul   $0x3c,%edx,%eax
sub    %eax,%r9d
movslq %edx,%r8
imul   $0xffffffff88888889,%r8,%rax
shr    $0x20,%rax
add    %r8d,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x5,%eax
add    %edx,%eax
imul   $0x3c,%eax,%eax
sub    %eax,%r8d
mov    %r10d,(%rsp)
lea    0xe58(%rip),%rdx
call   1030 <snprintf@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%i:%i:%i.%08i\00"
define i32 @printOtherTime(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%11 = load i64, i64* %6
%12 = srem i64 %11, 4000000
%13 = trunc i64 %12 to i32
store i32 %13, i32* %10
%14 = load i64, i64* %6
%15 = sdiv i64 %14, 4000000
%16 = trunc i64 %15 to i32
store i32 %16, i32* %9
%17 = load i32, i32* %9
%18 = sdiv i32 %17, 60
store i32 %18, i32* %8
%19 = load i32, i32* %8
%20 = sdiv i32 %19, 60
store i32 %20, i32* %7
%21 = load i32, i32* %10
%22 = sext i32 %21 to i64
%23 = mul nsw i64 %22, 25
%24 = trunc i64 %23 to i32
store i32 %24, i32* %10
%25 = load i32, i32* %9
%26 = srem i32 %25, 60
store i32 %26, i32* %9
%27 = load i32, i32* %8
%28 = srem i32 %27, 60
store i32 %28, i32* %8
%29 = load i8*, i8** %4
%30 = load i32, i32* %5
%31 = load i32, i32* %7
%32 = load i32, i32* %8
%33 = load i32, i32* %9
%34 = load i32, i32* %10
%35 = call i32 @snprintf(i8* %29, i32 %30, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %31, i32 %32, i32 %33, i32 %34)
ret i32 %35
}

LLVM IR (-O2):
@.str = [14 x i8] c"%i:%i:%i.%08i\00"
define i32 @printOtherTime(i8* %0, i32 %1, i64 %2) {
%4 = srem i64 %2, 4000000
%5 = sdiv i64 %2, 4000000
%6 = trunc i64 %5 to i32
%7 = sdiv i32 %6, 60
%8 = sdiv i32 %6, 3600
%9 = trunc i64 %4 to i32
%10 = mul nsw i32 %9, 25
%11 = srem i32 %6, 60
%12 = srem i32 %7, 60
%13 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %12, i32 %11, i32 %10)
ret i32 %13
}