void sdramc_init(void) {
  if (!((*(volatile unsigned int *)(void *)(0x80000000 + 0x000104)) &
        (0x10000000))) {
    (*(volatile unsigned int *)(void *)(0x80000000 + 0x000004)) =
        (0 | ((((0x10)) & 0x00000003) << 8) | ((((0x10)) & 0x00000003) << 6) |
         ((((0x10)) & 0x00000003) << 4) | ((((0x10)) & 0x00000003) << 2) |
         ((((0x10)) & 0x00000003) << 0));
    (*(volatile unsigned int *)(void *)(0x80000000 + 0x000020)) =
        (0 | (((0x00000000) & 0x00000FFF) << 20) |
         ((((0x0000001A)) & 0x0000001F) << 0));
    (*(volatile unsigned int *)(void *)(0x80000000 + 0x000108)) =
        (0 | (((5) & 0x0000000F) << 28) | (((3) & 0x00000007) << 24) |
         (((7) & 0x0000000F) << 20) | (((2) & 0x00000007) << 16) |
         (((2) & 0x00000007) << 12) | (((5) & 0x0000000F) << 28) |
         (((9) & 0x0000000F) << 8) | (((3) & 0x00000007) << 4));
    (*(volatile unsigned int *)(void *)(0x80000000 + 0x00010C)) =
        (0 | (((2) & 0x0000000F) << 28) | (((4) & 0x0000000F) << 24) |
         (((3) & 0x0000000F) << 20) | (((3) & 0x0000000F) << 16));
    (*(volatile unsigned int *)(void *)(0x80000000 + 0x000104)) =
        (0 | (0x80000000) | (0x40000000) | (0x20000000) |
         (((0x01) & 0x00000003) << 24) | (((0xF) & 0x0000003F) << 16) |
         (0x00000002));
    (*(volatile unsigned int *)(void *)(0x80000000 + 0x000100)) =
        (0 | (0x40000000) | (((0x0) & 0x00000FFF) << 18) | (0x00010000));
    (*(volatile unsigned int *)(void *)(0x80000000 + 0x000100)) =
        (0 | (0x00000000) | (((0x588) & 0x00000FFF) << 18) | (0x00010000));
    (*(volatile unsigned int *)(void *)(0x80000000 + 0x000104)) =
        ((*(volatile unsigned int *)(void *)(0x80000000 + 0x000104)) |
         (0x00000002));
    (*(volatile unsigned int *)(void *)(0x80000000 + 0x000104)) =
        ((*(volatile unsigned int *)(void *)(0x80000000 + 0x000104)) |
         (0x00000004));
    (*(volatile unsigned int *)(void *)(0x80000000 + 0x000104)) =
        ((*(volatile unsigned int *)(void *)(0x80000000 + 0x000104)) |
         (0x00000004));
    (*(volatile unsigned int *)(void *)(0x80000000 + 0x000100)) =
        (0 | (0x00000000) | (((0x188) & 0x00000FFF) << 18) | (0x00010000));
    (*(volatile unsigned int *)(void *)(0x80000000 + 0x000104)) =
        (0 |
         (*(volatile unsigned int *)(void *)(0x80000000 + 0x000104)) &
             ~(0x80000000) |
         (0x10000000) | (((0xF) & 0x0000000F) << 8));
  }
}


x86 assembly (clang, -O0):
<sdramc_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80000104,%eax
mov    (%rax),%eax
and    $0x10000000,%eax
cmp    $0x0,%eax
jne    11c7 <sdramc_init+0xc7>
mov    $0x80000004,%eax
movl   $0x0,(%rax)
mov    $0x80000020,%eax
movl   $0x1a,(%rax)
mov    $0x80000108,%eax
movl   $0x53722930,(%rax)
mov    $0x8000010c,%eax
movl   $0x24330000,(%rax)
mov    $0x80000104,%eax
movl   $0xe10f0002,(%rax)
mov    $0x80000100,%eax
movl   $0x40010000,(%rax)
mov    $0x80000100,%eax
movl   $0x16210000,(%rax)
mov    $0x80000104,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    $0x80000104,%eax
mov    %ecx,(%rax)
mov    $0x80000104,%eax
mov    (%rax),%ecx
or     $0x4,%ecx
mov    $0x80000104,%eax
mov    %ecx,(%rax)
mov    $0x80000104,%eax
mov    (%rax),%ecx
or     $0x4,%ecx
mov    $0x80000104,%eax
mov    %ecx,(%rax)
mov    $0x80000100,%eax
movl   $0x6210000,(%rax)
mov    $0x80000104,%eax
mov    (%rax),%ecx
and    $0x7fffffff,%ecx
or     $0x0,%ecx
or     $0x10000000,%ecx
or     $0xf00,%ecx
mov    $0x80000104,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdramc_init>:
mov    $0x80000104,%eax
testl  $0x10000000,(%rax)
jne    1162 <sdramc_init+0x62>
movl   $0x0,-0x100(%rax)
movl   $0x1a,-0xe4(%rax)
movl   $0x53722930,0x4(%rax)
movl   $0x24330000,0x8(%rax)
movl   $0xe10f0002,(%rax)
movl   $0x40010000,-0x4(%rax)
movl   $0x16210000,-0x4(%rax)
orl    $0x2,(%rax)
orl    $0x4,(%rax)
orl    $0x4,(%rax)
movl   $0x6210000,-0x4(%rax)
mov    $0x6ffff0ff,%ecx
and    (%rax),%ecx
or     $0x10000f00,%ecx
mov    %ecx,(%rax)
ret

LLVM IR (-O0):
define void @sdramc_init() {
%1 = load volatile i32, i32* inttoptr (i64 2147483908 to i32*)
%2 = and i32 %1, 268435456
%3 = icmp ne i32 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %0
store volatile i32 0, i32* inttoptr (i64 2147483652 to i32*)
store volatile i32 26, i32* inttoptr (i64 2147483680 to i32*)
store volatile i32 1399990576, i32* inttoptr (i64 2147483912 to i32*)
store volatile i32 607322112, i32* inttoptr (i64 2147483916 to i32*)
store volatile i32 -519110654, i32* inttoptr (i64 2147483908 to i32*)
store volatile i32 1073807360, i32* inttoptr (i64 2147483904 to i32*)
store volatile i32 371261440, i32* inttoptr (i64 2147483904 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 2147483908 to i32*)
%6 = or i32 %5, 2
store volatile i32 %6, i32* inttoptr (i64 2147483908 to i32*)
%7 = load volatile i32, i32* inttoptr (i64 2147483908 to i32*)
%8 = or i32 %7, 4
store volatile i32 %8, i32* inttoptr (i64 2147483908 to i32*)
%9 = load volatile i32, i32* inttoptr (i64 2147483908 to i32*)
%10 = or i32 %9, 4
store volatile i32 %10, i32* inttoptr (i64 2147483908 to i32*)
store volatile i32 102825984, i32* inttoptr (i64 2147483904 to i32*)
%11 = load volatile i32, i32* inttoptr (i64 2147483908 to i32*)
%12 = and i32 %11, 2147483647
%13 = or i32 0, %12
%14 = or i32 %13, 268435456
%15 = or i32 %14, 3840
store volatile i32 %15, i32* inttoptr (i64 2147483908 to i32*)
br label %16
16: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
define void @sdramc_init() {
%1 = load volatile i32, i32* inttoptr (i64 2147483908 to i32*)
%2 = and i32 %1, 268435456
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %0
store volatile i32 0, i32* inttoptr (i64 2147483652 to i32*)
store volatile i32 26, i32* inttoptr (i64 2147483680 to i32*)
store volatile i32 1399990576, i32* inttoptr (i64 2147483912 to i32*)
store volatile i32 607322112, i32* inttoptr (i64 2147483916 to i32*)
store volatile i32 -519110654, i32* inttoptr (i64 2147483908 to i32*)
store volatile i32 1073807360, i32* inttoptr (i64 2147483904 to i32*)
store volatile i32 371261440, i32* inttoptr (i64 2147483904 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 2147483908 to i32*)
%6 = or i32 %5, 2
store volatile i32 %6, i32* inttoptr (i64 2147483908 to i32*)
%7 = load volatile i32, i32* inttoptr (i64 2147483908 to i32*)
%8 = or i32 %7, 4
store volatile i32 %8, i32* inttoptr (i64 2147483908 to i32*)
%9 = load volatile i32, i32* inttoptr (i64 2147483908 to i32*)
%10 = or i32 %9, 4
store volatile i32 %10, i32* inttoptr (i64 2147483908 to i32*)
store volatile i32 102825984, i32* inttoptr (i64 2147483904 to i32*)
%11 = load volatile i32, i32* inttoptr (i64 2147483908 to i32*)
%12 = and i32 %11, 1879044351
%13 = or i32 %12, 268439296
store volatile i32 %13, i32* inttoptr (i64 2147483908 to i32*)
br label %14
14: ; preds = %4, %0
ret void
}