#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);
int /*<<< orphan*/ waste_time(int);
int main() {
  int MAX_COUNT = 10;
  int lt = 1, count = 0;
  while (count++ < MAX_COUNT) {
    printf("Count %d : launching the useless loss of time...\n", count);
    waste_time(lt);
    printf("We have lost %d seconds\n", lt);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
cmp    -0x8(%rbp),%eax
jge    1183 <main+0x63>
mov    -0x10(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <waste_time@plt>
mov    -0xc(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    1144 <main+0x24>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <waste_time@plt>
lea    0xee9(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <waste_time@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <waste_time@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <waste_time@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <waste_time@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <waste_time@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <waste_time@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <waste_time@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <waste_time@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <waste_time@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [50 x i8] c"Count %d : launching the useless loss of time...\0A\00"
@.str.1 = [25 x i8] c"We have lost %d seconds\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 1, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %10, %0
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %17
10: ; preds = %5
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %3
%14 = call i32 @waste_time(i32 %13)
%15 = load i32, i32* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %5
17: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [50 x i8] c"Count %d : launching the useless loss of time...\0A\00"
@.str.1 = [25 x i8] c"We have lost %d seconds\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @waste_time(i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 2)
%5 = tail call i32 @waste_time(i32 1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 1)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 3)
%8 = tail call i32 @waste_time(i32 1)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 1)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 4)
%11 = tail call i32 @waste_time(i32 1)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 1)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 5)
%14 = tail call i32 @waste_time(i32 1)
%15 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 1)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 6)
%17 = tail call i32 @waste_time(i32 1)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 1)
%19 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 7)
%20 = tail call i32 @waste_time(i32 1)
%21 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 1)
%22 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 8)
%23 = tail call i32 @waste_time(i32 1)
%24 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 1)
%25 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 9)
%26 = tail call i32 @waste_time(i32 1)
%27 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 1)
%28 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 10)
%29 = tail call i32 @waste_time(i32 1)
%30 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i32 0
}