void init_ddr_phy() {
  unsigned int val = 0;
  val = (*(volatile unsigned int *)(0x44E10000 + 0xE0C));
  val |= 0x40;
  (*(volatile unsigned int *)(0x44E10000 + 0xE0C) = (val));
  val = (*(volatile unsigned int *)(0x44E10000 + 0xE0C));
  val &= ~0x1;
  (*(volatile unsigned int *)(0x44E10000 + 0xE0C) = (val));
  val = (*(volatile unsigned int *)(0x44E10000 + 0xE0C));
  val |= 0x1;
  (*(volatile unsigned int *)(0x44E10000 + 0xE0C) = (val));
  while (!(val = (*(volatile unsigned int *)(0x44E10000 + 0xE0C)) & 0x20))
    ;
  (*(volatile unsigned int *)(0x44E12000 + 0X1C) = (0x40));
  (*(volatile unsigned int *)(0x44E12000 + 0x2C) = (0x1));
  (*(volatile unsigned int *)(0x44E12000 + 0X50) = (0x40));
  (*(volatile unsigned int *)(0x44E12000 + 0x60) = (0x1));
  (*(volatile unsigned int *)(0x44E12000 + 0X84) = (0x40));
  (*(volatile unsigned int *)(0x44E12000 + 0x94) = (0x1));
  (*(volatile unsigned int *)(0x44E12000 + 0xC8) = (0x3B));
  (*(volatile unsigned int *)(0x44E12000 + 0xDC) = (0x85));
  (*(volatile unsigned int *)(0x44E12000 + 0x108) = (0x100));
  (*(volatile unsigned int *)(0x44E12000 + 0x120) = (0xC1));
  (*(volatile unsigned int *)(0x44E12000 + 0x16C) = (0x3B));
  (*(volatile unsigned int *)(0x44E12000 + 0x180) = (0x85));
  (*(volatile unsigned int *)(0x44E12000 + 0x1AC) = (0x100));
  (*(volatile unsigned int *)(0x44E12000 + 0x1C4) = (0xC1));
}


x86 assembly (clang, -O0):
<init_ddr_phy>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x44e10e0c,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x40,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x44e10e0c,%eax
mov    %ecx,(%rax)
mov    $0x44e10e0c,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffffffe,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x44e10e0c,%eax
mov    %ecx,(%rax)
mov    $0x44e10e0c,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x44e10e0c,%eax
mov    %ecx,(%rax)
mov    $0x44e10e0c,%eax
mov    (%rax),%eax
and    $0x20,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1184 <init_ddr_phy+0x84>
jmp    1189 <init_ddr_phy+0x89>
jmp    1162 <init_ddr_phy+0x62>
mov    $0x44e1201c,%eax
movl   $0x40,(%rax)
mov    $0x44e1202c,%eax
movl   $0x1,(%rax)
mov    $0x44e12050,%eax
movl   $0x40,(%rax)
mov    $0x44e12060,%eax
movl   $0x1,(%rax)
mov    $0x44e12084,%eax
movl   $0x40,(%rax)
mov    $0x44e12094,%eax
movl   $0x1,(%rax)
mov    $0x44e120c8,%eax
movl   $0x3b,(%rax)
mov    $0x44e120dc,%eax
movl   $0x85,(%rax)
mov    $0x44e12108,%eax
movl   $0x100,(%rax)
mov    $0x44e12120,%eax
movl   $0xc1,(%rax)
mov    $0x44e1216c,%eax
movl   $0x3b,(%rax)
mov    $0x44e12180,%eax
movl   $0x85,(%rax)
mov    $0x44e121ac,%eax
movl   $0x100,(%rax)
mov    $0x44e121c4,%eax
movl   $0xc1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_ddr_phy>:
orl    $0x40,0x44e10e0c
40
andl   $0xfffffffe,0x44e10e0c
fe
orl    $0x1,0x44e10e0c
01
nopl   0x0(%rax,%rax,1)
testl  $0x20,0x44e10e0c
je     1120 <init_ddr_phy+0x20>
movl   $0x40,0x44e1201c
movl   $0x1,0x44e1202c
movl   $0x40,0x44e12050
movl   $0x1,0x44e12060
movl   $0x40,0x44e12084
movl   $0x1,0x44e12094
movl   $0x3b,0x44e120c8
movl   $0x85,0x44e120dc
movl   $0x100,0x44e12108
movl   $0xc1,0x44e12120
movl   $0x3b,0x44e1216c
movl   $0x85,0x44e12180
movl   $0x100,0x44e121ac
movl   $0xc1,0x44e121c4
ret

LLVM IR (-O0):
define void @init_ddr_phy() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load volatile i32, i32* inttoptr (i64 1155599884 to i32*)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = or i32 %3, 64
store i32 %4, i32* %1
%5 = load i32, i32* %1
store volatile i32 %5, i32* inttoptr (i64 1155599884 to i32*)
%6 = load volatile i32, i32* inttoptr (i64 1155599884 to i32*)
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = and i32 %7, -2
store i32 %8, i32* %1
%9 = load i32, i32* %1
store volatile i32 %9, i32* inttoptr (i64 1155599884 to i32*)
%10 = load volatile i32, i32* inttoptr (i64 1155599884 to i32*)
store i32 %10, i32* %1
%11 = load i32, i32* %1
%12 = or i32 %11, 1
store i32 %12, i32* %1
%13 = load i32, i32* %1
store volatile i32 %13, i32* inttoptr (i64 1155599884 to i32*)
br label %14
14: ; preds = %19, %0
%15 = load volatile i32, i32* inttoptr (i64 1155599884 to i32*)
%16 = and i32 %15, 32
store i32 %16, i32* %1
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
br i1 %18, label %19, label %20
19: ; preds = %14
br label %14
20: ; preds = %14
store volatile i32 64, i32* inttoptr (i64 1155604508 to i32*)
store volatile i32 1, i32* inttoptr (i64 1155604524 to i32*)
store volatile i32 64, i32* inttoptr (i64 1155604560 to i32*)
store volatile i32 1, i32* inttoptr (i64 1155604576 to i32*)
store volatile i32 64, i32* inttoptr (i64 1155604612 to i32*)
store volatile i32 1, i32* inttoptr (i64 1155604628 to i32*)
store volatile i32 59, i32* inttoptr (i64 1155604680 to i32*)
store volatile i32 133, i32* inttoptr (i64 1155604700 to i32*)
store volatile i32 256, i32* inttoptr (i64 1155604744 to i32*)
store volatile i32 193, i32* inttoptr (i64 1155604768 to i32*)
store volatile i32 59, i32* inttoptr (i64 1155604844 to i32*)
store volatile i32 133, i32* inttoptr (i64 1155604864 to i32*)
store volatile i32 256, i32* inttoptr (i64 1155604908 to i32*)
store volatile i32 193, i32* inttoptr (i64 1155604932 to i32*)
ret void
}

LLVM IR (-O2):
define void @init_ddr_phy() {
%1 = load volatile i32, i32* inttoptr (i64 1155599884 to i32*)
%2 = or i32 %1, 64
store volatile i32 %2, i32* inttoptr (i64 1155599884 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1155599884 to i32*)
%4 = and i32 %3, -2
store volatile i32 %4, i32* inttoptr (i64 1155599884 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 1155599884 to i32*)
%6 = or i32 %5, 1
store volatile i32 %6, i32* inttoptr (i64 1155599884 to i32*)
br label %7
7: ; preds = %7, %0
%8 = load volatile i32, i32* inttoptr (i64 1155599884 to i32*)
%9 = and i32 %8, 32
%10 = icmp eq i32 %9, 0
br i1 %10, label %7, label %11
11: ; preds = %7
store volatile i32 64, i32* inttoptr (i64 1155604508 to i32*)
store volatile i32 1, i32* inttoptr (i64 1155604524 to i32*)
store volatile i32 64, i32* inttoptr (i64 1155604560 to i32*)
store volatile i32 1, i32* inttoptr (i64 1155604576 to i32*)
store volatile i32 64, i32* inttoptr (i64 1155604612 to i32*)
store volatile i32 1, i32* inttoptr (i64 1155604628 to i32*)
store volatile i32 59, i32* inttoptr (i64 1155604680 to i32*)
store volatile i32 133, i32* inttoptr (i64 1155604700 to i32*)
store volatile i32 256, i32* inttoptr (i64 1155604744 to i32*)
store volatile i32 193, i32* inttoptr (i64 1155604768 to i32*)
store volatile i32 59, i32* inttoptr (i64 1155604844 to i32*)
store volatile i32 133, i32* inttoptr (i64 1155604864 to i32*)
store volatile i32 256, i32* inttoptr (i64 1155604908 to i32*)
store volatile i32 193, i32* inttoptr (i64 1155604932 to i32*)
ret void
}