void InitKeys(void) {
  unsigned char y;
  (*((volatile unsigned long *)0xE0028008)) |= 1 << 22;
  (*((volatile unsigned long *)0xE0028008)) &= ~1 << 21;
  (*((volatile unsigned long *)0xE0028018)) &= ~1 << 25;
  (*((volatile unsigned long *)0xE002800C)) = 1 << 22;
  while (!((*((volatile unsigned long *)0xE0028010)) & 1 << 25)) {
    (*((volatile unsigned long *)0xE0028004)) = 1 << 22;
    y = 200;
    while (y--)
      ;
    (*((volatile unsigned long *)0xE002800C)) = 1 << 22;
    y = 200;
    while (y--)
      ;
  }
}


x86 assembly (clang, -O0):
<InitKeys>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0028008,%eax
mov    (%rax),%rcx
or     $0x400000,%rcx
mov    $0xe0028008,%eax
mov    %rcx,(%rax)
mov    $0xe0028008,%eax
mov    (%rax),%rcx
and    $0xffffffffffc00000,%rcx
mov    $0xe0028008,%eax
mov    %rcx,(%rax)
mov    $0xe0028018,%eax
mov    (%rax),%rcx
and    $0xfffffffffc000000,%rcx
mov    $0xe0028018,%eax
mov    %rcx,(%rax)
mov    $0xe002800c,%eax
movq   $0x400000,(%rax)
mov    $0xe0028010,%eax
mov    (%rax),%rax
and    $0x2000000,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1179 <InitKeys+0x79>
jmp    11ce <InitKeys+0xce>
mov    $0xe0028004,%eax
movq   $0x400000,(%rax)
movb   $0xc8,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,%cl
add    $0xff,%cl
mov    %cl,-0x1(%rbp)
cmp    $0x0,%al
je     11a1 <InitKeys+0xa1>
jmp    1189 <InitKeys+0x89>
mov    $0xe002800c,%eax
movq   $0x400000,(%rax)
movb   $0xc8,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,%cl
add    $0xff,%cl
mov    %cl,-0x1(%rbp)
cmp    $0x0,%al
je     11c9 <InitKeys+0xc9>
jmp    11b1 <InitKeys+0xb1>
jmp    1155 <InitKeys+0x55>
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitKeys>:
mov    $0xe0028008,%eax
orq    $0x400000,(%rax)
andq   $0xffffffffffc00000,(%rax)
andq   $0xfffffffffc000000,0x10(%rax)
fc
nopl   0x0(%rax,%rax,1)
movq   $0x400000,0x4(%rax)
testq  $0x2000000,0x8(%rax)
02
jne    113c <InitKeys+0x3c>
movq   $0x400000,-0x4(%rax)
jmp    1120 <InitKeys+0x20>
ret

LLVM IR (-O0):
define void @InitKeys() {
%1 = alloca i8
%2 = load volatile i64, i64* inttoptr (i64 3758260232 to i64*)
%3 = or i64 %2, 4194304
store volatile i64 %3, i64* inttoptr (i64 3758260232 to i64*)
%4 = load volatile i64, i64* inttoptr (i64 3758260232 to i64*)
%5 = and i64 %4, -4194304
store volatile i64 %5, i64* inttoptr (i64 3758260232 to i64*)
%6 = load volatile i64, i64* inttoptr (i64 3758260248 to i64*)
%7 = and i64 %6, -67108864
store volatile i64 %7, i64* inttoptr (i64 3758260248 to i64*)
store volatile i64 4194304, i64* inttoptr (i64 3758260236 to i64*)
br label %8
8: ; preds = %25, %0
%9 = load volatile i64, i64* inttoptr (i64 3758260240 to i64*)
%10 = and i64 %9, 33554432
%11 = icmp ne i64 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %26
13: ; preds = %8
store volatile i64 4194304, i64* inttoptr (i64 3758260228 to i64*)
store i8 -56, i8* %1
br label %14
14: ; preds = %18, %13
%15 = load i8, i8* %1
%16 = add i8 %15, -1
store i8 %16, i8* %1
%17 = icmp ne i8 %15, 0
br i1 %17, label %18, label %19
18: ; preds = %14
br label %14
19: ; preds = %14
store volatile i64 4194304, i64* inttoptr (i64 3758260236 to i64*)
store i8 -56, i8* %1
br label %20
20: ; preds = %24, %19
%21 = load i8, i8* %1
%22 = add i8 %21, -1
store i8 %22, i8* %1
%23 = icmp ne i8 %21, 0
br i1 %23, label %24, label %25
24: ; preds = %20
br label %20
25: ; preds = %20
br label %8
26: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @InitKeys() {
%1 = load volatile i64, i64* inttoptr (i64 3758260232 to i64*)
%2 = or i64 %1, 4194304
store volatile i64 %2, i64* inttoptr (i64 3758260232 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 3758260232 to i64*)
%4 = and i64 %3, -4194304
store volatile i64 %4, i64* inttoptr (i64 3758260232 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 3758260248 to i64*)
%6 = and i64 %5, -67108864
store volatile i64 %6, i64* inttoptr (i64 3758260248 to i64*)
store volatile i64 4194304, i64* inttoptr (i64 3758260236 to i64*)
%7 = load volatile i64, i64* inttoptr (i64 3758260240 to i64*)
%8 = and i64 %7, 33554432
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %0, %10
store volatile i64 4194304, i64* inttoptr (i64 3758260228 to i64*)
store volatile i64 4194304, i64* inttoptr (i64 3758260236 to i64*)
%11 = load volatile i64, i64* inttoptr (i64 3758260240 to i64*)
%12 = and i64 %11, 33554432
%13 = icmp eq i64 %12, 0
br i1 %13, label %10, label %14
14: ; preds = %10, %0
ret void
}