#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*/ write(char *);
int main() {
  int i;
  int p;
  int k, j;
  for (i = 0; i < 9; i = i + 1) {
  }
  for (i = 0, p = 4 + 4; i < 9; i = i + 1, p = i) {
    write("test");
  }
  for (;;) {
  }
  while (1) {
  }
  while (2) {
    write("haha");
    write("wow");
  }
  if (k == j) {
    write("first");
  }
  if (k == j) {
    write("first");
  } else if (j == k) {
    write("second");
  } else {
    write("third");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jge    1143 <main+0x33>
jmp    1135 <main+0x25>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
movl   $0x0,-0x8(%rbp)
movl   $0x8,-0xc(%rbp)
cmpl   $0x9,-0x8(%rbp)
jge    117b <main+0x6b>
lea    0xe9e(%rip),%rdi
call   1030 <write@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1151 <main+0x41>
jmp    1180 <main+0x70>
jmp    1180 <main+0x70>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <write@plt>
mov    %rbx,%rdi
call   1030 <write@plt>
mov    %rbx,%rdi
call   1030 <write@plt>
mov    %rbx,%rdi
call   1030 <write@plt>
mov    %rbx,%rdi
call   1030 <write@plt>
mov    %rbx,%rdi
call   1030 <write@plt>
mov    %rbx,%rdi
call   1030 <write@plt>
mov    %rbx,%rdi
call   1030 <write@plt>
mov    %rbx,%rdi
call   1030 <write@plt>
jmp    1160 <main+0x50>

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

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