#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*/ printf(char *, int, int, int);
void timeConv(int time) {
  int a, b, c;
  a = time / 3600;
  b = (time % 3600) / 60;
  if (b < 10) {
    b = '0' + b;
  }
  c = (time % 3600) % 60;
  printf("%12dH %dM %dS", a, b, c);
}


x86 assembly (clang, -O0):
<timeConv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1154 <timeConv+0x44>
mov    -0xc(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeConv>:
movslq %edi,%rax
imul   $0xffffffff91a2b3c5,%rax,%rsi
shr    $0x20,%rsi
add    %eax,%esi
mov    %esi,%ecx
shr    $0x1f,%ecx
sar    $0xb,%esi
add    %ecx,%esi
imul   $0xe10,%esi,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
imul   $0xffff8889,%ecx,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edi
shr    $0xf,%ecx
sar    $0x5,%edi
add    %ecx,%edi
movswl %di,%ecx
lea    0x30(%rcx),%edx
cmp    $0x258,%eax
cmovge %ecx,%edx
imul   $0x3c,%edi,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
lea    0xe95(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%12dH %dM %dS\00"
define void @timeConv(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 3600
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = srem i32 %8, 3600
%10 = sdiv i32 %9, 60
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i32, i32* %4
%15 = add nsw i32 48, %14
store i32 %15, i32* %4
br label %16
16: ; preds = %13, %1
%17 = load i32, i32* %2
%18 = srem i32 %17, 3600
%19 = srem i32 %18, 60
store i32 %19, i32* %5
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %21, i32 %22)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%12dH %dM %dS\00"
define void @timeConv(i32 %0) {
%2 = srem i32 %0, 3600
%3 = trunc i32 %2 to i16
%4 = sdiv i16 %3, 60
%5 = sext i16 %4 to i32
%6 = icmp slt i32 %2, 600
%7 = add nsw i32 %5, 48
%8 = select i1 %6, i32 %7, i32 %5
%9 = sdiv i32 %0, 3600
%10 = srem i16 %3, 60
%11 = sext i16 %10 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %8, i32 %11)
ret void
}