int sdram_init() {
  ((*(volatile unsigned int *)0x7e001004) = (0x4));
  ((*(volatile unsigned int *)0x7e001010) =
       (((7800) / (1000000000 / 133000000) + 1)));
  ((*(volatile unsigned int *)0x7e001014) = ((3 << 1)));
  ((*(volatile unsigned int *)0x7e001018) = (0x1));
  ((*(volatile unsigned int *)0x7e00101c) = (0x2));
  ((*(volatile unsigned int *)0x7e001020) =
       (((42) / (1000000000 / 133000000) + 1)));
  ((*(volatile unsigned int *)0x7e001024) =
       (((60) / (1000000000 / 133000000) + 1)));
  unsigned int trcd = ((18) / (1000000000 / 133000000) + 1);
  ((*(volatile unsigned int *)0x7e001028) = (trcd | ((trcd - 3) << 3)));
  unsigned int trfc = ((72) / (1000000000 / 133000000) + 1);
  ((*(volatile unsigned int *)0x7e00102c) = (trfc | ((trfc - 3) << 5)));
  unsigned int trp = ((18) / (1000000000 / 133000000) + 1);
  ((*(volatile unsigned int *)0x7e001030) = (trp | ((trp - 3) << 3)));
  ((*(volatile unsigned int *)0x7e001034) =
       (((12) / (1000000000 / 133000000) + 1)));
  ((*(volatile unsigned int *)0x7e001038) =
       (((12) / (1000000000 / 133000000) + 1)));
  ((*(volatile unsigned int *)0x7e00103c) = (0x1));
  ((*(volatile unsigned int *)0x7e001040) = (0x1));
  ((*(volatile unsigned int *)0x7e001044) =
       (((120) / (1000000000 / 133000000) + 1)));
  ((*(volatile unsigned int *)0x7e001048) =
       (((120) / (1000000000 / 133000000) + 1)));
  ((*(volatile unsigned int *)0x7e00100c) =
       (((*(volatile unsigned int *)0x7e00100c) &
         (~(((1 << (3)) - 1) << (0)))) |
        ((0x2) << (0))));
  ((*(volatile unsigned int *)0x7e00100c) =
       (((*(volatile unsigned int *)0x7e00100c) &
         (~(((1 << (3)) - 1) << (3)))) |
        ((0x3) << (3))));
  ((*(volatile unsigned int *)0x7e00100c) &= (~(1 << (6))));
  ((*(volatile unsigned int *)0x7e00100c) =
       (((*(volatile unsigned int *)0x7e00100c) &
         (~(((1 << (3)) - 1) << (15)))) |
        ((0x2) << (15))));
  ((*(volatile unsigned int *)0X7e00104c) =
       (((*(volatile unsigned int *)0X7e00104c) &
         (~(((1 << (4)) - 1) << (0)))) |
        ((0x5) << (0))));
  ((*(volatile unsigned int *)0X7e00104c) =
       ((*(volatile unsigned int *)0X7e00104c) &= (~(3 << (6)))) |
       ((0x1) << (6)));
  ((*(volatile unsigned int *)0X7e00104c) =
       (((*(volatile unsigned int *)0X7e00104c) &
         (~(((1 << (3)) - 1) << (8)))) |
        ((0x3) << (8))));
  ((*(volatile unsigned int *)0X7e00104c) =
       ((*(volatile unsigned int *)0X7e00104c) &= (~(3 << (11)))) |
       ((0x1) << (11)));
  ((*(volatile unsigned int *)0x7e001200) |= ((1 << (16))));
  ((*(volatile unsigned int *)0x7e001008) = (0xc0000));
  ((*(volatile unsigned int *)0x7e001008) = (0x000));
  ((*(volatile unsigned int *)0x7e001008) = (0x40000));
  ((*(volatile unsigned int *)0x7e001008) = (0x40000));
  ((*(volatile unsigned int *)0x7e001008) = (0xa0000));
  ((*(volatile unsigned int *)0x7e001008) = (0x80032));
  ((*(volatile unsigned int *)0x7e00f120) = (0x0));
  ((*(volatile unsigned int *)0x7e001004) = (0x000));
  while (!(((*(volatile unsigned int *)0x7e001000) & 0x3) == 0x1))
    ;
}


x86 assembly (clang, -O0):
<sdram_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7e001004,%eax
movl   $0x4,(%rax)
mov    $0x7e001010,%eax
movl   $0x45b,(%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   $0x9,(%rax)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
shl    $0x3,%eax
or     %eax,%ecx
mov    $0x7e001028,%eax
mov    %ecx,(%rax)
movl   $0xb,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
shl    $0x5,%eax
or     %eax,%ecx
mov    $0x7e00102c,%eax
mov    %ecx,(%rax)
movl   $0x3,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
shl    $0x3,%eax
or     %eax,%ecx
mov    $0x7e001030,%eax
mov    %ecx,(%rax)
mov    $0x7e001034,%eax
movl   $0x2,(%rax)
mov    $0x7e001038,%eax
movl   $0x2,(%rax)
mov    $0x7e00103c,%eax
movl   $0x1,(%rax)
mov    $0x7e001040,%eax
movl   $0x1,(%rax)
mov    $0x7e001044,%eax
movl   $0x12,(%rax)
mov    $0x7e001048,%eax
movl   $0x12,(%rax)
mov    $0x7e00100c,%eax
mov    (%rax),%ecx
and    $0xfffffff8,%ecx
or     $0x2,%ecx
mov    $0x7e00100c,%eax
mov    %ecx,(%rax)
mov    $0x7e00100c,%eax
mov    (%rax),%ecx
and    $0xffffffc7,%ecx
or     $0x18,%ecx
mov    $0x7e00100c,%eax
mov    %ecx,(%rax)
mov    $0x7e00100c,%eax
mov    (%rax),%ecx
and    $0xffffffbf,%ecx
mov    $0x7e00100c,%eax
mov    %ecx,(%rax)
mov    $0x7e00100c,%eax
mov    (%rax),%ecx
and    $0xfffc7fff,%ecx
or     $0x10000,%ecx
mov    $0x7e00100c,%eax
mov    %ecx,(%rax)
mov    $0x7e00104c,%eax
mov    (%rax),%ecx
and    $0xfffffff0,%ecx
or     $0x5,%ecx
mov    $0x7e00104c,%eax
mov    %ecx,(%rax)
mov    $0x7e00104c,%eax
mov    (%rax),%ecx
and    $0xffffff3f,%ecx
mov    $0x7e00104c,%eax
mov    %ecx,(%rax)
or     $0x40,%ecx
mov    $0x7e00104c,%eax
mov    %ecx,(%rax)
mov    $0x7e00104c,%eax
mov    (%rax),%ecx
and    $0xfffff8ff,%ecx
or     $0x300,%ecx
mov    $0x7e00104c,%eax
mov    %ecx,(%rax)
mov    $0x7e00104c,%eax
mov    (%rax),%ecx
and    $0xffffe7ff,%ecx
mov    $0x7e00104c,%eax
mov    %ecx,(%rax)
or     $0x800,%ecx
mov    $0x7e00104c,%eax
mov    %ecx,(%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   $0xa0000,(%rax)
mov    $0x7e001008,%eax
movl   $0x80032,(%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
sete   %al
xor    $0xff,%al
test   $0x1,%al
jne    1332 <sdram_init+0x232>
jmp    1337 <sdram_init+0x237>
jmp    1313 <sdram_init+0x213>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdram_init>:
movl   $0x4,0x7e001004
movl   $0x45b,0x7e001010
movl   $0x6,0x7e001014
movl   $0x1,0x7e001018
movl   $0x2,0x7e00101c
movl   $0x7,0x7e001020
movl   $0x9,0x7e001024
movl   $0x3,0x7e001028
movl   $0x10b,0x7e00102c
movl   $0x3,0x7e001030
movl   $0x2,0x7e001034
movl   $0x2,0x7e001038
movl   $0x1,0x7e00103c
movl   $0x1,0x7e001040
movl   $0x12,0x7e001044
movl   $0x12,0x7e001048
mov    0x7e00100c,%eax
and    $0xfffffff8,%eax
or     $0x2,%eax
mov    %eax,0x7e00100c
mov    0x7e00100c,%eax
and    $0xffffffc7,%eax
or     $0x18,%eax
mov    %eax,0x7e00100c
andl   $0xffffffbf,0x7e00100c
bf
mov    $0xfffc7fff,%eax
and    0x7e00100c,%eax
or     $0x10000,%eax
mov    %eax,0x7e00100c
mov    0x7e00104c,%eax
and    $0xfffffff0,%eax
or     $0x5,%eax
mov    %eax,0x7e00104c
mov    $0xffffff3f,%eax
and    0x7e00104c,%eax
mov    %eax,0x7e00104c
or     $0x40,%eax
mov    %eax,0x7e00104c
mov    $0xfffff8ff,%eax
and    0x7e00104c,%eax
or     $0x300,%eax
mov    %eax,0x7e00104c
mov    $0xffffe7ff,%eax
and    0x7e00104c,%eax
mov    %eax,0x7e00104c
or     $0x800,%eax
mov    %eax,0x7e00104c
orl    $0x10000,0x7e001200
movl   $0xc0000,0x7e001008
movl   $0x0,0x7e001008
movl   $0x40000,0x7e001008
movl   $0x40000,0x7e001008
movl   $0xa0000,0x7e001008
movl   $0x80032,0x7e001008
movl   $0x0,0x7e00f120
movl   $0x0,0x7e001004
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x7e001000,%eax
and    $0x3,%eax
cmp    $0x1,%eax
jne    12d0 <sdram_init+0x1d0>
ret

LLVM IR (-O0):
define i32 @sdram_init() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store volatile i32 4, i32* inttoptr (i64 2113933316 to i32*)
store volatile i32 1115, 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 9, i32* inttoptr (i64 2113933348 to i32*)
store i32 3, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = sub i32 %6, 3
%8 = shl i32 %7, 3
%9 = or i32 %5, %8
store volatile i32 %9, i32* inttoptr (i64 2113933352 to i32*)
store i32 11, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = sub i32 %11, 3
%13 = shl i32 %12, 5
%14 = or i32 %10, %13
store volatile i32 %14, i32* inttoptr (i64 2113933356 to i32*)
store i32 3, i32* %4
%15 = load i32, i32* %4
%16 = load i32, i32* %4
%17 = sub i32 %16, 3
%18 = shl i32 %17, 3
%19 = or i32 %15, %18
store volatile i32 %19, i32* inttoptr (i64 2113933360 to i32*)
store volatile i32 2, i32* inttoptr (i64 2113933364 to i32*)
store volatile i32 2, i32* inttoptr (i64 2113933368 to i32*)
store volatile i32 1, i32* inttoptr (i64 2113933372 to i32*)
store volatile i32 1, i32* inttoptr (i64 2113933376 to i32*)
store volatile i32 18, i32* inttoptr (i64 2113933380 to i32*)
store volatile i32 18, i32* inttoptr (i64 2113933384 to i32*)
%20 = load volatile i32, i32* inttoptr (i64 2113933324 to i32*)
%21 = and i32 %20, -8
%22 = or i32 %21, 2
store volatile i32 %22, i32* inttoptr (i64 2113933324 to i32*)
%23 = load volatile i32, i32* inttoptr (i64 2113933324 to i32*)
%24 = and i32 %23, -57
%25 = or i32 %24, 24
store volatile i32 %25, i32* inttoptr (i64 2113933324 to i32*)
%26 = load volatile i32, i32* inttoptr (i64 2113933324 to i32*)
%27 = and i32 %26, -65
store volatile i32 %27, i32* inttoptr (i64 2113933324 to i32*)
%28 = load volatile i32, i32* inttoptr (i64 2113933324 to i32*)
%29 = and i32 %28, -229377
%30 = or i32 %29, 65536
store volatile i32 %30, i32* inttoptr (i64 2113933324 to i32*)
%31 = load volatile i32, i32* inttoptr (i64 2113933388 to i32*)
%32 = and i32 %31, -16
%33 = or i32 %32, 5
store volatile i32 %33, i32* inttoptr (i64 2113933388 to i32*)
%34 = load volatile i32, i32* inttoptr (i64 2113933388 to i32*)
%35 = and i32 %34, -193
store volatile i32 %35, i32* inttoptr (i64 2113933388 to i32*)
%36 = or i32 %35, 64
store volatile i32 %36, i32* inttoptr (i64 2113933388 to i32*)
%37 = load volatile i32, i32* inttoptr (i64 2113933388 to i32*)
%38 = and i32 %37, -1793
%39 = or i32 %38, 768
store volatile i32 %39, i32* inttoptr (i64 2113933388 to i32*)
%40 = load volatile i32, i32* inttoptr (i64 2113933388 to i32*)
%41 = and i32 %40, -6145
store volatile i32 %41, i32* inttoptr (i64 2113933388 to i32*)
%42 = or i32 %41, 2048
store volatile i32 %42, i32* inttoptr (i64 2113933388 to i32*)
%43 = load volatile i32, i32* inttoptr (i64 2113933824 to i32*)
%44 = or i32 %43, 65536
store volatile i32 %44, 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 655360, i32* inttoptr (i64 2113933320 to i32*)
store volatile i32 524338, 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 %45
45: ; preds = %50, %0
%46 = load volatile i32, i32* inttoptr (i64 2113933312 to i32*)
%47 = and i32 %46, 3
%48 = icmp eq i32 %47, 1
%49 = xor i1 %48, true
br i1 %49, label %50, label %51
50: ; preds = %45
br label %45
51: ; preds = %45
%52 = load i32, i32* %1
ret i32 %52
}

LLVM IR (-O2):
define i32 @sdram_init() {
store volatile i32 4, i32* inttoptr (i64 2113933316 to i32*)
store volatile i32 1115, 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 9, i32* inttoptr (i64 2113933348 to i32*)
store volatile i32 3, i32* inttoptr (i64 2113933352 to i32*)
store volatile i32 267, i32* inttoptr (i64 2113933356 to i32*)
store volatile i32 3, i32* inttoptr (i64 2113933360 to i32*)
store volatile i32 2, i32* inttoptr (i64 2113933364 to i32*)
store volatile i32 2, i32* inttoptr (i64 2113933368 to i32*)
store volatile i32 1, i32* inttoptr (i64 2113933372 to i32*)
store volatile i32 1, i32* inttoptr (i64 2113933376 to i32*)
store volatile i32 18, i32* inttoptr (i64 2113933380 to i32*)
store volatile i32 18, i32* inttoptr (i64 2113933384 to i32*)
%1 = load volatile i32, i32* inttoptr (i64 2113933324 to i32*)
%2 = and i32 %1, -8
%3 = or i32 %2, 2
store volatile i32 %3, i32* inttoptr (i64 2113933324 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 2113933324 to i32*)
%5 = and i32 %4, -57
%6 = or i32 %5, 24
store volatile i32 %6, i32* inttoptr (i64 2113933324 to i32*)
%7 = load volatile i32, i32* inttoptr (i64 2113933324 to i32*)
%8 = and i32 %7, -65
store volatile i32 %8, i32* inttoptr (i64 2113933324 to i32*)
%9 = load volatile i32, i32* inttoptr (i64 2113933324 to i32*)
%10 = and i32 %9, -229377
%11 = or i32 %10, 65536
store volatile i32 %11, i32* inttoptr (i64 2113933324 to i32*)
%12 = load volatile i32, i32* inttoptr (i64 2113933388 to i32*)
%13 = and i32 %12, -16
%14 = or i32 %13, 5
store volatile i32 %14, i32* inttoptr (i64 2113933388 to i32*)
%15 = load volatile i32, i32* inttoptr (i64 2113933388 to i32*)
%16 = and i32 %15, -193
store volatile i32 %16, i32* inttoptr (i64 2113933388 to i32*)
%17 = or i32 %16, 64
store volatile i32 %17, i32* inttoptr (i64 2113933388 to i32*)
%18 = load volatile i32, i32* inttoptr (i64 2113933388 to i32*)
%19 = and i32 %18, -1793
%20 = or i32 %19, 768
store volatile i32 %20, i32* inttoptr (i64 2113933388 to i32*)
%21 = load volatile i32, i32* inttoptr (i64 2113933388 to i32*)
%22 = and i32 %21, -6145
store volatile i32 %22, i32* inttoptr (i64 2113933388 to i32*)
%23 = or i32 %22, 2048
store volatile i32 %23, i32* inttoptr (i64 2113933388 to i32*)
%24 = load volatile i32, i32* inttoptr (i64 2113933824 to i32*)
%25 = or i32 %24, 65536
store volatile i32 %25, 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 655360, i32* inttoptr (i64 2113933320 to i32*)
store volatile i32 524338, 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 %26
26: ; preds = %26, %0
%27 = load volatile i32, i32* inttoptr (i64 2113933312 to i32*)
%28 = and i32 %27, 3
%29 = icmp eq i32 %28, 1
br i1 %29, label %30, label %26
30: ; preds = %26
ret i32 undef
}