#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, 0x30);
  put_str(((0x2000 | ((2) << 5) | 2)), "HELLO, WORLD!");
  put_str(((0x2000 | ((4) << 5) | 2)), "THIS CODE PRINTS SOME TEXT");
  put_str(((0x2000 | ((5) << 5) | 2)), "USING ASCII-ENCODED CHARACTER");
  put_str(((0x2000 | ((6) << 5) | 2)), "SET WITH CAPITAL LETTERS ONLY");
  put_str(((0x2000 | ((8) << 5) | 2)), "TO USE CHR MORE EFFICIENTLY");
  put_str(((0x2000 | ((9) << 5) | 2)), "YOU'D NEED A CUSTOM ENCODING");
  put_str(((0x2000 | ((10) << 5) | 2)), "AND A CONVERSION TABLE");
  ppu_on_all();
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x30,%esi
call   1040 <pal_col@plt>
mov    $0x2042,%edi
lea    0xeb1(%rip),%rsi
call   1050 <put_str@plt>
mov    $0x2082,%edi
lea    0xeae(%rip),%rsi
call   1050 <put_str@plt>
mov    $0x20a2,%edi
lea    0xeb8(%rip),%rsi
call   1050 <put_str@plt>
mov    $0x20c2,%edi
lea    0xec5(%rip),%rsi
call   1050 <put_str@plt>
mov    $0x2102,%edi
lea    0xed2(%rip),%rsi
call   1050 <put_str@plt>
mov    $0x2122,%edi
lea    0xedd(%rip),%rsi
call   1050 <put_str@plt>
mov    $0x2142,%edi
lea    0xee9(%rip),%rsi
call   1050 <put_str@plt>
mov    $0x0,%al
call   1030 <ppu_on_all@plt>
jmp    11c1 <main+0x91>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x30,%esi
call   1040 <pal_col@plt>
lea    0xeb9(%rip),%rsi
mov    $0x2042,%edi
call   1050 <put_str@plt>
lea    0xeb6(%rip),%rsi
mov    $0x2082,%edi
call   1050 <put_str@plt>
lea    0xec0(%rip),%rsi
mov    $0x20a2,%edi
call   1050 <put_str@plt>
lea    0xecd(%rip),%rsi
mov    $0x20c2,%edi
call   1050 <put_str@plt>
lea    0xeda(%rip),%rsi
mov    $0x2102,%edi
call   1050 <put_str@plt>
lea    0xee5(%rip),%rsi
mov    $0x2122,%edi
call   1050 <put_str@plt>
lea    0xef1(%rip),%rsi
mov    $0x2142,%edi
call   1050 <put_str@plt>
xor    %eax,%eax
call   1030 <ppu_on_all@plt>
xchg   %ax,%ax
jmp    11c0 <main+0x90>

LLVM IR (-O0):
@.str = [14 x i8] c"HELLO, WORLD!\00"
@.str.1 = [27 x i8] c"THIS CODE PRINTS SOME TEXT\00"
@.str.2 = [30 x i8] c"USING ASCII-ENCODED CHARACTER\00"
@.str.3 = [30 x i8] c"SET WITH CAPITAL LETTERS ONLY\00"
@.str.4 = [28 x i8] c"TO USE CHR MORE EFFICIENTLY\00"
@.str.5 = [29 x i8] c"YOU'D NEED A CUSTOM ENCODING\00"
@.str.6 = [23 x i8] c"AND A CONVERSION TABLE\00"
define void @main() {
%1 = call i32 @pal_col(i32 1, i32 48)
%2 = call i32 @put_str(i32 8258, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @put_str(i32 8322, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @put_str(i32 8354, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @put_str(i32 8386, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @put_str(i32 8450, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @put_str(i32 8482, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 @put_str(i32 8514, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 (...) @ppu_on_all()
br label %10
10: ; preds = %0, %10
br label %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"HELLO, WORLD!\00"
@.str.1 = [27 x i8] c"THIS CODE PRINTS SOME TEXT\00"
@.str.2 = [30 x i8] c"USING ASCII-ENCODED CHARACTER\00"
@.str.3 = [30 x i8] c"SET WITH CAPITAL LETTERS ONLY\00"
@.str.4 = [28 x i8] c"TO USE CHR MORE EFFICIENTLY\00"
@.str.5 = [29 x i8] c"YOU'D NEED A CUSTOM ENCODING\00"
@.str.6 = [23 x i8] c"AND A CONVERSION TABLE\00"
define void @main() {
%1 = tail call i32 @pal_col(i32 1, i32 48)
%2 = tail call i32 @put_str(i32 8258, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @put_str(i32 8322, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @put_str(i32 8354, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @put_str(i32 8386, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @put_str(i32 8450, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 @put_str(i32 8482, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
%8 = tail call i32 @put_str(i32 8514, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
%9 = tail call i32 (...) @ppu_on_all()
br label %10
10: ; preds = %0, %10
br label %10
}