void initSdram(void) {
  (*(volatile unsigned int *)(0x7E001004)) = 4;
  (*(volatile unsigned int *)(0x7E001010)) = 1037;
  (*(volatile unsigned int *)(0x7E001014)) = 6;
  (*(volatile unsigned int *)(0x7E001018)) = 1;
  (*(volatile unsigned int *)(0x7E00101C)) = 2;
  (*(volatile unsigned int *)(0x7E001020)) = 7;
  (*(volatile unsigned int *)(0x7E001024)) = 10;
  (*(volatile unsigned int *)(0x7E001028)) = (1 << 3) | 4;
  (*(volatile unsigned int *)(0x7E00102C)) = (8 << 5) | 11;
  (*(volatile unsigned int *)(0x7E001030)) = (1 << 3) | 4;
  (*(volatile unsigned int *)(0x7E001034)) = 3;
  (*(volatile unsigned int *)(0x7E001038)) = 3;
  (*(volatile unsigned int *)(0x7E00103C)) = 2;
  (*(volatile unsigned int *)(0x7E001040)) = 1;
  (*(volatile unsigned int *)(0x7E001044)) = 17;
  (*(volatile unsigned int *)(0x7E001048)) = 17;
  (*(volatile unsigned int *)(0x7E00100C)) =
      ((*(volatile unsigned int *)(0x7E00100C)) & 0xFFFFFFC0) | 0x1A;
  (*(volatile unsigned int *)(0x7E00104C)) = 0xB45;
  (*(volatile unsigned int *)(0x7E001200)) |= (1 << 16);
  (*(volatile unsigned int *)(0x7E001008)) = 0xC0000;
  (*(volatile unsigned int *)(0x7E001008)) = 0;
  (*(volatile unsigned int *)(0x7E001008)) = 0x40000;
  (*(volatile unsigned int *)(0x7E001008)) = 0x40000;
  (*(volatile unsigned int *)(0x7E001008)) = 0x80032;
  (*(volatile unsigned int *)(0x7E001008)) = 0xA0000;
  (*(volatile unsigned int *)(0x7E00F120)) = 0;
  (*(volatile unsigned int *)(0x7E001004)) = 0;
  while (1) {
    if (((*(volatile unsigned int *)(0x7E001000)) & 0x3) == 1)
      break;
  }
  return;
}


x86 assembly (clang, -O0):
<initSdram>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7e001004,%eax
movl   $0x4,(%rax)
mov    $0x7e001010,%eax
movl   $0x40d,(%rax)
mov    $0x7e001014,%eax
movl   $0x6,(%rax)
mov    $0x7e001018,%eax
movl   $0x1,(%rax)
mov    $0x7e00101c,%eax
movl   $0x2,(%rax)
mov    $0x7e001020,%eax
movl   $0x7,(%rax)
mov    $0x7e001024,%eax
movl   $0xa,(%rax)
mov    $0x7e001028,%eax
movl   $0xc,(%rax)
mov    $0x7e00102c,%eax
movl   $0x10b,(%rax)
mov    $0x7e001030,%eax
movl   $0xc,(%rax)
mov    $0x7e001034,%eax
movl   $0x3,(%rax)
mov    $0x7e001038,%eax
movl   $0x3,(%rax)
mov    $0x7e00103c,%eax
movl   $0x2,(%rax)
mov    $0x7e001040,%eax
movl   $0x1,(%rax)
mov    $0x7e001044,%eax
movl   $0x11,(%rax)
mov    $0x7e001048,%eax
movl   $0x11,(%rax)
mov    $0x7e00100c,%eax
mov    (%rax),%ecx
and    $0xffffffc0,%ecx
or     $0x1a,%ecx
mov    $0x7e00100c,%eax
mov    %ecx,(%rax)
mov    $0x7e00104c,%eax
movl   $0xb45,(%rax)
mov    $0x7e001200,%eax
mov    (%rax),%ecx
or     $0x10000,%ecx
mov    $0x7e001200,%eax
mov    %ecx,(%rax)
mov    $0x7e001008,%eax
movl   $0xc0000,(%rax)
mov    $0x7e001008,%eax
movl   $0x0,(%rax)
mov    $0x7e001008,%eax
movl   $0x40000,(%rax)
mov    $0x7e001008,%eax
movl   $0x40000,(%rax)
mov    $0x7e001008,%eax
movl   $0x80032,(%rax)
mov    $0x7e001008,%eax
movl   $0xa0000,(%rax)
mov    $0x7e00f120,%eax
movl   $0x0,(%rax)
mov    $0x7e001004,%eax
movl   $0x0,(%rax)
mov    $0x7e001000,%eax
mov    (%rax),%eax
and    $0x3,%eax
cmp    $0x1,%eax
jne    1257 <initSdram+0x157>
jmp    125c <initSdram+0x15c>
jmp    123f <initSdram+0x13f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initSdram>:
movl   $0x4,0x7e001004
movl   $0x40d,0x7e001010
movl   $0x6,0x7e001014
movl   $0x1,0x7e001018
movl   $0x2,0x7e00101c
movl   $0x7,0x7e001020
movl   $0xa,0x7e001024
movl   $0xc,0x7e001028
movl   $0x10b,0x7e00102c
movl   $0xc,0x7e001030
movl   $0x3,0x7e001034
movl   $0x3,0x7e001038
movl   $0x2,0x7e00103c
movl   $0x1,0x7e001040
movl   $0x11,0x7e001044
movl   $0x11,0x7e001048
mov    0x7e00100c,%eax
and    $0xffffffc0,%eax
or     $0x1a,%eax
mov    %eax,0x7e00100c
movl   $0xb45,0x7e00104c
orl    $0x10000,0x7e001200
movl   $0xc0000,0x7e001008
movl   $0x0,0x7e001008
movl   $0x40000,0x7e001008
movl   $0x40000,0x7e001008
movl   $0x80032,0x7e001008
movl   $0xa0000,0x7e001008
movl   $0x0,0x7e00f120
movl   $0x0,0x7e001004
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x7e001000,%eax
and    $0x3,%eax
cmp    $0x1,%eax
jne    1240 <initSdram+0x140>
ret

LLVM IR (-O0):
define void @initSdram() {
store volatile i32 4, i32* inttoptr (i64 2113933316 to i32*)
store volatile i32 1037, i32* inttoptr (i64 2113933328 to i32*)
store volatile i32 6, i32* inttoptr (i64 2113933332 to i32*)
store volatile i32 1, i32* inttoptr (i64 2113933336 to i32*)
store volatile i32 2, i32* inttoptr (i64 2113933340 to i32*)
store volatile i32 7, i32* inttoptr (i64 2113933344 to i32*)
store volatile i32 10, i32* inttoptr (i64 2113933348 to i32*)
store volatile i32 12, i32* inttoptr (i64 2113933352 to i32*)
store volatile i32 267, i32* inttoptr (i64 2113933356 to i32*)
store volatile i32 12, i32* inttoptr (i64 2113933360 to i32*)
store volatile i32 3, i32* inttoptr (i64 2113933364 to i32*)
store volatile i32 3, i32* inttoptr (i64 2113933368 to i32*)
store volatile i32 2, i32* inttoptr (i64 2113933372 to i32*)
store volatile i32 1, i32* inttoptr (i64 2113933376 to i32*)
store volatile i32 17, i32* inttoptr (i64 2113933380 to i32*)
store volatile i32 17, i32* inttoptr (i64 2113933384 to i32*)
%1 = load volatile i32, i32* inttoptr (i64 2113933324 to i32*)
%2 = and i32 %1, -64
%3 = or i32 %2, 26
store volatile i32 %3, i32* inttoptr (i64 2113933324 to i32*)
store volatile i32 2885, i32* inttoptr (i64 2113933388 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 2113933824 to i32*)
%5 = or i32 %4, 65536
store volatile i32 %5, i32* inttoptr (i64 2113933824 to i32*)
store volatile i32 786432, i32* inttoptr (i64 2113933320 to i32*)
store volatile i32 0, i32* inttoptr (i64 2113933320 to i32*)
store volatile i32 262144, i32* inttoptr (i64 2113933320 to i32*)
store volatile i32 262144, i32* inttoptr (i64 2113933320 to i32*)
store volatile i32 524338, i32* inttoptr (i64 2113933320 to i32*)
store volatile i32 655360, i32* inttoptr (i64 2113933320 to i32*)
store volatile i32 0, i32* inttoptr (i64 2113990944 to i32*)
store volatile i32 0, i32* inttoptr (i64 2113933316 to i32*)
br label %6
6: ; preds = %0, %11
%7 = load volatile i32, i32* inttoptr (i64 2113933312 to i32*)
%8 = and i32 %7, 3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %6
br label %12
11: ; preds = %6
br label %6
12: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @initSdram() {
store volatile i32 4, i32* inttoptr (i64 2113933316 to i32*)
store volatile i32 1037, i32* inttoptr (i64 2113933328 to i32*)
store volatile i32 6, i32* inttoptr (i64 2113933332 to i32*)
store volatile i32 1, i32* inttoptr (i64 2113933336 to i32*)
store volatile i32 2, i32* inttoptr (i64 2113933340 to i32*)
store volatile i32 7, i32* inttoptr (i64 2113933344 to i32*)
store volatile i32 10, i32* inttoptr (i64 2113933348 to i32*)
store volatile i32 12, i32* inttoptr (i64 2113933352 to i32*)
store volatile i32 267, i32* inttoptr (i64 2113933356 to i32*)
store volatile i32 12, i32* inttoptr (i64 2113933360 to i32*)
store volatile i32 3, i32* inttoptr (i64 2113933364 to i32*)
store volatile i32 3, i32* inttoptr (i64 2113933368 to i32*)
store volatile i32 2, i32* inttoptr (i64 2113933372 to i32*)
store volatile i32 1, i32* inttoptr (i64 2113933376 to i32*)
store volatile i32 17, i32* inttoptr (i64 2113933380 to i32*)
store volatile i32 17, i32* inttoptr (i64 2113933384 to i32*)
%1 = load volatile i32, i32* inttoptr (i64 2113933324 to i32*)
%2 = and i32 %1, -64
%3 = or i32 %2, 26
store volatile i32 %3, i32* inttoptr (i64 2113933324 to i32*)
store volatile i32 2885, i32* inttoptr (i64 2113933388 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 2113933824 to i32*)
%5 = or i32 %4, 65536
store volatile i32 %5, i32* inttoptr (i64 2113933824 to i32*)
store volatile i32 786432, i32* inttoptr (i64 2113933320 to i32*)
store volatile i32 0, i32* inttoptr (i64 2113933320 to i32*)
store volatile i32 262144, i32* inttoptr (i64 2113933320 to i32*)
store volatile i32 262144, i32* inttoptr (i64 2113933320 to i32*)
store volatile i32 524338, i32* inttoptr (i64 2113933320 to i32*)
store volatile i32 655360, i32* inttoptr (i64 2113933320 to i32*)
store volatile i32 0, i32* inttoptr (i64 2113990944 to i32*)
store volatile i32 0, i32* inttoptr (i64 2113933316 to i32*)
br label %6
6: ; preds = %6, %0
%7 = load volatile i32, i32* inttoptr (i64 2113933312 to i32*)
%8 = and i32 %7, 3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %6
10: ; preds = %6
ret void
}