#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 /*<<< orphan*/ sprintf(char *, char *, char, char, char, char, char, char);
void unIndex(unsigned long int index, char *ptr) {
  char m, s, f;
  f = (char)(index % 75);
  s = (char)((index / 75) % 60);
  m = (char)(index / (75 * 60));
  sprintf(ptr, "%d%d:%d%d:%d%d", m / 10, m % 10, s / 10, s % 10, f / 10,
          f % 10);
}


x86 assembly (clang, -O0):
<unIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x4b,%ecx
xor    %edx,%edx
div    %rcx
mov    %dl,%al
mov    %al,-0x13(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x4b,%ecx
xor    %edx,%edx
div    %rcx
mov    $0x3c,%ecx
xor    %edx,%edx
div    %rcx
mov    %dl,%al
mov    %al,-0x12(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x1194,%ecx
xor    %edx,%edx
div    %rcx
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %al,-0x14(%rbp)
movsbl -0x11(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
movsbl -0x12(%rbp),%eax
mov    $0xa,%esi
cltd
idiv   %esi
mov    %al,%r8b
movsbl -0x12(%rbp),%eax
mov    $0xa,%esi
cltd
idiv   %esi
mov    %dl,%r9b
movsbl -0x13(%rbp),%eax
mov    $0xa,%esi
cltd
idiv   %esi
mov    %al,%r10b
movsbl -0x13(%rbp),%eax
mov    $0xa,%esi
cltd
idiv   %esi
mov    %edx,%eax
mov    -0x14(%rbp),%dl
lea    0xe39(%rip),%rsi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movsbl %r10b,%r10d
mov    %r10d,(%rsp)
movsbl %al,%eax
mov    %eax,0x8(%rsp)
call   1030 <sprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unIndex>:
push   %rbx
mov    %rsi,%r10
movabs $0x6d3a06d3a06d3a07,%rcx
06 3a 6d
mov    %rdi,%rax
mul    %rcx
mov    %rdx,%rcx
shr    $0x5,%rcx
imul   $0x4b,%rcx,%rax
mov    %rdi,%rsi
sub    %rax,%rsi
movabs $0x8888888888888889,%rdx
88 88 88
mov    %rcx,%rax
mul    %rdx
shr    $0x5,%rdx
imul   $0x3c,%rdx,%rax
sub    %rax,%rcx
movabs $0x3a4114b5225c6337,%rdx
14 41 3a
mov    %rdi,%rax
mul    %rdx
shr    $0xa,%rdx
movsbl %dl,%eax
imul   $0x67,%eax,%eax
movzwl %ax,%eax
movswl %ax,%edi
shr    $0xf,%eax
shr    $0xa,%edi
add    %al,%dil
movzbl %dil,%r11d
lea    (%r11,%r11,1),%edi
lea    (%rdi,%rdi,4),%edi
sub    %dil,%dl
imul   $0xcd,%ecx,%edi
movzwl %di,%r8d
shr    $0xb,%r8d
lea    (%r8,%r8,1),%edi
lea    (%rdi,%rdi,4),%edi
sub    %dil,%cl
imul   $0xcd,%esi,%edi
movzwl %di,%eax
shr    $0xb,%eax
lea    (%rax,%rax,1),%edi
lea    (%rdi,%rdi,4),%edi
sub    %dil,%sil
movzbl %sil,%ebx
movzbl %cl,%r9d
movsbl %r11b,%r11d
movsbl %dl,%ecx
lea    0xe36(%rip),%rsi
mov    %r10,%rdi
mov    %r11d,%edx
push   %rbx
push   %rax
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%d%d:%d%d:%d%d\00"
define void @unIndex(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i64 %0, i64* %3
store i8* %1, i8** %4
%8 = load i64, i64* %3
%9 = urem i64 %8, 75
%10 = trunc i64 %9 to i8
store i8 %10, i8* %7
%11 = load i64, i64* %3
%12 = udiv i64 %11, 75
%13 = urem i64 %12, 60
%14 = trunc i64 %13 to i8
store i8 %14, i8* %6
%15 = load i64, i64* %3
%16 = udiv i64 %15, 4500
%17 = trunc i64 %16 to i8
store i8 %17, i8* %5
%18 = load i8*, i8** %4
%19 = load i8, i8* %5
%20 = sext i8 %19 to i32
%21 = sdiv i32 %20, 10
%22 = trunc i32 %21 to i8
%23 = load i8, i8* %5
%24 = sext i8 %23 to i32
%25 = srem i32 %24, 10
%26 = trunc i32 %25 to i8
%27 = load i8, i8* %6
%28 = sext i8 %27 to i32
%29 = sdiv i32 %28, 10
%30 = trunc i32 %29 to i8
%31 = load i8, i8* %6
%32 = sext i8 %31 to i32
%33 = srem i32 %32, 10
%34 = trunc i32 %33 to i8
%35 = load i8, i8* %7
%36 = sext i8 %35 to i32
%37 = sdiv i32 %36, 10
%38 = trunc i32 %37 to i8
%39 = load i8, i8* %7
%40 = sext i8 %39 to i32
%41 = srem i32 %40, 10
%42 = trunc i32 %41 to i8
%43 = call i32 @sprintf(i8* %18, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext %22, i8 signext %26, i8 signext %30, i8 signext %34, i8 signext %38, i8 signext %42)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%d%d:%d%d:%d%d\00"
define void @unIndex(i64 %0, i8* nocapture writeonly %1) {
%3 = urem i64 %0, 75
%4 = udiv i64 %0, 75
%5 = urem i64 %4, 60
%6 = udiv i64 %0, 4500
%7 = trunc i64 %6 to i8
%8 = sdiv i8 %7, 10
%9 = srem i8 %7, 10
%10 = trunc i64 %5 to i8
%11 = udiv i8 %10, 10
%12 = urem i8 %10, 10
%13 = trunc i64 %3 to i8
%14 = udiv i8 %13, 10
%15 = urem i8 %13, 10
%16 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext %8, i8 signext %9, i8 signext %11, i8 signext %12, i8 signext %14, i8 signext %15)
ret void
}