#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 */
typedef int int32_t;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int, int, int);
scalar_t__ scanf(char *, int *);
int main() {
  int32_t t, h = 0, m = 0;
  while (scanf("%d", &t) != EOF) {
    if (t >= 60 * 60) {
      h = t / (60 * 60);
      t %= (60 * 60);
    }
    if (t >= 60) {
      m = t / 60;
      t %= 60;
    }
    printf("%d:%d:%d\n", h, m, t);
    h = 0, m = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e94(%rip),%rcx
cmp    (%rcx),%rax
je     11d4 <main+0xb4>
cmpl   $0xe10,-0x8(%rbp)
jl     1186 <main+0x66>
mov    -0x8(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmpl   $0x3c,-0x8(%rbp)
jl     11ac <main+0x8c>
mov    -0x8(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea3(%rip),%r12
cmp    (%r12),%rax
jne    115b <main+0x3b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
mov    $0x91a2b3c5,%r13d
lea    0xe9b(%rip),%r14
lea    0xe91(%rip),%r15
lea    0xc(%rsp),%rbx
jmp    1199 <main+0x79>
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
je     114b <main+0x2b>
mov    0xc(%rsp),%ecx
xor    %edx,%edx
cmp    $0xe10,%ecx
jl     11d0 <main+0xb0>
mov    %ecx,%esi
imul   %r13,%rsi
shr    $0x2b,%rsi
imul   $0xe10,%esi,%eax
sub    %eax,%ecx
mov    %ecx,0xc(%rsp)
cmp    $0x3c,%ecx
jl     1180 <main+0x60>
jmp    11d7 <main+0xb7>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %esi,%esi
cmp    $0x3c,%ecx
jl     1180 <main+0x60>
movzwl %cx,%eax
imul   $0x8889,%eax,%edx
shr    $0x15,%edx
imul   $0x3c,%edx,%eax
sub    %eax,%ecx
movzwl %cx,%ecx
mov    %ecx,0xc(%rsp)
jmp    1180 <main+0x60>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [10 x i8] c"%d:%d:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %29, label %6
6: ; preds = %0, %22
%7 = load i32, i32* %1
%8 = icmp sgt i32 %7, 3599
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = udiv i32 %7, 3600
%11 = urem i32 %7, 3600
store i32 %11, i32* %1
br label %12
12: ; preds = %9, %6
%13 = phi i32 [ %11, %9 ], [ %7, %6 ]
%14 = phi i32 [ %10, %9 ], [ 0, %6 ]
%15 = icmp sgt i32 %13, 59
br i1 %15, label %16, label %22
16: ; preds = %12
%17 = trunc i32 %13 to i16
%18 = udiv i16 %17, 60
%19 = zext i16 %18 to i32
%20 = urem i16 %17, 60
%21 = zext i16 %20 to i32
store i32 %21, i32* %1
br label %22
22: ; preds = %16, %12
%23 = phi i32 [ %21, %16 ], [ %13, %12 ]
%24 = phi i32 [ %19, %16 ], [ 0, %12 ]
%25 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %24, i32 %23)
%26 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%27 = load i64, i64* @EOF
%28 = icmp eq i64 %26, %27
br i1 %28, label %29, label %6
29: ; preds = %22, %0
ret i32 0
}