void ML_clear_screen() {
  char *LCD_register_selector = (char *)0xB4000000,
       *LCD_data_register = (char *)0xB4010000;
  int i, j;
  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 = 0;
  }
}


x86 assembly (clang, -O0):
<ML_clear_screen>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb4000000,%eax
mov    %rax,-0x8(%rbp)
mov    $0xb4010000,%eax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jge    118c <ML_clear_screen+0x8c>
mov    -0x8(%rbp),%rax
movb   $0x4,(%rax)
mov    -0x14(%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,-0x18(%rbp)
cmpl   $0x10,-0x18(%rbp)
jge    1179 <ML_clear_screen+0x79>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115a <ML_clear_screen+0x5a>
jmp    117e <ML_clear_screen+0x7e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111d <ML_clear_screen+0x1d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ML_clear_screen>:
mov    $0x40,%eax
mov    $0xb4000000,%ecx
nopw   0x0(%rax,%rax,1)
movb   $0x7,(%rcx)
movb   $0x0,0x10000(%rcx)
add    $0xfffffff8,%eax
jne    1110 <ML_clear_screen+0x10>
ret

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

LLVM IR (-O2):
define void @ML_clear_screen() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
store i8 7, i8* inttoptr (i64 3019898880 to i8*)
store i8 0, i8* inttoptr (i64 3019964416 to i8*)
store i8 7, i8* inttoptr (i64 3019898880 to i8*)
store i8 0, i8* inttoptr (i64 3019964416 to i8*)
store i8 7, i8* inttoptr (i64 3019898880 to i8*)
store i8 0, i8* inttoptr (i64 3019964416 to i8*)
store i8 7, i8* inttoptr (i64 3019898880 to i8*)
store i8 0, i8* inttoptr (i64 3019964416 to i8*)
store i8 7, i8* inttoptr (i64 3019898880 to i8*)
store i8 0, i8* inttoptr (i64 3019964416 to i8*)
store i8 7, i8* inttoptr (i64 3019898880 to i8*)
store i8 0, i8* inttoptr (i64 3019964416 to i8*)
store i8 7, i8* inttoptr (i64 3019898880 to i8*)
store i8 0, i8* inttoptr (i64 3019964416 to i8*)
store i8 7, i8* inttoptr (i64 3019898880 to i8*)
store i8 0, i8* inttoptr (i64 3019964416 to i8*)
%3 = add nuw nsw i32 %2, 8
%4 = icmp eq i32 %3, 64
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}