#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*/);
int /*<<< orphan*/ system(char *);
int main() {
  int i, j, n = 9;
#pragma omp parallel for default(none) schedule(runtime) private(i, j) shared(n)
  for (i = 0; i < n; i++) {
    printf("Iteration %d executed by thread %d\n", i, 0);
    for (j = 0; j < i; j++)
      system("sleep 1");
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    119a <main+0x7a>
mov    -0x8(%rbp),%esi
lea    0xead(%rip),%rdi
xor    %edx,%edx
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1187 <main+0x67>
lea    0xeb0(%rip),%rdi
call   1030 <system@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1161 <main+0x41>
jmp    118c <main+0x6c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
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
xor    %esi,%esi
xor    %edx,%edx
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <printf@plt>
lea    0xed7(%rip),%rbx
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %r14,%rdi
mov    $0x2,%esi
xor    %edx,%edx
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %r14,%rdi
mov    $0x3,%esi
xor    %edx,%edx
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %r14,%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %r14,%rdi
mov    $0x5,%esi
xor    %edx,%edx
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %r14,%rdi
mov    $0x6,%esi
xor    %edx,%edx
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %r14,%rdi
mov    $0x7,%esi
xor    %edx,%edx
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %r14,%rdi
mov    $0x8,%esi
xor    %edx,%edx
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Iteration %d executed by thread %d\0A\00"
@.str.1 = [8 x i8] c"sleep 1\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 9, i32* %4
store i32 0, i32* %2
br label %5
5: ; preds = %22, %0
%6 = load i32, i32* %2
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %25
9: ; preds = %5
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %10, i32 0)
store i32 0, i32* %3
br label %12
12: ; preds = %18, %9
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %12
21: ; preds = %12
br label %22
22: ; preds = %21
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %5
25: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"Iteration %d executed by thread %d\0A\00"
@.str.1 = [8 x i8] c"sleep 1\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 1, i32 0)
%3 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 2, i32 0)
%5 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 3, i32 0)
%8 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 4, i32 0)
%12 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%14 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%15 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%16 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 5, i32 0)
%17 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%18 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%19 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%20 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%21 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%22 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 6, i32 0)
%23 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%24 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%25 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%26 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%27 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%28 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%29 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 7, i32 0)
%30 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%31 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%32 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%33 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%34 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%35 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%36 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%37 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 8, i32 0)
%38 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%39 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%40 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%41 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%42 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%43 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%44 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%45 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}