#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ init_ddr_phy();
int /*<<< orphan*/ init_ddr_pll();
int /*<<< orphan*/ init_emif();
void init_ddr3_ram() {
  unsigned int val = 0;
  init_ddr_pll();
  (*(volatile unsigned int *)(0x44E00400 + 0x4) = (0x2));
  init_emif();
  init_ddr_phy();
  val = (*(volatile unsigned int *)(0x44E10000 + 0xE04));
  val &= 0xefffffff;
  (*(volatile unsigned int *)(0x44E10000 + 0xE04) = (val));
  val = (*(volatile unsigned int *)(0x44E10000 + 0x131C));
  val |= 0x1;
  (*(volatile unsigned int *)(0x44E10000 + 0x131C) = (val));
  (*(volatile unsigned int *)(0x4C000000 + 0xE4) = (0x100006));
  (*(volatile unsigned int *)(0x4C000000 + 0xE8) = (0x100006));
  (*(volatile unsigned int *)(0x4C000000 + 0x18) = (0x0888A39B));
  (*(volatile unsigned int *)(0x4C000000 + 0x1C) = (0x0888A39B));
  (*(volatile unsigned int *)(0x4C000000 + 0x20) = (0x26337FDA));
  (*(volatile unsigned int *)(0x4C000000 + 0x24) = (0x26337FDA));
  (*(volatile unsigned int *)(0x4C000000 + 0x28) = (0x501F830F));
  (*(volatile unsigned int *)(0x4C000000 + 0x2C) = (0x501F830F));
  (*(volatile unsigned int *)(0x4C000000 + 0x10) = (0x0000093B));
  (*(volatile unsigned int *)(0x4C000000 + 0x14) = (0x0000093B));
  (*(volatile unsigned int *)(0x4C000000 + 0xC8) = (0x50074BE4));
  (*(volatile unsigned int *)(0x4C000000 + 0x8) = (0x61C04AB2));
  (*(volatile unsigned int *)(0x44E10000 + 0x110) = (0x61C04AB2));
}


x86 assembly (clang, -O0):
<init_ddr3_ram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <init_ddr_pll@plt>
mov    $0x44e00404,%eax
movl   $0x2,(%rax)
mov    $0x0,%al
call   1050 <init_emif@plt>
mov    $0x0,%al
call   1040 <init_ddr_phy@plt>
mov    $0x44e10e04,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xefffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x44e10e04,%eax
mov    %ecx,(%rax)
mov    $0x44e1131c,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x44e1131c,%eax
mov    %ecx,(%rax)
mov    $0x4c0000e4,%eax
movl   $0x100006,(%rax)
mov    $0x4c0000e8,%eax
movl   $0x100006,(%rax)
mov    $0x4c000018,%eax
movl   $0x888a39b,(%rax)
mov    $0x4c00001c,%eax
movl   $0x888a39b,(%rax)
mov    $0x4c000020,%eax
movl   $0x26337fda,(%rax)
mov    $0x4c000024,%eax
movl   $0x26337fda,(%rax)
mov    $0x4c000028,%eax
movl   $0x501f830f,(%rax)
mov    $0x4c00002c,%eax
movl   $0x501f830f,(%rax)
mov    $0x4c000010,%eax
movl   $0x93b,(%rax)
mov    $0x4c000014,%eax
movl   $0x93b,(%rax)
mov    $0x4c0000c8,%eax
movl   $0x50074be4,(%rax)
mov    $0x4c000008,%eax
movl   $0x61c04ab2,(%rax)
mov    $0x44e10110,%eax
movl   $0x61c04ab2,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_ddr3_ram>:
push   %rax
xor    %eax,%eax
call   1030 <init_ddr_pll@plt>
movl   $0x2,0x44e00404
xor    %eax,%eax
call   1050 <init_emif@plt>
xor    %eax,%eax
call   1040 <init_ddr_phy@plt>
andl   $0xefffffff,0x44e10e04
ff ff ff ef
orl    $0x1,0x44e1131c
01
movl   $0x100006,0x4c0000e4
movl   $0x100006,0x4c0000e8
movl   $0x888a39b,0x4c000018
9b a3 88 08
movl   $0x888a39b,0x4c00001c
9b a3 88 08
movl   $0x26337fda,0x4c000020
da 7f 33 26
movl   $0x26337fda,0x4c000024
da 7f 33 26
movl   $0x501f830f,0x4c000028
0f 83 1f 50
movl   $0x501f830f,0x4c00002c
0f 83 1f 50
movl   $0x93b,0x4c000010
movl   $0x93b,0x4c000014
movl   $0x50074be4,0x4c0000c8
e4 4b 07 50
movl   $0x61c04ab2,0x4c000008
b2 4a c0 61
movl   $0x61c04ab2,0x44e10110
b2 4a c0 61
pop    %rax
ret

LLVM IR (-O0):
define void @init_ddr3_ram() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init_ddr_pll()
store volatile i32 2, i32* inttoptr (i64 1155531780 to i32*)
%3 = call i32 (...) @init_emif()
%4 = call i32 (...) @init_ddr_phy()
%5 = load volatile i32, i32* inttoptr (i64 1155599876 to i32*)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = and i32 %6, -268435457
store i32 %7, i32* %1
%8 = load i32, i32* %1
store volatile i32 %8, i32* inttoptr (i64 1155599876 to i32*)
%9 = load volatile i32, i32* inttoptr (i64 1155601180 to i32*)
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = or i32 %10, 1
store i32 %11, i32* %1
%12 = load i32, i32* %1
store volatile i32 %12, i32* inttoptr (i64 1155601180 to i32*)
store volatile i32 1048582, i32* inttoptr (i64 1275068644 to i32*)
store volatile i32 1048582, i32* inttoptr (i64 1275068648 to i32*)
store volatile i32 143172507, i32* inttoptr (i64 1275068440 to i32*)
store volatile i32 143172507, i32* inttoptr (i64 1275068444 to i32*)
store volatile i32 640909274, i32* inttoptr (i64 1275068448 to i32*)
store volatile i32 640909274, i32* inttoptr (i64 1275068452 to i32*)
store volatile i32 1344242447, i32* inttoptr (i64 1275068456 to i32*)
store volatile i32 1344242447, i32* inttoptr (i64 1275068460 to i32*)
store volatile i32 2363, i32* inttoptr (i64 1275068432 to i32*)
store volatile i32 2363, i32* inttoptr (i64 1275068436 to i32*)
store volatile i32 1342655460, i32* inttoptr (i64 1275068616 to i32*)
store volatile i32 1639991986, i32* inttoptr (i64 1275068424 to i32*)
store volatile i32 1639991986, i32* inttoptr (i64 1155596560 to i32*)
ret void
}

LLVM IR (-O2):
define void @init_ddr3_ram() {
%1 = tail call i32 (...) @init_ddr_pll()
store volatile i32 2, i32* inttoptr (i64 1155531780 to i32*)
%2 = tail call i32 (...) @init_emif()
%3 = tail call i32 (...) @init_ddr_phy()
%4 = load volatile i32, i32* inttoptr (i64 1155599876 to i32*)
%5 = and i32 %4, -268435457
store volatile i32 %5, i32* inttoptr (i64 1155599876 to i32*)
%6 = load volatile i32, i32* inttoptr (i64 1155601180 to i32*)
%7 = or i32 %6, 1
store volatile i32 %7, i32* inttoptr (i64 1155601180 to i32*)
store volatile i32 1048582, i32* inttoptr (i64 1275068644 to i32*)
store volatile i32 1048582, i32* inttoptr (i64 1275068648 to i32*)
store volatile i32 143172507, i32* inttoptr (i64 1275068440 to i32*)
store volatile i32 143172507, i32* inttoptr (i64 1275068444 to i32*)
store volatile i32 640909274, i32* inttoptr (i64 1275068448 to i32*)
store volatile i32 640909274, i32* inttoptr (i64 1275068452 to i32*)
store volatile i32 1344242447, i32* inttoptr (i64 1275068456 to i32*)
store volatile i32 1344242447, i32* inttoptr (i64 1275068460 to i32*)
store volatile i32 2363, i32* inttoptr (i64 1275068432 to i32*)
store volatile i32 2363, i32* inttoptr (i64 1275068436 to i32*)
store volatile i32 1342655460, i32* inttoptr (i64 1275068616 to i32*)
store volatile i32 1639991986, i32* inttoptr (i64 1275068424 to i32*)
store volatile i32 1639991986, i32* inttoptr (i64 1155596560 to i32*)
ret void
}