#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*/ putInMemory(int, int, int);
int main() {
  int start;
  int i;
  start = 0x8000;
  for (i = 0; i < 25 * 80; i++) {
    putInMemory(0xB000, start, ' ');
    start += 2;
  }
  putInMemory(0xB000, 0x8000, 'H');
  putInMemory(0xB000, 0x8001, 0x7);
  putInMemory(0xB000, 0x8002, 'E');
  putInMemory(0xB000, 0x8003, 0x7);
  putInMemory(0xB000, 0x8004, 'L');
  putInMemory(0xB000, 0x8005, 0x7);
  putInMemory(0xB000, 0x8006, 'L');
  putInMemory(0xB000, 0x8007, 0x7);
  putInMemory(0xB000, 0x8008, 'O');
  putInMemory(0xB000, 0x8009, 0x7);
  putInMemory(0xB000, 0x800A, ' ');
  putInMemory(0xB000, 0x800C, 'W');
  putInMemory(0xB000, 0x800D, 0x7);
  putInMemory(0xB000, 0x800E, 'O');
  putInMemory(0xB000, 0x800F, 0x7);
  putInMemory(0xB000, 0x8010, 'R');
  putInMemory(0xB000, 0x8011, 0x7);
  putInMemory(0xB000, 0x8012, 'L');
  putInMemory(0xB000, 0x8013, 0x7);
  putInMemory(0xB000, 0x8014, 'D');
  putInMemory(0xB000, 0x8015, 0x7);
  while (1) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x8000,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x7d0,-0xc(%rbp)
jge    1163 <main+0x53>
mov    -0x8(%rbp),%esi
mov    $0xb000,%edi
mov    $0x20,%edx
call   1030 <putInMemory@plt>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    $0xb000,%edi
mov    $0x8000,%esi
mov    $0x48,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8001,%esi
mov    $0x7,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8002,%esi
mov    $0x45,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8003,%esi
mov    $0x7,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8004,%esi
mov    $0x4c,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8005,%esi
mov    $0x7,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8006,%esi
mov    $0x4c,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8007,%esi
mov    $0x7,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8008,%esi
mov    $0x4f,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8009,%esi
mov    $0x7,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x800a,%esi
mov    $0x20,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x800c,%esi
mov    $0x57,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x800d,%esi
mov    $0x7,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x800e,%esi
mov    $0x4f,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x800f,%esi
mov    $0x7,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8010,%esi
mov    $0x52,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8011,%esi
mov    $0x7,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8012,%esi
mov    $0x4c,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8013,%esi
mov    $0x7,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8014,%esi
mov    $0x44,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8015,%esi
mov    $0x7,%edx
call   1030 <putInMemory@plt>
jmp    1307 <main+0x1f7>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x8000,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0xb000,%edi
mov    %ebx,%esi
mov    $0x20,%edx
call   1030 <putInMemory@plt>
add    $0x2,%ebx
cmp    $0x8fa0,%ebx
jne    1120 <main+0x10>
mov    $0xb000,%edi
mov    $0x8000,%esi
mov    $0x48,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8001,%esi
mov    $0x7,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8002,%esi
mov    $0x45,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8003,%esi
mov    $0x7,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8004,%esi
mov    $0x4c,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8005,%esi
mov    $0x7,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8006,%esi
mov    $0x4c,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8007,%esi
mov    $0x7,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8008,%esi
mov    $0x4f,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8009,%esi
mov    $0x7,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x800a,%esi
mov    $0x20,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x800c,%esi
mov    $0x57,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x800d,%esi
mov    $0x7,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x800e,%esi
mov    $0x4f,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x800f,%esi
mov    $0x7,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8010,%esi
mov    $0x52,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8011,%esi
mov    $0x7,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8012,%esi
mov    $0x4c,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8013,%esi
mov    $0x7,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8014,%esi
mov    $0x44,%edx
call   1030 <putInMemory@plt>
mov    $0xb000,%edi
mov    $0x8015,%esi
mov    $0x7,%edx
call   1030 <putInMemory@plt>
jmp    12e0 <main+0x1d0>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 32768, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 2000
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i32 @putInMemory(i32 45056, i32 %8, i32 32)
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 2
store i32 %11, i32* %2
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = call i32 @putInMemory(i32 45056, i32 32768, i32 72)
%17 = call i32 @putInMemory(i32 45056, i32 32769, i32 7)
%18 = call i32 @putInMemory(i32 45056, i32 32770, i32 69)
%19 = call i32 @putInMemory(i32 45056, i32 32771, i32 7)
%20 = call i32 @putInMemory(i32 45056, i32 32772, i32 76)
%21 = call i32 @putInMemory(i32 45056, i32 32773, i32 7)
%22 = call i32 @putInMemory(i32 45056, i32 32774, i32 76)
%23 = call i32 @putInMemory(i32 45056, i32 32775, i32 7)
%24 = call i32 @putInMemory(i32 45056, i32 32776, i32 79)
%25 = call i32 @putInMemory(i32 45056, i32 32777, i32 7)
%26 = call i32 @putInMemory(i32 45056, i32 32778, i32 32)
%27 = call i32 @putInMemory(i32 45056, i32 32780, i32 87)
%28 = call i32 @putInMemory(i32 45056, i32 32781, i32 7)
%29 = call i32 @putInMemory(i32 45056, i32 32782, i32 79)
%30 = call i32 @putInMemory(i32 45056, i32 32783, i32 7)
%31 = call i32 @putInMemory(i32 45056, i32 32784, i32 82)
%32 = call i32 @putInMemory(i32 45056, i32 32785, i32 7)
%33 = call i32 @putInMemory(i32 45056, i32 32786, i32 76)
%34 = call i32 @putInMemory(i32 45056, i32 32787, i32 7)
%35 = call i32 @putInMemory(i32 45056, i32 32788, i32 68)
%36 = call i32 @putInMemory(i32 45056, i32 32789, i32 7)
br label %37
37: ; preds = %15, %37
br label %37
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = phi i32 [ 32768, %0 ], [ %5, %1 ]
%4 = tail call i32 @putInMemory(i32 45056, i32 %3, i32 32)
%5 = add nuw nsw i32 %3, 2
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 2000
br i1 %7, label %8, label %1
8: ; preds = %1
%9 = tail call i32 @putInMemory(i32 45056, i32 32768, i32 72)
%10 = tail call i32 @putInMemory(i32 45056, i32 32769, i32 7)
%11 = tail call i32 @putInMemory(i32 45056, i32 32770, i32 69)
%12 = tail call i32 @putInMemory(i32 45056, i32 32771, i32 7)
%13 = tail call i32 @putInMemory(i32 45056, i32 32772, i32 76)
%14 = tail call i32 @putInMemory(i32 45056, i32 32773, i32 7)
%15 = tail call i32 @putInMemory(i32 45056, i32 32774, i32 76)
%16 = tail call i32 @putInMemory(i32 45056, i32 32775, i32 7)
%17 = tail call i32 @putInMemory(i32 45056, i32 32776, i32 79)
%18 = tail call i32 @putInMemory(i32 45056, i32 32777, i32 7)
%19 = tail call i32 @putInMemory(i32 45056, i32 32778, i32 32)
%20 = tail call i32 @putInMemory(i32 45056, i32 32780, i32 87)
%21 = tail call i32 @putInMemory(i32 45056, i32 32781, i32 7)
%22 = tail call i32 @putInMemory(i32 45056, i32 32782, i32 79)
%23 = tail call i32 @putInMemory(i32 45056, i32 32783, i32 7)
%24 = tail call i32 @putInMemory(i32 45056, i32 32784, i32 82)
%25 = tail call i32 @putInMemory(i32 45056, i32 32785, i32 7)
%26 = tail call i32 @putInMemory(i32 45056, i32 32786, i32 76)
%27 = tail call i32 @putInMemory(i32 45056, i32 32787, i32 7)
%28 = tail call i32 @putInMemory(i32 45056, i32 32788, i32 68)
%29 = tail call i32 @putInMemory(i32 45056, i32 32789, i32 7)
br label %30
30: ; preds = %30, %8
br label %30
}