#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*/ print(char *);
int /*<<< orphan*/ printid(int);
int main() {
  int i = 0;
  for (;;) {
    i++;
    if (i > 1)
      break;
  }
  print("i  2");
  printid(i);
  for (i = 0;;) {
    i++;
    if (i > 2)
      break;
  }
  print("i  3");
  printid(i);
  i = 0;
  for (; i < 4;) {
    i++;
  }
  print("i  4");
  printid(i);
  i = 0;
  for (;; i++) {
    if (i > 4)
      break;
  }
  print("i  5");
  printid(i);
  for (i = 0; i < 6;)
    i++;
  print("i  6");
  printid(i);
  i = 0;
  for (; i < 7; i++) {
  }
  print("i  7");
  printid(i);
  for (i = 0;; i++)
    if (i > 7)
      break;
  print("i  8");
  printid(i);
  i = 1;
  for (i = 0; i < 9; i++)
    ;
  print("i  9");
  printid(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    114e <main+0x2e>
jmp    1153 <main+0x33>
jmp    1136 <main+0x16>
lea    0xea6(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printid@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    1186 <main+0x66>
jmp    118b <main+0x6b>
jmp    116e <main+0x4e>
lea    0xe73(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printid@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    11be <main+0x9e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a6 <main+0x86>
lea    0xe45(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printid@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jle    11e8 <main+0xc8>
jmp    11fb <main+0xdb>
jmp    11ed <main+0xcd>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11d9 <main+0xb9>
lea    0xe0d(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printid@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    122e <main+0x10e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1216 <main+0xf6>
lea    0xddf(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printid@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
jge    1266 <main+0x146>
jmp    1258 <main+0x138>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1249 <main+0x129>
lea    0xdac(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printid@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
jle    1290 <main+0x170>
jmp    12a3 <main+0x183>
jmp    1295 <main+0x175>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1281 <main+0x161>
lea    0xd74(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printid@plt>
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jge    12e2 <main+0x1c2>
jmp    12d4 <main+0x1b4>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12c5 <main+0x1a5>
lea    0xd3a(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <print@plt>
mov    $0x2,%edi
call   1040 <printid@plt>
lea    0xec7(%rip),%rdi
call   1030 <print@plt>
mov    $0x3,%edi
call   1040 <printid@plt>
lea    0xeb6(%rip),%rdi
call   1030 <print@plt>
mov    $0x4,%edi
call   1040 <printid@plt>
lea    0xea5(%rip),%rdi
call   1030 <print@plt>
mov    $0x5,%edi
call   1040 <printid@plt>
lea    0xe94(%rip),%rdi
call   1030 <print@plt>
mov    $0x6,%edi
call   1040 <printid@plt>
lea    0xe83(%rip),%rdi
call   1030 <print@plt>
mov    $0x7,%edi
call   1040 <printid@plt>
lea    0xe72(%rip),%rdi
call   1030 <print@plt>
mov    $0x8,%edi
call   1040 <printid@plt>
lea    0xe61(%rip),%rdi
call   1030 <print@plt>
mov    $0x9,%edi
call   1040 <printid@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"i 2\00"
@.str.1 = [5 x i8] c"i 3\00"
@.str.2 = [5 x i8] c"i 4\00"
@.str.3 = [5 x i8] c"i 5\00"
@.str.4 = [5 x i8] c"i 6\00"
@.str.5 = [5 x i8] c"i 7\00"
@.str.6 = [5 x i8] c"i 8\00"
@.str.7 = [5 x i8] c"i 9\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %3
br label %10
9: ; preds = %3
br label %3
10: ; preds = %8
%11 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %2
%13 = call i32 @printid(i32 %12)
store i32 0, i32* %2
br label %14
14: ; preds = %20, %10
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = icmp sgt i32 %17, 2
br i1 %18, label %19, label %20
19: ; preds = %14
br label %21
20: ; preds = %14
br label %14
21: ; preds = %19
%22 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%23 = load i32, i32* %2
%24 = call i32 @printid(i32 %23)
store i32 0, i32* %2
br label %25
25: ; preds = %28, %21
%26 = load i32, i32* %2
%27 = icmp slt i32 %26, 4
br i1 %27, label %28, label %31
28: ; preds = %25
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
br label %25
31: ; preds = %25
%32 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%33 = load i32, i32* %2
%34 = call i32 @printid(i32 %33)
store i32 0, i32* %2
br label %35
35: ; preds = %40, %31
%36 = load i32, i32* %2
%37 = icmp sgt i32 %36, 4
br i1 %37, label %38, label %39
38: ; preds = %35
br label %43
39: ; preds = %35
br label %40
40: ; preds = %39
%41 = load i32, i32* %2
%42 = add nsw i32 %41, 1
store i32 %42, i32* %2
br label %35
43: ; preds = %38
%44 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%45 = load i32, i32* %2
%46 = call i32 @printid(i32 %45)
store i32 0, i32* %2
br label %47
47: ; preds = %50, %43
%48 = load i32, i32* %2
%49 = icmp slt i32 %48, 6
br i1 %49, label %50, label %53
50: ; preds = %47
%51 = load i32, i32* %2
%52 = add nsw i32 %51, 1
store i32 %52, i32* %2
br label %47
53: ; preds = %47
%54 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%55 = load i32, i32* %2
%56 = call i32 @printid(i32 %55)
store i32 0, i32* %2
br label %57
57: ; preds = %61, %53
%58 = load i32, i32* %2
%59 = icmp slt i32 %58, 7
br i1 %59, label %60, label %64
60: ; preds = %57
br label %61
61: ; preds = %60
%62 = load i32, i32* %2
%63 = add nsw i32 %62, 1
store i32 %63, i32* %2
br label %57
64: ; preds = %57
%65 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%66 = load i32, i32* %2
%67 = call i32 @printid(i32 %66)
store i32 0, i32* %2
br label %68
68: ; preds = %73, %64
%69 = load i32, i32* %2
%70 = icmp sgt i32 %69, 7
br i1 %70, label %71, label %72
71: ; preds = %68
br label %76
72: ; preds = %68
br label %73
73: ; preds = %72
%74 = load i32, i32* %2
%75 = add nsw i32 %74, 1
store i32 %75, i32* %2
br label %68
76: ; preds = %71
%77 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%78 = load i32, i32* %2
%79 = call i32 @printid(i32 %78)
store i32 1, i32* %2
store i32 0, i32* %2
br label %80
80: ; preds = %84, %76
%81 = load i32, i32* %2
%82 = icmp slt i32 %81, 9
br i1 %82, label %83, label %87
83: ; preds = %80
br label %84
84: ; preds = %83
%85 = load i32, i32* %2
%86 = add nsw i32 %85, 1
store i32 %86, i32* %2
br label %80
87: ; preds = %80
%88 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%89 = load i32, i32* %2
%90 = call i32 @printid(i32 %89)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"i 2\00"
@.str.1 = [5 x i8] c"i 3\00"
@.str.2 = [5 x i8] c"i 4\00"
@.str.3 = [5 x i8] c"i 5\00"
@.str.4 = [5 x i8] c"i 6\00"
@.str.5 = [5 x i8] c"i 7\00"
@.str.6 = [5 x i8] c"i 8\00"
@.str.7 = [5 x i8] c"i 9\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printid(i32 2)
%3 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printid(i32 3)
%5 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @printid(i32 4)
%7 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @printid(i32 5)
%9 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 @printid(i32 6)
%11 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%12 = tail call i32 @printid(i32 7)
%13 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%14 = tail call i32 @printid(i32 8)
%15 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%16 = tail call i32 @printid(i32 9)
ret i32 0
}