#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*/ pal_col(int, int);
int /*<<< orphan*/ ppu_on_all();
int /*<<< orphan*/ put_str(int, char *);
void main(void) {
  pal_col(1, 0x03);
  put_str(((0x2000 | ((2) << 5) | 0)), "HELLO, KEN BREWER!");
  put_str(((0x2000 | ((3) << 5) | 2)), "I BET YOU DIDN'T EXPECT THIS.");
  put_str(((0x2000 | ((5) << 5) | 2)), "BUT HERE IT IS!");
  put_str(((0x2000 | ((6) << 5) | 2)), "    HELLO NES!");
  ppu_on_all();
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x3,%esi
call   1040 <pal_col@plt>
mov    $0x2040,%edi
lea    0xeb1(%rip),%rsi
call   1050 <put_str@plt>
mov    $0x2062,%edi
lea    0xeb3(%rip),%rsi
call   1050 <put_str@plt>
mov    $0x20a2,%edi
lea    0xec0(%rip),%rsi
call   1050 <put_str@plt>
mov    $0x20c2,%edi
lea    0xebf(%rip),%rsi
call   1050 <put_str@plt>
mov    $0x0,%al
call   1030 <ppu_on_all@plt>
jmp    118e <main+0x5e>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x3,%esi
call   1040 <pal_col@plt>
lea    0xeb9(%rip),%rsi
mov    $0x2040,%edi
call   1050 <put_str@plt>
lea    0xebb(%rip),%rsi
mov    $0x2062,%edi
call   1050 <put_str@plt>
lea    0xec8(%rip),%rsi
mov    $0x20a2,%edi
call   1050 <put_str@plt>
lea    0xec7(%rip),%rsi
mov    $0x20c2,%edi
call   1050 <put_str@plt>
xor    %eax,%eax
call   1030 <ppu_on_all@plt>
nopl   0x0(%rax,%rax,1)
jmp    1190 <main+0x60>

LLVM IR (-O0):
@.str = [19 x i8] c"HELLO, KEN BREWER!\00"
@.str.1 = [30 x i8] c"I BET YOU DIDN'T EXPECT THIS.\00"
@.str.2 = [16 x i8] c"BUT HERE IT IS!\00"
@.str.3 = [15 x i8] c" HELLO NES!\00"
define void @main() {
%1 = call i32 @pal_col(i32 1, i32 3)
%2 = call i32 @put_str(i32 8256, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @put_str(i32 8290, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @put_str(i32 8354, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @put_str(i32 8386, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 (...) @ppu_on_all()
br label %7
7: ; preds = %0, %7
br label %7
}

LLVM IR (-O2):
@.str = [19 x i8] c"HELLO, KEN BREWER!\00"
@.str.1 = [30 x i8] c"I BET YOU DIDN'T EXPECT THIS.\00"
@.str.2 = [16 x i8] c"BUT HERE IT IS!\00"
@.str.3 = [15 x i8] c" HELLO NES!\00"
define void @main() {
%1 = tail call i32 @pal_col(i32 1, i32 3)
%2 = tail call i32 @put_str(i32 8256, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @put_str(i32 8290, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @put_str(i32 8354, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @put_str(i32 8386, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 (...) @ppu_on_all()
br label %7
7: ; preds = %0, %7
br label %7
}