#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 */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ config_cmd_ctrl_x();
int /*<<< orphan*/ config_ddr_data_x_0();
int /*<<< orphan*/ config_ddr_data_x_1();
int /*<<< orphan*/ config_ddr_phy_x();
int /*<<< orphan*/ config_io_ctrl_x();
int /*<<< orphan*/ config_sdram_x();
int /*<<< orphan*/ config_vtp_x();
int /*<<< orphan*/ ddr_pll_config_x();
int /*<<< orphan*/ enable_emif_clocks_x();
int /*<<< orphan*/ set_sdram_timings_x();
int /*<<< orphan*/ uart_putf(char *, int);
void config_ddr_x(void) {
  uart_putf("DEBUG%i\n", (1));
  enable_emif_clocks_x();
  uart_putf("DEBUG%i\n", (2));
  ddr_pll_config_x();
  uart_putf("DEBUG%i\n", (3));
  config_vtp_x();
  uart_putf("DEBUG%i\n", (4));
  config_cmd_ctrl_x();
  uart_putf("DEBUG%i\n", (5));
  config_ddr_data_x_0();
  uart_putf("DEBUG%i\n", (6));
  config_ddr_data_x_1();
  uart_putf("DEBUG%i\n", (7));
  config_io_ctrl_x();
  uart_putf("DEBUG%i\n", (8));
  *(uint32_t *)(0x44E1131C) = (uint32_t)(0x1);
  uart_putf("DEBUG%i\n", (9));
  config_ddr_phy_x();
  uart_putf("DEBUG%i\n", (10));
  set_sdram_timings_x();
  uart_putf("DEBUG%i\n", (11));
  config_sdram_x();
  uart_putf("DEBUG%i\n", (12));
}


x86 assembly (clang, -O0):
<config_ddr_x>:
push   %rbp
mov    %rsp,%rbp
lea    0xe45(%rip),%rdi
mov    $0x1,%esi
call   10a0 <uart_putf@plt>
mov    $0x0,%al
call   1050 <enable_emif_clocks_x@plt>
lea    0xe2d(%rip),%rdi
mov    $0x2,%esi
call   10a0 <uart_putf@plt>
mov    $0x0,%al
call   1090 <ddr_pll_config_x@plt>
lea    0xe15(%rip),%rdi
mov    $0x3,%esi
call   10a0 <uart_putf@plt>
mov    $0x0,%al
call   1030 <config_vtp_x@plt>
lea    0xdfd(%rip),%rdi
mov    $0x4,%esi
call   10a0 <uart_putf@plt>
mov    $0x0,%al
call   10c0 <config_cmd_ctrl_x@plt>
lea    0xde5(%rip),%rdi
mov    $0x5,%esi
call   10a0 <uart_putf@plt>
mov    $0x0,%al
call   1080 <config_ddr_data_x_0@plt>
lea    0xdcd(%rip),%rdi
mov    $0x6,%esi
call   10a0 <uart_putf@plt>
mov    $0x0,%al
call   1040 <config_ddr_data_x_1@plt>
lea    0xdb5(%rip),%rdi
mov    $0x7,%esi
call   10a0 <uart_putf@plt>
mov    $0x0,%al
call   10d0 <config_io_ctrl_x@plt>
lea    0xd9d(%rip),%rdi
mov    $0x8,%esi
call   10a0 <uart_putf@plt>
mov    $0x44e1131c,%eax
movq   $0x1,(%rax)
lea    0xd80(%rip),%rdi
mov    $0x9,%esi
call   10a0 <uart_putf@plt>
mov    $0x0,%al
call   10b0 <config_ddr_phy_x@plt>
lea    0xd68(%rip),%rdi
mov    $0xa,%esi
call   10a0 <uart_putf@plt>
mov    $0x0,%al
call   1070 <set_sdram_timings_x@plt>
lea    0xd50(%rip),%rdi
mov    $0xb,%esi
call   10a0 <uart_putf@plt>
mov    $0x0,%al
call   1060 <config_sdram_x@plt>
lea    0xd38(%rip),%rdi
mov    $0xc,%esi
call   10a0 <uart_putf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_ddr_x>:
push   %rbx
lea    0xe48(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   10a0 <uart_putf@plt>
xor    %eax,%eax
call   1050 <enable_emif_clocks_x@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   10a0 <uart_putf@plt>
xor    %eax,%eax
call   1090 <ddr_pll_config_x@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   10a0 <uart_putf@plt>
xor    %eax,%eax
call   1030 <config_vtp_x@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   10a0 <uart_putf@plt>
xor    %eax,%eax
call   10c0 <config_cmd_ctrl_x@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   10a0 <uart_putf@plt>
xor    %eax,%eax
call   1080 <config_ddr_data_x_0@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   10a0 <uart_putf@plt>
xor    %eax,%eax
call   1040 <config_ddr_data_x_1@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   10a0 <uart_putf@plt>
xor    %eax,%eax
call   10d0 <config_io_ctrl_x@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   10a0 <uart_putf@plt>
movq   $0x1,0x44e1131c
mov    %rbx,%rdi
mov    $0x9,%esi
call   10a0 <uart_putf@plt>
xor    %eax,%eax
call   10b0 <config_ddr_phy_x@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   10a0 <uart_putf@plt>
xor    %eax,%eax
call   1070 <set_sdram_timings_x@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   10a0 <uart_putf@plt>
xor    %eax,%eax
call   1060 <config_sdram_x@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
pop    %rbx
jmp    10a0 <uart_putf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"DEBUG%i\0A\00"
define void @config_ddr_x() {
%1 = call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = call i32 (...) @enable_emif_clocks_x()
%3 = call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = call i32 (...) @ddr_pll_config_x()
%5 = call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 3)
%6 = call i32 (...) @config_vtp_x()
%7 = call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 4)
%8 = call i32 (...) @config_cmd_ctrl_x()
%9 = call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 5)
%10 = call i32 (...) @config_ddr_data_x_0()
%11 = call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 6)
%12 = call i32 (...) @config_ddr_data_x_1()
%13 = call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 7)
%14 = call i32 (...) @config_io_ctrl_x()
%15 = call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
store i64 1, i64* inttoptr (i64 1155601180 to i64*)
%16 = call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 9)
%17 = call i32 (...) @config_ddr_phy_x()
%18 = call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 10)
%19 = call i32 (...) @set_sdram_timings_x()
%20 = call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 11)
%21 = call i32 (...) @config_sdram_x()
%22 = call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 12)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"DEBUG%i\0A\00"
define void @config_ddr_x() {
%1 = tail call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 (...) @enable_emif_clocks_x()
%3 = tail call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = tail call i32 (...) @ddr_pll_config_x()
%5 = tail call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 3)
%6 = tail call i32 (...) @config_vtp_x()
%7 = tail call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 4)
%8 = tail call i32 (...) @config_cmd_ctrl_x()
%9 = tail call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 5)
%10 = tail call i32 (...) @config_ddr_data_x_0()
%11 = tail call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 6)
%12 = tail call i32 (...) @config_ddr_data_x_1()
%13 = tail call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 7)
%14 = tail call i32 (...) @config_io_ctrl_x()
%15 = tail call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
store i64 1, i64* inttoptr (i64 1155601180 to i64*)
%16 = tail call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 9)
%17 = tail call i32 (...) @config_ddr_phy_x()
%18 = tail call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 10)
%19 = tail call i32 (...) @set_sdram_timings_x()
%20 = tail call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 11)
%21 = tail call i32 (...) @config_sdram_x()
%22 = tail call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 12)
ret void
}