#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;
  i = 0;
  do {
    __print_int(i);
    ++i;
  } while (i < 5);
  i = 0;
  do {
    ++i;
  } while (0);
  __print_int(i);
  i = 0;
  do {
    ++i;
    if (i > 999) {
      break;
    }
  } while (1);
  __print_int(i);
  a = 0;
  i = -1;
  do {
    ++i;
    a += i;
    continue;
    a *= i;
  } while (i < 9);
  __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)
mov    -0x8(%rbp),%edi
call   1030 <__print_int@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jl     1126 <main+0x16>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <__print_int@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x3e7,-0x8(%rbp)
jle    117b <main+0x6b>
jmp    118f <main+0x7f>
jmp    1180 <main+0x70>
mov    $0x1,%al
test   $0x1,%al
jne    1160 <main+0x50>
jmp    118f <main+0x7f>
mov    -0x8(%rbp),%edi
call   1030 <__print_int@plt>
movl   $0x0,-0xc(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x9,-0x8(%rbp)
jl     11a5 <main+0x95>
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    $0x1,%edi
call   1030 <__print_int@plt>
mov    $0x3e8,%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 = %9, %0
%5 = load i32, i32* %2
%6 = call i32 @__print_int(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %9
9: ; preds = %4
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 5
br i1 %11, label %4, label %12
12: ; preds = %9
store i32 0, i32* %2
br label %13
13: ; preds = %12
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %16
16: ; preds = %13
%17 = load i32, i32* %2
%18 = call i32 @__print_int(i32 %17)
store i32 0, i32* %2
br label %19
19: ; preds = %26, %16
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
%22 = load i32, i32* %2
%23 = icmp sgt i32 %22, 999
br i1 %23, label %24, label %25
24: ; preds = %19
br label %27
25: ; preds = %19
br label %26
26: ; preds = %25
br i1 true, label %19, label %27
27: ; preds = %26, %24
%28 = load i32, i32* %2
%29 = call i32 @__print_int(i32 %28)
store i32 0, i32* %3
store i32 -1, i32* %2
br label %30
30: ; preds = %36, %27
%31 = load i32, i32* %2
%32 = add nsw i32 %31, 1
store i32 %32, i32* %2
%33 = load i32, i32* %2
%34 = load i32, i32* %3
%35 = add nsw i32 %34, %33
store i32 %35, i32* %3
br label %36
36: ; preds = %30
%37 = load i32, i32* %2
%38 = icmp slt i32 %37, 9
br i1 %38, label %30, label %39
39: ; preds = %36
%40 = load i32, i32* %3
%41 = call i32 @__print_int(i32 %40)
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 1)
%7 = tail call i32 @__print_int(i32 1000)
%8 = tail call i32 @__print_int(i32 45)
ret i32 0
}