#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 */
char *ML_vram_adress();
void ML_display_vram() {
  char *LCD_register_selector = (char *)0xB4000000,
       *LCD_data_register = (char *)0xB4010000, *vram;
  int i, j;
  vram = ML_vram_adress();
  for (i = 0; i < 64; i++) {
    *LCD_register_selector = 4;
    *LCD_data_register = i | 192;
    *LCD_register_selector = 4;
    *LCD_data_register = 0;
    *LCD_register_selector = 7;
    for (j = 0; j < 16; j++)
      *LCD_data_register = *vram++;
  }
}


x86 assembly (clang, -O0):
<ML_display_vram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0xb4000000,%eax
mov    %rax,-0x8(%rbp)
mov    $0xb4010000,%eax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <ML_vram_adress@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x40,-0x1c(%rbp)
jge    11bb <ML_display_vram+0xab>
mov    -0x8(%rbp),%rax
movb   $0x4,(%rax)
mov    -0x1c(%rbp),%eax
or     $0xc0,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x4,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x7,(%rax)
movl   $0x0,-0x20(%rbp)
cmpl   $0x10,-0x20(%rbp)
jge    11a8 <ML_display_vram+0x98>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1179 <ML_display_vram+0x69>
jmp    11ad <ML_display_vram+0x9d>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113c <ML_display_vram+0x2c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ML_display_vram>:
push   %r14
push   %rbx
push   %rax
mov    $0xb4010000,%r14d
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <ML_vram_adress@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movb   $0x0,(%r14)
movb   $0x7,-0x10000(%r14)
07
movzbl (%rax,%rbx,1),%ecx
mov    %cl,(%r14)
movzbl 0x1(%rax,%rbx,1),%ecx
mov    %cl,(%r14)
movzbl 0x2(%rax,%rbx,1),%ecx
mov    %cl,(%r14)
movzbl 0x3(%rax,%rbx,1),%ecx
mov    %cl,(%r14)
movzbl 0x4(%rax,%rbx,1),%ecx
mov    %cl,(%r14)
movzbl 0x5(%rax,%rbx,1),%ecx
mov    %cl,(%r14)
movzbl 0x6(%rax,%rbx,1),%ecx
mov    %cl,(%r14)
movzbl 0x7(%rax,%rbx,1),%ecx
mov    %cl,(%r14)
movzbl 0x8(%rax,%rbx,1),%ecx
mov    %cl,(%r14)
movzbl 0x9(%rax,%rbx,1),%ecx
mov    %cl,(%r14)
movzbl 0xa(%rax,%rbx,1),%ecx
mov    %cl,(%r14)
movzbl 0xb(%rax,%rbx,1),%ecx
mov    %cl,(%r14)
movzbl 0xc(%rax,%rbx,1),%ecx
mov    %cl,(%r14)
movzbl 0xd(%rax,%rbx,1),%ecx
mov    %cl,(%r14)
movzbl 0xe(%rax,%rbx,1),%ecx
mov    %cl,(%r14)
movzbl 0xf(%rax,%rbx,1),%ecx
mov    %cl,(%r14)
add    $0x10,%rbx
cmp    $0x400,%ebx
jne    1130 <ML_display_vram+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ML_display_vram() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* inttoptr (i64 3019898880 to i8*), i8** %1
store i8* inttoptr (i64 3019964416 to i8*), i8** %2
%6 = call i8* (...) @ML_vram_adress()
store i8* %6, i8** %3
store i32 0, i32* %4
br label %7
7: ; preds = %31, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 64
br i1 %9, label %10, label %34
10: ; preds = %7
%11 = load i8*, i8** %1
store i8 4, i8* %11
%12 = load i32, i32* %4
%13 = or i32 %12, 192
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %2
store i8 %14, i8* %15
%16 = load i8*, i8** %1
store i8 4, i8* %16
%17 = load i8*, i8** %2
store i8 0, i8* %17
%18 = load i8*, i8** %1
store i8 7, i8* %18
store i32 0, i32* %5
br label %19
19: ; preds = %27, %10
%20 = load i32, i32* %5
%21 = icmp slt i32 %20, 16
br i1 %21, label %22, label %30
22: ; preds = %19
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %3
%25 = load i8, i8* %23
%26 = load i8*, i8** %2
store i8 %25, i8* %26
br label %27
27: ; preds = %22
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %19
30: ; preds = %19
br label %31
31: ; preds = %30
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %7
34: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @ML_display_vram() {
%1 = tail call i8* (...) @ML_vram_adress()
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %37, %2 ]
%4 = phi i8* [ %1, %0 ], [ %35, %2 ]
store i8 0, i8* inttoptr (i64 3019964416 to i8*)
store i8 7, i8* inttoptr (i64 3019898880 to i8*)
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
store i8 %6, i8* inttoptr (i64 3019964416 to i8*)
%7 = getelementptr inbounds i8, i8* %4, i64 2
%8 = load i8, i8* %5
store i8 %8, i8* inttoptr (i64 3019964416 to i8*)
%9 = getelementptr inbounds i8, i8* %4, i64 3
%10 = load i8, i8* %7
store i8 %10, i8* inttoptr (i64 3019964416 to i8*)
%11 = getelementptr inbounds i8, i8* %4, i64 4
%12 = load i8, i8* %9
store i8 %12, i8* inttoptr (i64 3019964416 to i8*)
%13 = getelementptr inbounds i8, i8* %4, i64 5
%14 = load i8, i8* %11
store i8 %14, i8* inttoptr (i64 3019964416 to i8*)
%15 = getelementptr inbounds i8, i8* %4, i64 6
%16 = load i8, i8* %13
store i8 %16, i8* inttoptr (i64 3019964416 to i8*)
%17 = getelementptr inbounds i8, i8* %4, i64 7
%18 = load i8, i8* %15
store i8 %18, i8* inttoptr (i64 3019964416 to i8*)
%19 = getelementptr inbounds i8, i8* %4, i64 8
%20 = load i8, i8* %17
store i8 %20, i8* inttoptr (i64 3019964416 to i8*)
%21 = getelementptr inbounds i8, i8* %4, i64 9
%22 = load i8, i8* %19
store i8 %22, i8* inttoptr (i64 3019964416 to i8*)
%23 = getelementptr inbounds i8, i8* %4, i64 10
%24 = load i8, i8* %21
store i8 %24, i8* inttoptr (i64 3019964416 to i8*)
%25 = getelementptr inbounds i8, i8* %4, i64 11
%26 = load i8, i8* %23
store i8 %26, i8* inttoptr (i64 3019964416 to i8*)
%27 = getelementptr inbounds i8, i8* %4, i64 12
%28 = load i8, i8* %25
store i8 %28, i8* inttoptr (i64 3019964416 to i8*)
%29 = getelementptr inbounds i8, i8* %4, i64 13
%30 = load i8, i8* %27
store i8 %30, i8* inttoptr (i64 3019964416 to i8*)
%31 = getelementptr inbounds i8, i8* %4, i64 14
%32 = load i8, i8* %29
store i8 %32, i8* inttoptr (i64 3019964416 to i8*)
%33 = getelementptr inbounds i8, i8* %4, i64 15
%34 = load i8, i8* %31
store i8 %34, i8* inttoptr (i64 3019964416 to i8*)
%35 = getelementptr inbounds i8, i8* %4, i64 16
%36 = load i8, i8* %33
store i8 %36, i8* inttoptr (i64 3019964416 to i8*)
%37 = add nuw nsw i32 %3, 1
%38 = icmp eq i32 %37, 64
br i1 %38, label %39, label %2
39: ; preds = %2
ret void
}