#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*/ clear();
int /*<<< orphan*/ enableReset();
int /*<<< orphan*/ newline();
int /*<<< orphan*/ printf_small(char *, int);
void main() {
  int x;
  enableReset();
  clear();
  for (x = 0; x < 10; x++) {
    printf_small("Hello! %d", x);
    newline();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <enableReset@plt>
mov    $0x0,%al
call   1050 <clear@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    118b <main+0x4b>
mov    -0x4(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1040 <printf_small@plt>
mov    $0x0,%al
call   1030 <newline@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    115d <main+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <enableReset@plt>
xor    %eax,%eax
call   1050 <clear@plt>
lea    0xeaa(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <printf_small@plt>
xor    %eax,%eax
call   1030 <newline@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <printf_small@plt>
xor    %eax,%eax
call   1030 <newline@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <printf_small@plt>
xor    %eax,%eax
call   1030 <newline@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <printf_small@plt>
xor    %eax,%eax
call   1030 <newline@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <printf_small@plt>
xor    %eax,%eax
call   1030 <newline@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <printf_small@plt>
xor    %eax,%eax
call   1030 <newline@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <printf_small@plt>
xor    %eax,%eax
call   1030 <newline@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <printf_small@plt>
xor    %eax,%eax
call   1030 <newline@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <printf_small@plt>
xor    %eax,%eax
call   1030 <newline@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1040 <printf_small@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <newline@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Hello! %d\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (...) @enableReset()
%3 = call i32 (...) @clear()
store i32 0, i32* %1
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %1
%9 = call i32 @printf_small(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 (...) @newline()
br label %11
11: ; preds = %7
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Hello! %d\00"
define void @main() {
%1 = tail call i32 (...) @enableReset()
%2 = tail call i32 (...) @clear()
%3 = tail call i32 @printf_small(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i32 (...) @newline()
%5 = tail call i32 @printf_small(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = tail call i32 (...) @newline()
%7 = tail call i32 @printf_small(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2)
%8 = tail call i32 (...) @newline()
%9 = tail call i32 @printf_small(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3)
%10 = tail call i32 (...) @newline()
%11 = tail call i32 @printf_small(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 4)
%12 = tail call i32 (...) @newline()
%13 = tail call i32 @printf_small(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 5)
%14 = tail call i32 (...) @newline()
%15 = tail call i32 @printf_small(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 6)
%16 = tail call i32 (...) @newline()
%17 = tail call i32 @printf_small(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 7)
%18 = tail call i32 (...) @newline()
%19 = tail call i32 @printf_small(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 8)
%20 = tail call i32 (...) @newline()
%21 = tail call i32 @printf_small(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9)
%22 = tail call i32 (...) @newline()
ret void
}