#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 /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int segundos;
  int medidas[] = {3600, 60, 1, 0};
  int i = 0;
  scanf("%d", &segundos);
  while (medidas[i] != 0) {
    if (i != 0)
      printf(":");
    printf("%d", segundos / medidas[i]);
    segundos = segundos % medidas[i];
    i++;
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xebd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movslq -0x24(%rbp),%rax
cmpl   $0x0,-0x20(%rbp,%rax,4)
je     11bc <main+0x9c>
cmpl   $0x0,-0x24(%rbp)
je     1183 <main+0x63>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
movslq -0x24(%rbp),%rcx
cltd
idivl  -0x20(%rbp,%rcx,4)
mov    %eax,%esi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
movslq -0x24(%rbp),%rcx
cltd
idivl  -0x20(%rbp,%rcx,4)
mov    %edx,-0x8(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115c <main+0x3c>
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movslq 0xc(%rsp),%rax
imul   $0xffffffff91a2b3c5,%rax,%rsi
shr    $0x20,%rsi
add    %eax,%esi
mov    %esi,%eax
shr    $0x1f,%eax
sar    $0xb,%esi
add    %eax,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movslq 0xc(%rsp),%rax
imul   $0xffffffff91a2b3c5,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xb,%ecx
add    %edx,%ecx
imul   $0xe10,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0xc(%rsp)
mov    $0x3a,%edi
call   1030 <putchar@plt>
movslq 0xc(%rsp),%rax
imul   $0xffffffff88888889,%rax,%rsi
shr    $0x20,%rsi
add    %eax,%esi
mov    %esi,%eax
shr    $0x1f,%eax
sar    $0x5,%esi
add    %eax,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movslq 0xc(%rsp),%rax
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x3c,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0xc(%rsp)
mov    $0x3a,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movl   $0x0,0xc(%rsp)
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.medidas = [4 x i32] [i32 3600, i32 60, i32 1, i32 0]
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c":\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [4 x i32]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [4 x i32]* %3 to i8*
store i32 0, i32* %4
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %7
7: ; preds = %18, %0
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %34
13: ; preds = %7
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %13
%19 = load i32, i32* %2
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = sdiv i32 %19, %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %2
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = srem i32 %26, %30
store i32 %31, i32* %2
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %7
34: ; preds = %7
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = sdiv i32 %4, 3600
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = srem i32 %7, 3600
store i32 %8, i32* %1
%9 = call i32 @putchar(i32 58)
%10 = load i32, i32* %1
%11 = sdiv i32 %10, 60
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %1
%14 = srem i32 %13, 60
store i32 %14, i32* %1
%15 = call i32 @putchar(i32 58)
%16 = load i32, i32* %1
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
store i32 0, i32* %1
%18 = call i32 @putchar(i32 10)
ret i32 0
}