#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*/ sleep(int);
int /*<<< orphan*/ system(char *);
main() {
  int i;
  i = 0;
  sleep(10);
  while (i < 5) {
    system("date");
    sleep(5);
    i++;
  }
  while (1) {
    system("date");
    sleep(10);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0xa,%edi
call   1040 <sleep@plt>
cmpl   $0x5,-0x8(%rbp)
jge    116e <main+0x4e>
lea    0xeaf(%rip),%rdi
call   1030 <system@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <main+0x20>
jmp    1173 <main+0x53>
lea    0xe86(%rip),%rdi
call   1030 <system@plt>
mov    $0xa,%edi
call   1040 <sleep@plt>
jmp    1173 <main+0x53>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1040 <sleep@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
call   1030 <system@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <system@plt>
mov    $0xa,%edi
call   1040 <sleep@plt>
jmp    1190 <main+0x70>

LLVM IR (-O0):
@.str = [5 x i8] c"date\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @sleep(i32 10)
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @sleep(i32 5)
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %4
12: ; preds = %4
br label %13
13: ; preds = %12, %13
%14 = call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @sleep(i32 10)
br label %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"date\00"
define i32 @main() {
%1 = tail call i32 @sleep(i32 10)
%2 = tail call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 5)
%4 = tail call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @sleep(i32 5)
%6 = tail call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @sleep(i32 5)
%8 = tail call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @sleep(i32 5)
%10 = tail call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @sleep(i32 5)
br label %12
12: ; preds = %0, %12
%13 = tail call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%14 = tail call i32 @sleep(i32 10)
br label %12
}