#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_4712(void) {
  printf("Configuring SDRAM... ");
  ejtag_dma_write(0x18006f98, 0x00030001);
  ejtag_dma_write(0x18006f98, 0x00030000);
  ejtag_dma_write(0x18006f98, 0x00010000);
  ejtag_dma_write(0x18006004, 0x00048000);
  ejtag_dma_write(0x1800601c, 0x000754da);
  ejtag_dma_write(0x18006034, 0x23232323);
  ejtag_dma_write(0x18006038, 0x14500200);
  ejtag_dma_write(0x1800603c, 0x22021416);
  ejtag_dma_write(0x18006000, 0x00000002);
  ejtag_dma_write(0x18006000, 0x00000008);
  ejtag_dma_write(0x18006000, 0x00000004);
  ejtag_dma_write(0x18006000, 0x00000004);
  ejtag_dma_write(0x18006000, 0x00000004);
  ejtag_dma_write(0x18006000, 0x00000004);
  ejtag_dma_write(0x18006000, 0x00000004);
  ejtag_dma_write(0x18006000, 0x00000004);
  ejtag_dma_write(0x18006000, 0x00000004);
  ejtag_dma_write(0x18006000, 0x00000004);
  ejtag_dma_write(0x18006008, 0x0000840f);
  ejtag_dma_write(0x18006010, 0x00000032);
  ejtag_dma_write(0x18006000, 0x00000010);
  ejtag_dma_write(0x18006000, 0x00000001);
  printf("Done\n\n");
}


x86 assembly (clang, -O0):
<setup_memory_4712>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x18006f98,%edi
mov    $0x30001,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18006f98,%edi
mov    $0x30000,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18006f98,%edi
mov    $0x10000,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18006004,%edi
mov    $0x48000,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x1800601c,%edi
mov    $0x754da,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18006034,%edi
mov    $0x23232323,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18006038,%edi
mov    $0x14500200,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x1800603c,%edi
mov    $0x22021416,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x2,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x8,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x4,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x4,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x4,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x4,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x4,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x4,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x4,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x4,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18006008,%edi
mov    $0x840f,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18006010,%edi
mov    $0x32,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x10,%esi
call   1040 <ejtag_dma_write@plt>
mov    $0x18006000,%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_4712>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x18006f98,%edi
mov    $0x30001,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18006f98,%edi
mov    $0x30000,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18006f98,%edi
mov    $0x10000,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18006004,%edi
mov    $0x48000,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x1800601c,%edi
mov    $0x754da,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18006034,%edi
mov    $0x23232323,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18006038,%edi
mov    $0x14500200,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x1800603c,%edi
mov    $0x22021416,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x2,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x8,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x4,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x4,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x4,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x4,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x4,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x4,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x4,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x4,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18006008,%edi
mov    $0x840f,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18006010,%edi
mov    $0x32,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18006000,%edi
mov    $0x10,%esi
call   1050 <ejtag_dma_write@plt>
mov    $0x18006000,%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_4712() {
%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 402681752, i32 196609)
%3 = call i32 @ejtag_dma_write(i32 402681752, i32 196608)
%4 = call i32 @ejtag_dma_write(i32 402681752, i32 65536)
%5 = call i32 @ejtag_dma_write(i32 402677764, i32 294912)
%6 = call i32 @ejtag_dma_write(i32 402677788, i32 480474)
%7 = call i32 @ejtag_dma_write(i32 402677812, i32 589505315)
%8 = call i32 @ejtag_dma_write(i32 402677816, i32 340787712)
%9 = call i32 @ejtag_dma_write(i32 402677820, i32 570561558)
%10 = call i32 @ejtag_dma_write(i32 402677760, i32 2)
%11 = call i32 @ejtag_dma_write(i32 402677760, i32 8)
%12 = call i32 @ejtag_dma_write(i32 402677760, i32 4)
%13 = call i32 @ejtag_dma_write(i32 402677760, i32 4)
%14 = call i32 @ejtag_dma_write(i32 402677760, i32 4)
%15 = call i32 @ejtag_dma_write(i32 402677760, i32 4)
%16 = call i32 @ejtag_dma_write(i32 402677760, i32 4)
%17 = call i32 @ejtag_dma_write(i32 402677760, i32 4)
%18 = call i32 @ejtag_dma_write(i32 402677760, i32 4)
%19 = call i32 @ejtag_dma_write(i32 402677760, i32 4)
%20 = call i32 @ejtag_dma_write(i32 402677768, i32 33807)
%21 = call i32 @ejtag_dma_write(i32 402677776, i32 50)
%22 = call i32 @ejtag_dma_write(i32 402677760, i32 16)
%23 = call i32 @ejtag_dma_write(i32 402677760, 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_4712() {
%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 402681752, i32 196609)
%3 = tail call i32 @ejtag_dma_write(i32 402681752, i32 196608)
%4 = tail call i32 @ejtag_dma_write(i32 402681752, i32 65536)
%5 = tail call i32 @ejtag_dma_write(i32 402677764, i32 294912)
%6 = tail call i32 @ejtag_dma_write(i32 402677788, i32 480474)
%7 = tail call i32 @ejtag_dma_write(i32 402677812, i32 589505315)
%8 = tail call i32 @ejtag_dma_write(i32 402677816, i32 340787712)
%9 = tail call i32 @ejtag_dma_write(i32 402677820, i32 570561558)
%10 = tail call i32 @ejtag_dma_write(i32 402677760, i32 2)
%11 = tail call i32 @ejtag_dma_write(i32 402677760, i32 8)
%12 = tail call i32 @ejtag_dma_write(i32 402677760, i32 4)
%13 = tail call i32 @ejtag_dma_write(i32 402677760, i32 4)
%14 = tail call i32 @ejtag_dma_write(i32 402677760, i32 4)
%15 = tail call i32 @ejtag_dma_write(i32 402677760, i32 4)
%16 = tail call i32 @ejtag_dma_write(i32 402677760, i32 4)
%17 = tail call i32 @ejtag_dma_write(i32 402677760, i32 4)
%18 = tail call i32 @ejtag_dma_write(i32 402677760, i32 4)
%19 = tail call i32 @ejtag_dma_write(i32 402677760, i32 4)
%20 = tail call i32 @ejtag_dma_write(i32 402677768, i32 33807)
%21 = tail call i32 @ejtag_dma_write(i32 402677776, i32 50)
%22 = tail call i32 @ejtag_dma_write(i32 402677760, i32 16)
%23 = tail call i32 @ejtag_dma_write(i32 402677760, 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
}