#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*/ ejtag_dma_write(int, int);
int /*<<< orphan*/ printf(char *);
void setup_memory_5352(void) {
  printf("Configuring SDRAM... ");
  ejtag_dma_write(0x18004f98, 0x00030001);
  ejtag_dma_write(0x18004f98, 0x00030000);
  ejtag_dma_write(0x18004f98, 0x00010000);
  ejtag_dma_write(0x18004004, 0x0004810b);
  ejtag_dma_write(0x1800401c, 0x000754d9);
  ejtag_dma_write(0x18004034, 0x23232323);
  ejtag_dma_write(0x18004038, 0x14500200);
  ejtag_dma_write(0x1800403c, 0x21021400);
  ejtag_dma_write(0x18004000, 0x00000002);
  ejtag_dma_write(0x18004000, 0x00000008);
  ejtag_dma_write(0x18004000, 0x00000004);
  ejtag_dma_write(0x18004000, 0x00000004);
  ejtag_dma_write(0x18004000, 0x00000004);
  ejtag_dma_write(0x18004000, 0x00000004);
  ejtag_dma_write(0x18004000, 0x00000004);
  ejtag_dma_write(0x18004000, 0x00000004);
  ejtag_dma_write(0x18004000, 0x00000004);
  ejtag_dma_write(0x18004000, 0x00000004);
  ejtag_dma_write(0x18004008, 0x0000840f);
  ejtag_dma_write(0x18004010, 0x00000062);
  ejtag_dma_write(0x18004000, 0x00000010);
  ejtag_dma_write(0x18004000, 0x00000001);
  printf("Done\n\n");
}


x86 assembly (clang, -O0):
<setup_memory_5352>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x18004f98,%edi
mov    $0x30001,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18004f98,%edi
mov    $0x30000,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18004f98,%edi
mov    $0x10000,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18004004,%edi
mov    $0x4810b,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x1800401c,%edi
mov    $0x754d9,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18004034,%edi
mov    $0x23232323,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18004038,%edi
mov    $0x14500200,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x1800403c,%edi
mov    $0x21021400,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x2,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x8,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x4,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x4,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x4,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x4,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x4,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x4,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x4,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x4,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18004008,%edi
mov    $0x840f,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18004010,%edi
mov    $0x62,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x10,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x1,%esi
call   1040 <ejtag_dma_write@plt>
lea    0xd95(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_memory_5352>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x18004f98,%edi
mov    $0x30001,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18004f98,%edi
mov    $0x30000,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18004f98,%edi
mov    $0x10000,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18004004,%edi
mov    $0x4810b,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x1800401c,%edi
mov    $0x754d9,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18004034,%edi
mov    $0x23232323,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18004038,%edi
mov    $0x14500200,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x1800403c,%edi
mov    $0x21021400,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x2,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x8,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x4,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x4,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x4,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x4,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x4,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x4,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x4,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x4,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18004008,%edi
mov    $0x840f,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18004010,%edi
mov    $0x62,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x10,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18004000,%edi
mov    $0x1,%esi
call   1050 <ejtag_dma_write@plt>
lea    0xd88(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Configuring SDRAM... \00"
@.str.1 = [7 x i8] c"Done\0A\0A\00"
define void @setup_memory_5352() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @ejtag_dma_write(i32 402673560, i32 196609)
%3 = call i32 @ejtag_dma_write(i32 402673560, i32 196608)
%4 = call i32 @ejtag_dma_write(i32 402673560, i32 65536)
%5 = call i32 @ejtag_dma_write(i32 402669572, i32 295179)
%6 = call i32 @ejtag_dma_write(i32 402669596, i32 480473)
%7 = call i32 @ejtag_dma_write(i32 402669620, i32 589505315)
%8 = call i32 @ejtag_dma_write(i32 402669624, i32 340787712)
%9 = call i32 @ejtag_dma_write(i32 402669628, i32 553784320)
%10 = call i32 @ejtag_dma_write(i32 402669568, i32 2)
%11 = call i32 @ejtag_dma_write(i32 402669568, i32 8)
%12 = call i32 @ejtag_dma_write(i32 402669568, i32 4)
%13 = call i32 @ejtag_dma_write(i32 402669568, i32 4)
%14 = call i32 @ejtag_dma_write(i32 402669568, i32 4)
%15 = call i32 @ejtag_dma_write(i32 402669568, i32 4)
%16 = call i32 @ejtag_dma_write(i32 402669568, i32 4)
%17 = call i32 @ejtag_dma_write(i32 402669568, i32 4)
%18 = call i32 @ejtag_dma_write(i32 402669568, i32 4)
%19 = call i32 @ejtag_dma_write(i32 402669568, i32 4)
%20 = call i32 @ejtag_dma_write(i32 402669576, i32 33807)
%21 = call i32 @ejtag_dma_write(i32 402669584, i32 98)
%22 = call i32 @ejtag_dma_write(i32 402669568, i32 16)
%23 = call i32 @ejtag_dma_write(i32 402669568, i32 1)
%24 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Configuring SDRAM... \00"
@str = [6 x i8] c"Done\0A\00"
define void @setup_memory_5352() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ejtag_dma_write(i32 402673560, i32 196609)
%3 = tail call i32 @ejtag_dma_write(i32 402673560, i32 196608)
%4 = tail call i32 @ejtag_dma_write(i32 402673560, i32 65536)
%5 = tail call i32 @ejtag_dma_write(i32 402669572, i32 295179)
%6 = tail call i32 @ejtag_dma_write(i32 402669596, i32 480473)
%7 = tail call i32 @ejtag_dma_write(i32 402669620, i32 589505315)
%8 = tail call i32 @ejtag_dma_write(i32 402669624, i32 340787712)
%9 = tail call i32 @ejtag_dma_write(i32 402669628, i32 553784320)
%10 = tail call i32 @ejtag_dma_write(i32 402669568, i32 2)
%11 = tail call i32 @ejtag_dma_write(i32 402669568, i32 8)
%12 = tail call i32 @ejtag_dma_write(i32 402669568, i32 4)
%13 = tail call i32 @ejtag_dma_write(i32 402669568, i32 4)
%14 = tail call i32 @ejtag_dma_write(i32 402669568, i32 4)
%15 = tail call i32 @ejtag_dma_write(i32 402669568, i32 4)
%16 = tail call i32 @ejtag_dma_write(i32 402669568, i32 4)
%17 = tail call i32 @ejtag_dma_write(i32 402669568, i32 4)
%18 = tail call i32 @ejtag_dma_write(i32 402669568, i32 4)
%19 = tail call i32 @ejtag_dma_write(i32 402669568, i32 4)
%20 = tail call i32 @ejtag_dma_write(i32 402669576, i32 33807)
%21 = tail call i32 @ejtag_dma_write(i32 402669584, i32 98)
%22 = tail call i32 @ejtag_dma_write(i32 402669568, i32 16)
%23 = tail call i32 @ejtag_dma_write(i32 402669568, i32 1)
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}