#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*/ gettime(int *);
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ system(char *);
int main() {
  int i, j, k, mytime[3], chour, cmin, csec;
  gettime(mytime);
  chour = mytime[0];
  cmin = mytime[1];
  csec = mytime[2];
  for (i = chour; i < 24; i++) {
    for (j = cmin; j < 60; j++) {
      for (k = csec; k < 60; k++) {
        printf("%d:%d:%d", i, j, k);
        sleep(1);
        system("cls");
      }
      csec = 0;
    }
    cmin = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1c(%rbp),%rdi
call   1060 <gettime@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x18,-0x8(%rbp)
jge    11fd <main+0xbd>
mov    -0x24(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x3c,-0xc(%rbp)
jge    11e8 <main+0xa8>
mov    -0x28(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x3c,-0x10(%rbp)
jge    11d3 <main+0x93>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe56(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
lea    0xe49(%rip),%rdi
call   1030 <system@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1190 <main+0x50>
movl   $0x0,-0x28(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1180 <main+0x40>
movl   $0x0,-0x24(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1170 <main+0x30>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0x4(%rsp),%rdi
call   1060 <gettime@plt>
mov    0x4(%rsp),%r12d
cmp    $0x17,%r12d
jg     11db <main+0x9b>
mov    0x8(%rsp),%ebx
mov    0xc(%rsp),%ebp
lea    0xe90(%rip),%r14
lea    0xe92(%rip),%r15
jmp    118c <main+0x4c>
nopl   0x0(%rax)
add    $0x1,%r12d
xor    %ebx,%ebx
cmp    $0x18,%r12d
je     11db <main+0x9b>
cmp    $0x3b,%ebx
jle    11aa <main+0x6a>
jmp    1180 <main+0x40>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebx
xor    %ebp,%ebp
cmp    $0x3c,%ebx
je     1180 <main+0x40>
cmp    $0x3b,%ebp
jg     11a0 <main+0x60>
nop
mov    %r14,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    %r15,%rdi
call   1030 <system@plt>
add    $0x1,%ebp
cmp    $0x3c,%ebp
jne    11b0 <main+0x70>
jmp    11a0 <main+0x60>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d:%d:%d\00"
@.str.1 = [4 x i8] c"cls\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [3 x i32]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%10 = call i32 @gettime(i32* %9)
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
%14 = load i32, i32* %13
store i32 %14, i32* %7
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
%16 = load i32, i32* %15
store i32 %16, i32* %8
%17 = load i32, i32* %6
store i32 %17, i32* %2
br label %18
18: ; preds = %46, %0
%19 = load i32, i32* %2
%20 = icmp slt i32 %19, 24
br i1 %20, label %21, label %49
21: ; preds = %18
%22 = load i32, i32* %7
store i32 %22, i32* %3
br label %23
23: ; preds = %42, %21
%24 = load i32, i32* %3
%25 = icmp slt i32 %24, 60
br i1 %25, label %26, label %45
26: ; preds = %23
%27 = load i32, i32* %8
store i32 %27, i32* %4
br label %28
28: ; preds = %38, %26
%29 = load i32, i32* %4
%30 = icmp slt i32 %29, 60
br i1 %30, label %31, label %41
31: ; preds = %28
%32 = load i32, i32* %2
%33 = load i32, i32* %3
%34 = load i32, i32* %4
%35 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %32, i32 %33, i32 %34)
%36 = call i32 @sleep(i32 1)
%37 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %38
38: ; preds = %31
%39 = load i32, i32* %4
%40 = add nsw i32 %39, 1
store i32 %40, i32* %4
br label %28
41: ; preds = %28
store i32 0, i32* %8
br label %42
42: ; preds = %41
%43 = load i32, i32* %3
%44 = add nsw i32 %43, 1
store i32 %44, i32* %3
br label %23
45: ; preds = %23
store i32 0, i32* %7
br label %46
46: ; preds = %45
%47 = load i32, i32* %2
%48 = add nsw i32 %47, 1
store i32 %48, i32* %2
br label %18
49: ; preds = %18
ret i32 0
}

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