#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_int(int);
int main() {
  int i;
  int a;
  for (i = 0; i < 5; i++) {
    __print_int(i);
  }
  a = 0;
  for (i = 1; i <= 1000; i++) {
    a += i;
  }
  __print_int(a);
  for (; 0;) {
    __print_int(999);
    break;
  }
  i = 0;
  for (;;) {
    if (i > 100) {
      break;
    }
    ++i;
  }
  __print_int(i);
  a = 0;
  for (i = 0; i < 10; i++) {
    a += i;
    continue;
    a *= i;
  }
  __print_int(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <__print_int@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jg     1178 <main+0x68>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1154 <main+0x44>
mov    -0xc(%rbp),%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
test   $0x1,%al
jne    118f <main+0x7f>
jmp    1199 <main+0x89>
mov    $0x3e7,%edi
call   1030 <__print_int@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jle    11af <main+0x9f>
jmp    11bd <main+0xad>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a0 <main+0x90>
mov    -0x8(%rbp),%edi
call   1030 <__print_int@plt>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11f4 <main+0xe4>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11d3 <main+0xc3>
mov    -0xc(%rbp),%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <__print_int@plt>
mov    $0x1,%edi
call   1030 <__print_int@plt>
mov    $0x2,%edi
call   1030 <__print_int@plt>
mov    $0x3,%edi
call   1030 <__print_int@plt>
mov    $0x4,%edi
call   1030 <__print_int@plt>
mov    $0x7a314,%edi
call   1030 <__print_int@plt>
mov    $0x65,%edi
call   1030 <__print_int@plt>
mov    $0x2d,%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i32 @__print_int(i32 %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %4
13: ; preds = %4
store i32 0, i32* %3
store i32 1, i32* %2
br label %14
14: ; preds = %21, %13
%15 = load i32, i32* %2
%16 = icmp sle i32 %15, 1000
br i1 %16, label %17, label %24
17: ; preds = %14
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = add nsw i32 %19, %18
store i32 %20, i32* %3
br label %21
21: ; preds = %17
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %14
24: ; preds = %14
%25 = load i32, i32* %3
%26 = call i32 @__print_int(i32 %25)
br label %27
27: ; preds = %24
br i1 false, label %28, label %30
28: ; preds = %27
%29 = call i32 @__print_int(i32 999)
br label %30
30: ; preds = %28, %27
store i32 0, i32* %2
br label %31
31: ; preds = %35, %30
%32 = load i32, i32* %2
%33 = icmp sgt i32 %32, 100
br i1 %33, label %34, label %35
34: ; preds = %31
br label %38
35: ; preds = %31
%36 = load i32, i32* %2
%37 = add nsw i32 %36, 1
store i32 %37, i32* %2
br label %31
38: ; preds = %34
%39 = load i32, i32* %2
%40 = call i32 @__print_int(i32 %39)
store i32 0, i32* %3
store i32 0, i32* %2
br label %41
41: ; preds = %48, %38
%42 = load i32, i32* %2
%43 = icmp slt i32 %42, 10
br i1 %43, label %44, label %51
44: ; preds = %41
%45 = load i32, i32* %2
%46 = load i32, i32* %3
%47 = add nsw i32 %46, %45
store i32 %47, i32* %3
br label %48
48: ; preds = %44
%49 = load i32, i32* %2
%50 = add nsw i32 %49, 1
store i32 %50, i32* %2
br label %41
51: ; preds = %41
%52 = load i32, i32* %3
%53 = call i32 @__print_int(i32 %52)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 0)
%2 = tail call i32 @__print_int(i32 1)
%3 = tail call i32 @__print_int(i32 2)
%4 = tail call i32 @__print_int(i32 3)
%5 = tail call i32 @__print_int(i32 4)
%6 = tail call i32 @__print_int(i32 500500)
%7 = tail call i32 @__print_int(i32 101)
%8 = tail call i32 @__print_int(i32 45)
ret i32 0
}