void rt_low_level_init(void) {
  volatile unsigned int *addr;
  volatile unsigned int time;
  int i;
  addr = (unsigned int *)(0x01c20000 + 0x050);
  *addr = 0x10000;
  addr = (unsigned int *)(0x01c20000 + 0x000);
  *addr = 0x80001000;
  time = 0xffff;
  while ((!(*addr & (0x1 << 28))) && (time--))
    ;
  if (time > 0) {
    addr = (unsigned int *)(0x01c20000 + 0x050);
    *addr = 0x20000;
  }
  addr = (unsigned int *)(0x01c20000 + 0x028);
  if (*addr & (0x1 << 31))
    return;
  addr = (unsigned int *)(0x01c20000 + 0x200);
  *addr = 0x1ff;
  addr = (unsigned int *)(0x01c20000 + 0x204);
  *addr = 0x1ff;
  addr = (unsigned int *)(0x01c20000 + 0x028);
  *addr |= (0x1 << 31);
  while (!(*addr & (0x1 << 28)))
    ;
  addr = (unsigned int *)(0x01c20000 + 0x054);
  *addr = (0x0 << 16) | (0x3 << 12) | (0x0 << 8) | (0x2 << 6) | (0x0 << 4);
  for (i = 0; i < 6; i++) {
    if (i == 1)
      continue;
    addr = (unsigned int *)(0x01c20800 + i * 0x24 + 0x00);
    *addr = 0x77777777;
    addr = (unsigned int *)(0x01c20800 + i * 0x24 + 0x04);
    *addr = 0x77777777;
    addr = (unsigned int *)(0x01c20800 + i * 0x24 + 0x08);
    *addr = 0x77777777;
    addr = (unsigned int *)(0x01c20800 + i * 0x24 + 0x0C);
    *addr = 0x77777777;
  }
}


x86 assembly (clang, -O0):
<rt_low_level_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c20050,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x10000,(%rax)
mov    $0x1c20000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x80001000,(%rax)
movl   $0xffff,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0x10000000,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
jne    115f <rt_low_level_init+0x5f>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    116f <rt_low_level_init+0x6f>
jmp    1174 <rt_low_level_init+0x74>
jmp    1131 <rt_low_level_init+0x31>
mov    -0xc(%rbp),%eax
cmp    $0x0,%eax
jbe    1193 <rt_low_level_init+0x93>
mov    $0x1c20050,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x20000,(%rax)
mov    $0x1c20028,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
je     11b5 <rt_low_level_init+0xb5>
jmp    12c8 <rt_low_level_init+0x1c8>
mov    $0x1c20200,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1ff,(%rax)
mov    $0x1c20204,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1ff,(%rax)
mov    $0x1c20028,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
or     $0x80000000,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x10000000,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1212 <rt_low_level_init+0x112>
jmp    1217 <rt_low_level_init+0x117>
jmp    11f2 <rt_low_level_init+0xf2>
mov    $0x1c20054,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x3080,(%rax)
movl   $0x0,-0x10(%rbp)
cmpl   $0x6,-0x10(%rbp)
jge    12c8 <rt_low_level_init+0x1c8>
cmpl   $0x1,-0x10(%rbp)
jne    124a <rt_low_level_init+0x14a>
jmp    12ba <rt_low_level_init+0x1ba>
imul   $0x24,-0x10(%rbp),%eax
add    $0x1c20800,%eax
add    $0x0,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x77777777,(%rax)
imul   $0x24,-0x10(%rbp),%eax
add    $0x1c20800,%eax
add    $0x4,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x77777777,(%rax)
imul   $0x24,-0x10(%rbp),%eax
add    $0x1c20800,%eax
add    $0x8,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x77777777,(%rax)
imul   $0x24,-0x10(%rbp),%eax
add    $0x1c20800,%eax
add    $0xc,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x77777777,(%rax)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1231 <rt_low_level_init+0x131>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_low_level_init>:
movl   $0x10000,0x1c20050
movl   $0x80001000,0x1c20000
movl   $0xffff,-0x4(%rsp)
xchg   %ax,%ax
testl  $0x10000000,0x1c20000
jne    1134 <rt_low_level_init+0x34>
subl   $0x1,-0x4(%rsp)
jae    1120 <rt_low_level_init+0x20>
cmpl   $0x0,-0x4(%rsp)
je     1146 <rt_low_level_init+0x46>
movl   $0x20000,0x1c20050
cmpl   $0x0,0x1c20028
js     1274 <rt_low_level_init+0x174>
movl   $0x1ff,0x1c20200
movl   $0x1ff,0x1c20204
orl    $0x80000000,0x1c20028
cs nopw 0x0(%rax,%rax,1)
nop
testl  $0x10000000,0x1c20028
je     1180 <rt_low_level_init+0x80>
movl   $0x3080,0x1c20054
movl   $0x77777777,0x1c20800
77 77 77 77
movl   $0x77777777,0x1c20804
77 77 77 77
movl   $0x77777777,0x1c20808
77 77 77 77
movl   $0x77777777,0x1c2080c
77 77 77 77
movl   $0x77777777,0x1c20848
77 77 77 77
movl   $0x77777777,0x1c2084c
77 77 77 77
movl   $0x77777777,0x1c20850
77 77 77 77
movl   $0x77777777,0x1c20854
77 77 77 77
movl   $0x77777777,0x1c2086c
77 77 77 77
movl   $0x77777777,0x1c20870
77 77 77 77
movl   $0x77777777,0x1c20874
77 77 77 77
movl   $0x77777777,0x1c20878
77 77 77 77
movl   $0x77777777,0x1c20890
77 77 77 77
movl   $0x77777777,0x1c20894
77 77 77 77
movl   $0x77777777,0x1c20898
77 77 77 77
movl   $0x77777777,0x1c2089c
77 77 77 77
movl   $0x77777777,0x1c208b4
77 77 77 77
movl   $0x77777777,0x1c208b8
77 77 77 77
movl   $0x77777777,0x1c208bc
77 77 77 77
movl   $0x77777777,0x1c208c0
77 77 77 77
ret

LLVM IR (-O0):
define void @rt_low_level_init() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i32
store i32* inttoptr (i64 29491280 to i32*), i32** %1
%4 = load i32*, i32** %1
store volatile i32 65536, i32* %4
store i32* inttoptr (i64 29491200 to i32*), i32** %1
%5 = load i32*, i32** %1
store volatile i32 -2147479552, i32* %5
store volatile i32 65535, i32* %2
br label %6
6: ; preds = %17, %0
%7 = load i32*, i32** %1
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 268435456
%10 = icmp ne i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = load volatile i32, i32* %2
%13 = add i32 %12, -1
store volatile i32 %13, i32* %2
%14 = icmp ne i32 %12, 0
br label %15
15: ; preds = %11, %6
%16 = phi i1 [ false, %6 ], [ %14, %11 ]
br i1 %16, label %17, label %18
17: ; preds = %15
br label %6
18: ; preds = %15
%19 = load volatile i32, i32* %2
%20 = icmp ugt i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %18
store i32* inttoptr (i64 29491280 to i32*), i32** %1
%22 = load i32*, i32** %1
store volatile i32 131072, i32* %22
br label %23
23: ; preds = %21, %18
store i32* inttoptr (i64 29491240 to i32*), i32** %1
%24 = load i32*, i32** %1
%25 = load volatile i32, i32* %24
%26 = and i32 %25, -2147483648
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %23
br label %83
29: ; preds = %23
store i32* inttoptr (i64 29491712 to i32*), i32** %1
%30 = load i32*, i32** %1
store volatile i32 511, i32* %30
store i32* inttoptr (i64 29491716 to i32*), i32** %1
%31 = load i32*, i32** %1
store volatile i32 511, i32* %31
store i32* inttoptr (i64 29491240 to i32*), i32** %1
%32 = load i32*, i32** %1
%33 = load volatile i32, i32* %32
%34 = or i32 %33, -2147483648
store volatile i32 %34, i32* %32
br label %35
35: ; preds = %41, %29
%36 = load i32*, i32** %1
%37 = load volatile i32, i32* %36
%38 = and i32 %37, 268435456
%39 = icmp ne i32 %38, 0
%40 = xor i1 %39, true
br i1 %40, label %41, label %42
41: ; preds = %35
br label %35
42: ; preds = %35
store i32* inttoptr (i64 29491284 to i32*), i32** %1
%43 = load i32*, i32** %1
store volatile i32 12416, i32* %43
store i32 0, i32* %3
br label %44
44: ; preds = %80, %42
%45 = load i32, i32* %3
%46 = icmp slt i32 %45, 6
br i1 %46, label %47, label %83
47: ; preds = %44
%48 = load i32, i32* %3
%49 = icmp eq i32 %48, 1
br i1 %49, label %50, label %51
50: ; preds = %47
br label %80
51: ; preds = %47
%52 = load i32, i32* %3
%53 = mul nsw i32 %52, 36
%54 = add nsw i32 29493248, %53
%55 = add nsw i32 %54, 0
%56 = sext i32 %55 to i64
%57 = inttoptr i64 %56 to i32*
store i32* %57, i32** %1
%58 = load i32*, i32** %1
store volatile i32 2004318071, i32* %58
%59 = load i32, i32* %3
%60 = mul nsw i32 %59, 36
%61 = add nsw i32 29493248, %60
%62 = add nsw i32 %61, 4
%63 = sext i32 %62 to i64
%64 = inttoptr i64 %63 to i32*
store i32* %64, i32** %1
%65 = load i32*, i32** %1
store volatile i32 2004318071, i32* %65
%66 = load i32, i32* %3
%67 = mul nsw i32 %66, 36
%68 = add nsw i32 29493248, %67
%69 = add nsw i32 %68, 8
%70 = sext i32 %69 to i64
%71 = inttoptr i64 %70 to i32*
store i32* %71, i32** %1
%72 = load i32*, i32** %1
store volatile i32 2004318071, i32* %72
%73 = load i32, i32* %3
%74 = mul nsw i32 %73, 36
%75 = add nsw i32 29493248, %74
%76 = add nsw i32 %75, 12
%77 = sext i32 %76 to i64
%78 = inttoptr i64 %77 to i32*
store i32* %78, i32** %1
%79 = load i32*, i32** %1
store volatile i32 2004318071, i32* %79
br label %80
80: ; preds = %51, %50
%81 = load i32, i32* %3
%82 = add nsw i32 %81, 1
store i32 %82, i32* %3
br label %44
83: ; preds = %28, %44
ret void
}

LLVM IR (-O2):
define void @rt_low_level_init() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 65536, i32* inttoptr (i64 29491280 to i32*)
store volatile i32 -2147479552, i32* inttoptr (i64 29491200 to i32*)
store volatile i32 65535, i32* %1
br label %3
3: ; preds = %7, %0
%4 = load volatile i32, i32* inttoptr (i64 29491200 to i32*)
%5 = and i32 %4, 268435456
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load volatile i32, i32* %1
%9 = add i32 %8, -1
store volatile i32 %9, i32* %1
%10 = icmp eq i32 %8, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %7
%12 = load volatile i32, i32* %1
%13 = icmp eq i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %11
store volatile i32 131072, i32* inttoptr (i64 29491280 to i32*)
br label %15
15: ; preds = %14, %11
%16 = load volatile i32, i32* inttoptr (i64 29491240 to i32*)
%17 = icmp sgt i32 %16, -1
br i1 %17, label %18, label %26
18: ; preds = %15
store volatile i32 511, i32* inttoptr (i64 29491712 to i32*)
store volatile i32 511, i32* inttoptr (i64 29491716 to i32*)
%19 = load volatile i32, i32* inttoptr (i64 29491240 to i32*)
%20 = or i32 %19, -2147483648
store volatile i32 %20, i32* inttoptr (i64 29491240 to i32*)
br label %21
21: ; preds = %21, %18
%22 = load volatile i32, i32* inttoptr (i64 29491240 to i32*)
%23 = and i32 %22, 268435456
%24 = icmp eq i32 %23, 0
br i1 %24, label %21, label %25
25: ; preds = %21
store volatile i32 12416, i32* inttoptr (i64 29491284 to i32*)
store volatile i32 2004318071, i32* inttoptr (i64 29493248 to i32*)
store volatile i32 2004318071, i32* inttoptr (i64 29493252 to i32*)
store volatile i32 2004318071, i32* inttoptr (i64 29493256 to i32*)
store volatile i32 2004318071, i32* inttoptr (i64 29493260 to i32*)
store volatile i32 2004318071, i32* inttoptr (i64 29493320 to i32*)
store volatile i32 2004318071, i32* inttoptr (i64 29493324 to i32*)
store volatile i32 2004318071, i32* inttoptr (i64 29493328 to i32*)
store volatile i32 2004318071, i32* inttoptr (i64 29493332 to i32*)
store volatile i32 2004318071, i32* inttoptr (i64 29493356 to i32*)
store volatile i32 2004318071, i32* inttoptr (i64 29493360 to i32*)
store volatile i32 2004318071, i32* inttoptr (i64 29493364 to i32*)
store volatile i32 2004318071, i32* inttoptr (i64 29493368 to i32*)
store volatile i32 2004318071, i32* inttoptr (i64 29493392 to i32*)
store volatile i32 2004318071, i32* inttoptr (i64 29493396 to i32*)
store volatile i32 2004318071, i32* inttoptr (i64 29493400 to i32*)
store volatile i32 2004318071, i32* inttoptr (i64 29493404 to i32*)
store volatile i32 2004318071, i32* inttoptr (i64 29493428 to i32*)
store volatile i32 2004318071, i32* inttoptr (i64 29493432 to i32*)
store volatile i32 2004318071, i32* inttoptr (i64 29493436 to i32*)
store volatile i32 2004318071, i32* inttoptr (i64 29493440 to i32*)
br label %26
26: ; preds = %25, %15
ret void
}