#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*/ putchar(int);
int main() {
  int i, j;
  for (i = 0; i < 8; i++) {
    putchar(i);
    for (j = 1; j < 512; j++) {
      putchar(j);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    1175 <main+0x65>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
movl   $0x1,-0xc(%rbp)
cmpl   $0x200,-0xc(%rbp)
jge    1162 <main+0x52>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <main+0x2f>
jmp    1167 <main+0x57>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1030 <putchar@plt>
mov    $0x1,%ebx
nopl   (%rax)
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x200,%ebx
jne    1120 <main+0x10>
mov    $0x1,%ebx
mov    $0x1,%edi
call   1030 <putchar@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x200,%ebx
jne    1150 <main+0x40>
mov    $0x2,%edi
call   1030 <putchar@plt>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x200,%ebx
jne    1180 <main+0x70>
mov    $0x3,%edi
call   1030 <putchar@plt>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x200,%ebx
jne    11b0 <main+0xa0>
mov    $0x4,%edi
call   1030 <putchar@plt>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x200,%ebx
jne    11e0 <main+0xd0>
mov    $0x5,%edi
call   1030 <putchar@plt>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x200,%ebx
jne    1210 <main+0x100>
mov    $0x6,%edi
call   1030 <putchar@plt>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x200,%ebx
jne    1240 <main+0x130>
mov    $0x7,%edi
call   1030 <putchar@plt>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x200,%ebx
jne    1270 <main+0x160>
xor    %eax,%eax
pop    %rbx
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 = %20, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 8
br i1 %6, label %7, label %23
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i32 @putchar(i32 %8)
store i32 1, i32* %3
br label %10
10: ; preds = %16, %7
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 512
br i1 %12, label %13, label %19
13: ; preds = %10
%14 = load i32, i32* %3
%15 = call i32 @putchar(i32 %14)
br label %16
16: ; preds = %13
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %10
19: ; preds = %10
br label %20
20: ; preds = %19
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %4
23: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 0)
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %5, %2 ]
%4 = tail call i32 @putchar(i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 512
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = tail call i32 @putchar(i32 1)
br label %9
9: ; preds = %9, %7
%10 = phi i32 [ 1, %7 ], [ %12, %9 ]
%11 = tail call i32 @putchar(i32 %10)
%12 = add nuw nsw i32 %10, 1
%13 = icmp eq i32 %12, 512
br i1 %13, label %14, label %9
14: ; preds = %9
%15 = tail call i32 @putchar(i32 2)
br label %16
16: ; preds = %16, %14
%17 = phi i32 [ 1, %14 ], [ %19, %16 ]
%18 = tail call i32 @putchar(i32 %17)
%19 = add nuw nsw i32 %17, 1
%20 = icmp eq i32 %19, 512
br i1 %20, label %21, label %16
21: ; preds = %16
%22 = tail call i32 @putchar(i32 3)
br label %23
23: ; preds = %23, %21
%24 = phi i32 [ 1, %21 ], [ %26, %23 ]
%25 = tail call i32 @putchar(i32 %24)
%26 = add nuw nsw i32 %24, 1
%27 = icmp eq i32 %26, 512
br i1 %27, label %28, label %23
28: ; preds = %23
%29 = tail call i32 @putchar(i32 4)
br label %30
30: ; preds = %30, %28
%31 = phi i32 [ 1, %28 ], [ %33, %30 ]
%32 = tail call i32 @putchar(i32 %31)
%33 = add nuw nsw i32 %31, 1
%34 = icmp eq i32 %33, 512
br i1 %34, label %35, label %30
35: ; preds = %30
%36 = tail call i32 @putchar(i32 5)
br label %37
37: ; preds = %37, %35
%38 = phi i32 [ 1, %35 ], [ %40, %37 ]
%39 = tail call i32 @putchar(i32 %38)
%40 = add nuw nsw i32 %38, 1
%41 = icmp eq i32 %40, 512
br i1 %41, label %42, label %37
42: ; preds = %37
%43 = tail call i32 @putchar(i32 6)
br label %44
44: ; preds = %44, %42
%45 = phi i32 [ 1, %42 ], [ %47, %44 ]
%46 = tail call i32 @putchar(i32 %45)
%47 = add nuw nsw i32 %45, 1
%48 = icmp eq i32 %47, 512
br i1 %48, label %49, label %44
49: ; preds = %44
%50 = tail call i32 @putchar(i32 7)
br label %51
51: ; preds = %51, %49
%52 = phi i32 [ 1, %49 ], [ %54, %51 ]
%53 = tail call i32 @putchar(i32 %52)
%54 = add nuw nsw i32 %52, 1
%55 = icmp eq i32 %54, 512
br i1 %55, label %56, label %51
56: ; preds = %51
ret i32 0
}