#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 *, unsigned int, unsigned int, unsigned int);
int /*<<< orphan*/ sleep(int);
int main2() {
  int i;
  for (unsigned int hour = 0; hour < 24; hour++) {
    for (unsigned int minute = 0; minute < 60; minute++) {
      for (unsigned int second = 0; second < 60; second++) {
        sleep(1);
        printf("%d hours : %d minutes : %d seconds have passed\n", hour, minute,
               second);
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
cmpl   $0x18,-0x8(%rbp)
jae    11ae <main2+0x8e>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3c,-0xc(%rbp)
jae    119b <main2+0x7b>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3c,-0x10(%rbp)
jae    1188 <main2+0x68>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1151 <main2+0x31>
jmp    118d <main2+0x6d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1140 <main2+0x20>
jmp    11a0 <main2+0x80>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <main2+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %r15d,%r15d
lea    0xecf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x3c,%ebx
jne    1160 <main2+0x40>
add    $0x1,%ebp
cmp    $0x3c,%ebp
jne    1150 <main2+0x30>
add    $0x1,%r15d
cmp    $0x18,%r15d
jne    1140 <main2+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [48 x i8] c"%d hours : %d minutes : %d seconds have passed\0A\00"
define i32 @main2() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %2
br label %5
5: ; preds = %30, %0
%6 = load i32, i32* %2
%7 = icmp ult i32 %6, 24
br i1 %7, label %8, label %33
8: ; preds = %5
store i32 0, i32* %3
br label %9
9: ; preds = %26, %8
%10 = load i32, i32* %3
%11 = icmp ult i32 %10, 60
br i1 %11, label %12, label %29
12: ; preds = %9
store i32 0, i32* %4
br label %13
13: ; preds = %22, %12
%14 = load i32, i32* %4
%15 = icmp ult i32 %14, 60
br i1 %15, label %16, label %25
16: ; preds = %13
%17 = call i32 @sleep(i32 1)
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %19, i32 %20)
br label %22
22: ; preds = %16
%23 = load i32, i32* %4
%24 = add i32 %23, 1
store i32 %24, i32* %4
br label %13
25: ; preds = %13
br label %26
26: ; preds = %25
%27 = load i32, i32* %3
%28 = add i32 %27, 1
store i32 %28, i32* %3
br label %9
29: ; preds = %9
br label %30
30: ; preds = %29
%31 = load i32, i32* %2
%32 = add i32 %31, 1
store i32 %32, i32* %2
br label %5
33: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [48 x i8] c"%d hours : %d minutes : %d seconds have passed\0A\00"
define i32 @main2() {
br label %1
1: ; preds = %0, %6
%2 = phi i32 [ 0, %0 ], [ %7, %6 ]
br label %4
3: ; preds = %6
ret i32 0
4: ; preds = %1, %9
%5 = phi i32 [ 0, %1 ], [ %10, %9 ]
br label %12
6: ; preds = %9
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 24
br i1 %8, label %3, label %1
9: ; preds = %12
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %10, 60
br i1 %11, label %6, label %4
12: ; preds = %4, %12
%13 = phi i32 [ 0, %4 ], [ %16, %12 ]
%14 = tail call i32 @sleep(i32 1)
%15 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %5, i32 %13)
%16 = add nuw nsw i32 %13, 1
%17 = icmp eq i32 %16, 60
br i1 %17, label %9, label %12
}