#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*/ boxfill8(char *, int, int, int, int, int, int);
int /*<<< orphan*/ init_palette();
int /*<<< orphan*/ io_hlt();
void HariMain(void) {
  char *vram;
  int xsize, ysize;
  init_palette();
  vram = (char *)0xa0000;
  xsize = 320;
  ysize = 200;
  boxfill8(vram, xsize, 14, 0, 0, xsize - 1, ysize - 29);
  boxfill8(vram, xsize, 8, 0, ysize - 28, xsize - 1, ysize - 28);
  boxfill8(vram, xsize, 7, 0, ysize - 27, xsize - 1, ysize - 27);
  boxfill8(vram, xsize, 8, 0, ysize - 26, xsize - 1, ysize - 1);
  boxfill8(vram, xsize, 7, 3, ysize - 24, 59, ysize - 24);
  boxfill8(vram, xsize, 7, 2, ysize - 24, 2, ysize - 4);
  boxfill8(vram, xsize, 15, 3, ysize - 4, 59, ysize - 4);
  boxfill8(vram, xsize, 15, 59, ysize - 23, 59, ysize - 5);
  boxfill8(vram, xsize, 0, 2, ysize - 3, 59, ysize - 3);
  boxfill8(vram, xsize, 0, 60, ysize - 24, 60, ysize - 3);
  boxfill8(vram, xsize, 15, xsize - 47, ysize - 24, xsize - 4, ysize - 24);
  boxfill8(vram, xsize, 15, xsize - 47, ysize - 23, xsize - 47, ysize - 4);
  boxfill8(vram, xsize, 7, xsize - 47, ysize - 3, xsize - 4, ysize - 3);
  boxfill8(vram, xsize, 7, xsize - 3, ysize - 24, xsize - 3, ysize - 3);
  for (;;) {
    io_hlt();
  }
}


x86 assembly (clang, -O0):
<HariMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1050 <init_palette@plt>
mov    $0xa0000,%eax
mov    %rax,-0x8(%rbp)
movl   $0x140,-0xc(%rbp)
movl   $0xc8,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%r9d
sub    $0x1,%r9d
mov    -0x10(%rbp),%eax
sub    $0x1d,%eax
mov    $0xe,%edx
xor    %r8d,%r8d
mov    %r8d,%ecx
mov    %eax,(%rsp)
call   1030 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%r8d
sub    $0x1c,%r8d
mov    -0xc(%rbp),%r9d
sub    $0x1,%r9d
mov    -0x10(%rbp),%eax
sub    $0x1c,%eax
mov    $0x8,%edx
xor    %ecx,%ecx
mov    %eax,(%rsp)
call   1030 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%r8d
sub    $0x1b,%r8d
mov    -0xc(%rbp),%r9d
sub    $0x1,%r9d
mov    -0x10(%rbp),%eax
sub    $0x1b,%eax
mov    $0x7,%edx
xor    %ecx,%ecx
mov    %eax,(%rsp)
call   1030 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%r8d
sub    $0x1a,%r8d
mov    -0xc(%rbp),%r9d
sub    $0x1,%r9d
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    $0x8,%edx
xor    %ecx,%ecx
mov    %eax,(%rsp)
call   1030 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%r8d
sub    $0x18,%r8d
mov    -0x10(%rbp),%eax
sub    $0x18,%eax
mov    $0x7,%edx
mov    $0x3,%ecx
mov    $0x3b,%r9d
mov    %eax,(%rsp)
call   1030 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%r8d
sub    $0x18,%r8d
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
mov    $0x7,%edx
mov    $0x2,%r9d
mov    %r9d,%ecx
mov    %eax,(%rsp)
call   1030 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%r8d
sub    $0x4,%r8d
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
mov    $0xf,%edx
mov    $0x3,%ecx
mov    $0x3b,%r9d
mov    %eax,(%rsp)
call   1030 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%r8d
sub    $0x17,%r8d
mov    -0x10(%rbp),%eax
sub    $0x5,%eax
mov    $0xf,%edx
mov    $0x3b,%r9d
mov    %r9d,%ecx
mov    %eax,(%rsp)
call   1030 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%r8d
sub    $0x3,%r8d
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
xor    %edx,%edx
mov    $0x2,%ecx
mov    $0x3b,%r9d
mov    %eax,(%rsp)
call   1030 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%r8d
sub    $0x18,%r8d
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
xor    %edx,%edx
mov    $0x3c,%r9d
mov    %r9d,%ecx
mov    %eax,(%rsp)
call   1030 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%ecx
sub    $0x2f,%ecx
mov    -0x10(%rbp),%r8d
sub    $0x18,%r8d
mov    -0xc(%rbp),%r9d
sub    $0x4,%r9d
mov    -0x10(%rbp),%eax
sub    $0x18,%eax
mov    $0xf,%edx
mov    %eax,(%rsp)
call   1030 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%ecx
sub    $0x2f,%ecx
mov    -0x10(%rbp),%r8d
sub    $0x17,%r8d
mov    -0xc(%rbp),%r9d
sub    $0x2f,%r9d
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
mov    $0xf,%edx
mov    %eax,(%rsp)
call   1030 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%ecx
sub    $0x2f,%ecx
mov    -0x10(%rbp),%r8d
sub    $0x3,%r8d
mov    -0xc(%rbp),%r9d
sub    $0x4,%r9d
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
mov    $0x7,%edx
mov    %eax,(%rsp)
call   1030 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%ecx
sub    $0x3,%ecx
mov    -0x10(%rbp),%r8d
sub    $0x18,%r8d
mov    -0xc(%rbp),%r9d
sub    $0x3,%r9d
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
mov    $0x7,%edx
mov    %eax,(%rsp)
call   1030 <boxfill8@plt>
mov    $0x0,%al
call   1040 <io_hlt@plt>
jmp    13c4 <HariMain+0x294>

x86 assembly (clang, -O2):
<HariMain>:
push   %rax
xor    %eax,%eax
call   1050 <init_palette@plt>
movl   $0xab,(%rsp)
mov    $0xa0000,%edi
mov    $0x140,%esi
mov    $0xe,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    $0x13f,%r9d
call   1030 <boxfill8@plt>
movl   $0xac,(%rsp)
mov    $0xa0000,%edi
mov    $0x140,%esi
mov    $0x8,%edx
xor    %ecx,%ecx
mov    $0xac,%r8d
mov    $0x13f,%r9d
call   1030 <boxfill8@plt>
movl   $0xad,(%rsp)
mov    $0xa0000,%edi
mov    $0x140,%esi
mov    $0x7,%edx
xor    %ecx,%ecx
mov    $0xad,%r8d
mov    $0x13f,%r9d
call   1030 <boxfill8@plt>
movl   $0xc7,(%rsp)
mov    $0xa0000,%edi
mov    $0x140,%esi
mov    $0x8,%edx
xor    %ecx,%ecx
mov    $0xae,%r8d
mov    $0x13f,%r9d
call   1030 <boxfill8@plt>
movl   $0xb0,(%rsp)
mov    $0xa0000,%edi
mov    $0x140,%esi
mov    $0x7,%edx
mov    $0x3,%ecx
mov    $0xb0,%r8d
mov    $0x3b,%r9d
call   1030 <boxfill8@plt>
movl   $0xc4,(%rsp)
mov    $0xa0000,%edi
mov    $0x140,%esi
mov    $0x7,%edx
mov    $0x2,%ecx
mov    $0xb0,%r8d
mov    $0x2,%r9d
call   1030 <boxfill8@plt>
movl   $0xc4,(%rsp)
mov    $0xa0000,%edi
mov    $0x140,%esi
mov    $0xf,%edx
mov    $0x3,%ecx
mov    $0xc4,%r8d
mov    $0x3b,%r9d
call   1030 <boxfill8@plt>
movl   $0xc3,(%rsp)
mov    $0xa0000,%edi
mov    $0x140,%esi
mov    $0xf,%edx
mov    $0x3b,%ecx
mov    $0xb1,%r8d
mov    $0x3b,%r9d
call   1030 <boxfill8@plt>
movl   $0xc5,(%rsp)
mov    $0xa0000,%edi
mov    $0x140,%esi
xor    %edx,%edx
mov    $0x2,%ecx
mov    $0xc5,%r8d
mov    $0x3b,%r9d
call   1030 <boxfill8@plt>
movl   $0xc5,(%rsp)
mov    $0xa0000,%edi
mov    $0x140,%esi
xor    %edx,%edx
mov    $0x3c,%ecx
mov    $0xb0,%r8d
mov    $0x3c,%r9d
call   1030 <boxfill8@plt>
movl   $0xb0,(%rsp)
mov    $0xa0000,%edi
mov    $0x140,%esi
mov    $0xf,%edx
mov    $0x111,%ecx
mov    $0xb0,%r8d
mov    $0x13c,%r9d
call   1030 <boxfill8@plt>
movl   $0xc4,(%rsp)
mov    $0xa0000,%edi
mov    $0x140,%esi
mov    $0xf,%edx
mov    $0x111,%ecx
mov    $0xb1,%r8d
mov    $0x111,%r9d
call   1030 <boxfill8@plt>
movl   $0xc5,(%rsp)
mov    $0xa0000,%edi
mov    $0x140,%esi
mov    $0x7,%edx
mov    $0x111,%ecx
mov    $0xc5,%r8d
mov    $0x13c,%r9d
call   1030 <boxfill8@plt>
movl   $0xc5,(%rsp)
mov    $0xa0000,%edi
mov    $0x140,%esi
mov    $0x7,%edx
mov    $0x13d,%ecx
mov    $0xb0,%r8d
mov    $0x13d,%r9d
call   1030 <boxfill8@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <io_hlt@plt>
jmp    1390 <HariMain+0x260>

LLVM IR (-O0):
define void @HariMain() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @init_palette()
store i8* inttoptr (i64 655360 to i8*), i8** %1
store i32 320, i32* %2
store i32 200, i32* %3
%5 = load i8*, i8** %1
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 29
%11 = call i32 @boxfill8(i8* %5, i32 %6, i32 14, i32 0, i32 0, i32 %8, i32 %10)
%12 = load i8*, i8** %1
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 28
%16 = load i32, i32* %2
%17 = sub nsw i32 %16, 1
%18 = load i32, i32* %3
%19 = sub nsw i32 %18, 28
%20 = call i32 @boxfill8(i8* %12, i32 %13, i32 8, i32 0, i32 %15, i32 %17, i32 %19)
%21 = load i8*, i8** %1
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = sub nsw i32 %23, 27
%25 = load i32, i32* %2
%26 = sub nsw i32 %25, 1
%27 = load i32, i32* %3
%28 = sub nsw i32 %27, 27
%29 = call i32 @boxfill8(i8* %21, i32 %22, i32 7, i32 0, i32 %24, i32 %26, i32 %28)
%30 = load i8*, i8** %1
%31 = load i32, i32* %2
%32 = load i32, i32* %3
%33 = sub nsw i32 %32, 26
%34 = load i32, i32* %2
%35 = sub nsw i32 %34, 1
%36 = load i32, i32* %3
%37 = sub nsw i32 %36, 1
%38 = call i32 @boxfill8(i8* %30, i32 %31, i32 8, i32 0, i32 %33, i32 %35, i32 %37)
%39 = load i8*, i8** %1
%40 = load i32, i32* %2
%41 = load i32, i32* %3
%42 = sub nsw i32 %41, 24
%43 = load i32, i32* %3
%44 = sub nsw i32 %43, 24
%45 = call i32 @boxfill8(i8* %39, i32 %40, i32 7, i32 3, i32 %42, i32 59, i32 %44)
%46 = load i8*, i8** %1
%47 = load i32, i32* %2
%48 = load i32, i32* %3
%49 = sub nsw i32 %48, 24
%50 = load i32, i32* %3
%51 = sub nsw i32 %50, 4
%52 = call i32 @boxfill8(i8* %46, i32 %47, i32 7, i32 2, i32 %49, i32 2, i32 %51)
%53 = load i8*, i8** %1
%54 = load i32, i32* %2
%55 = load i32, i32* %3
%56 = sub nsw i32 %55, 4
%57 = load i32, i32* %3
%58 = sub nsw i32 %57, 4
%59 = call i32 @boxfill8(i8* %53, i32 %54, i32 15, i32 3, i32 %56, i32 59, i32 %58)
%60 = load i8*, i8** %1
%61 = load i32, i32* %2
%62 = load i32, i32* %3
%63 = sub nsw i32 %62, 23
%64 = load i32, i32* %3
%65 = sub nsw i32 %64, 5
%66 = call i32 @boxfill8(i8* %60, i32 %61, i32 15, i32 59, i32 %63, i32 59, i32 %65)
%67 = load i8*, i8** %1
%68 = load i32, i32* %2
%69 = load i32, i32* %3
%70 = sub nsw i32 %69, 3
%71 = load i32, i32* %3
%72 = sub nsw i32 %71, 3
%73 = call i32 @boxfill8(i8* %67, i32 %68, i32 0, i32 2, i32 %70, i32 59, i32 %72)
%74 = load i8*, i8** %1
%75 = load i32, i32* %2
%76 = load i32, i32* %3
%77 = sub nsw i32 %76, 24
%78 = load i32, i32* %3
%79 = sub nsw i32 %78, 3
%80 = call i32 @boxfill8(i8* %74, i32 %75, i32 0, i32 60, i32 %77, i32 60, i32 %79)
%81 = load i8*, i8** %1
%82 = load i32, i32* %2
%83 = load i32, i32* %2
%84 = sub nsw i32 %83, 47
%85 = load i32, i32* %3
%86 = sub nsw i32 %85, 24
%87 = load i32, i32* %2
%88 = sub nsw i32 %87, 4
%89 = load i32, i32* %3
%90 = sub nsw i32 %89, 24
%91 = call i32 @boxfill8(i8* %81, i32 %82, i32 15, i32 %84, i32 %86, i32 %88, i32 %90)
%92 = load i8*, i8** %1
%93 = load i32, i32* %2
%94 = load i32, i32* %2
%95 = sub nsw i32 %94, 47
%96 = load i32, i32* %3
%97 = sub nsw i32 %96, 23
%98 = load i32, i32* %2
%99 = sub nsw i32 %98, 47
%100 = load i32, i32* %3
%101 = sub nsw i32 %100, 4
%102 = call i32 @boxfill8(i8* %92, i32 %93, i32 15, i32 %95, i32 %97, i32 %99, i32 %101)
%103 = load i8*, i8** %1
%104 = load i32, i32* %2
%105 = load i32, i32* %2
%106 = sub nsw i32 %105, 47
%107 = load i32, i32* %3
%108 = sub nsw i32 %107, 3
%109 = load i32, i32* %2
%110 = sub nsw i32 %109, 4
%111 = load i32, i32* %3
%112 = sub nsw i32 %111, 3
%113 = call i32 @boxfill8(i8* %103, i32 %104, i32 7, i32 %106, i32 %108, i32 %110, i32 %112)
%114 = load i8*, i8** %1
%115 = load i32, i32* %2
%116 = load i32, i32* %2
%117 = sub nsw i32 %116, 3
%118 = load i32, i32* %3
%119 = sub nsw i32 %118, 24
%120 = load i32, i32* %2
%121 = sub nsw i32 %120, 3
%122 = load i32, i32* %3
%123 = sub nsw i32 %122, 3
%124 = call i32 @boxfill8(i8* %114, i32 %115, i32 7, i32 %117, i32 %119, i32 %121, i32 %123)
br label %125
125: ; preds = %125, %0
%126 = call i32 (...) @io_hlt()
br label %125
}

LLVM IR (-O2):
define void @HariMain() {
%1 = tail call i32 (...) @init_palette()
%2 = tail call i32 @boxfill8(i8* inttoptr (i64 655360 to i8*), i32 320, i32 14, i32 0, i32 0, i32 319, i32 171)
%3 = tail call i32 @boxfill8(i8* inttoptr (i64 655360 to i8*), i32 320, i32 8, i32 0, i32 172, i32 319, i32 172)
%4 = tail call i32 @boxfill8(i8* inttoptr (i64 655360 to i8*), i32 320, i32 7, i32 0, i32 173, i32 319, i32 173)
%5 = tail call i32 @boxfill8(i8* inttoptr (i64 655360 to i8*), i32 320, i32 8, i32 0, i32 174, i32 319, i32 199)
%6 = tail call i32 @boxfill8(i8* inttoptr (i64 655360 to i8*), i32 320, i32 7, i32 3, i32 176, i32 59, i32 176)
%7 = tail call i32 @boxfill8(i8* inttoptr (i64 655360 to i8*), i32 320, i32 7, i32 2, i32 176, i32 2, i32 196)
%8 = tail call i32 @boxfill8(i8* inttoptr (i64 655360 to i8*), i32 320, i32 15, i32 3, i32 196, i32 59, i32 196)
%9 = tail call i32 @boxfill8(i8* inttoptr (i64 655360 to i8*), i32 320, i32 15, i32 59, i32 177, i32 59, i32 195)
%10 = tail call i32 @boxfill8(i8* inttoptr (i64 655360 to i8*), i32 320, i32 0, i32 2, i32 197, i32 59, i32 197)
%11 = tail call i32 @boxfill8(i8* inttoptr (i64 655360 to i8*), i32 320, i32 0, i32 60, i32 176, i32 60, i32 197)
%12 = tail call i32 @boxfill8(i8* inttoptr (i64 655360 to i8*), i32 320, i32 15, i32 273, i32 176, i32 316, i32 176)
%13 = tail call i32 @boxfill8(i8* inttoptr (i64 655360 to i8*), i32 320, i32 15, i32 273, i32 177, i32 273, i32 196)
%14 = tail call i32 @boxfill8(i8* inttoptr (i64 655360 to i8*), i32 320, i32 7, i32 273, i32 197, i32 316, i32 197)
%15 = tail call i32 @boxfill8(i8* inttoptr (i64 655360 to i8*), i32 320, i32 7, i32 317, i32 176, i32 317, i32 197)
br label %16
16: ; preds = %16, %0
%17 = tail call i32 (...) @io_hlt()
br label %16
}