#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*/ check(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ dbg_wb_write32(int, int);
int /*<<< orphan*/ printf(char *);
void init_sram(void) {
  printf("Initialize Memory Controller (SRAM)\n");
  check("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/csturton/wirepatch/refs/heads/master/ddr2/"
        "cores/adv_debug_sys/Software/adv_jtag_bridge/or32_selftest.c",
        191, (dbg_wb_write32(0x93000000 + 0x08, 0x00000000 & 0xffff0000)));
  check("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/csturton/wirepatch/refs/heads/master/ddr2/"
        "cores/adv_debug_sys/Software/adv_jtag_bridge/or32_selftest.c",
        192,
        (dbg_wb_write32(0x93000000 + 0x0c, ~(0x04000000 - 1) & 0xffff0000)));
  check("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/csturton/wirepatch/refs/heads/master/ddr2/"
        "cores/adv_debug_sys/Software/adv_jtag_bridge/or32_selftest.c",
        193, (dbg_wb_write32(0x93000000 + 0x24, 0xc020001f)));
}


x86 assembly (clang, -O0):
<init_sram>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x93000008,%edi
xor    %esi,%esi
call   1040 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xed0(%rip),%rdi
mov    $0xbf,%esi
call   1050 <check@plt>
mov    $0x9300000c,%edi
mov    $0xfc000000,%esi
call   1040 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xeae(%rip),%rdi
mov    $0xc0,%esi
call   1050 <check@plt>
mov    $0x93000024,%edi
mov    $0xc020001f,%esi
call   1040 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xe8c(%rip),%rdi
mov    $0xc1,%esi
call   1050 <check@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_sram>:
push   %rbx
lea    0xf89(%rip),%rdi
call   1030 <puts@plt>
mov    $0x93000008,%edi
xor    %esi,%esi
call   1040 <dbg_wb_write32@plt>
lea    0xeb0(%rip),%rbx
mov    %rbx,%rdi
mov    $0xbf,%esi
mov    %eax,%edx
call   1050 <check@plt>
mov    $0x9300000c,%edi
mov    $0xfc000000,%esi
call   1040 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xc0,%esi
mov    %eax,%edx
call   1050 <check@plt>
mov    $0x93000024,%edi
mov    $0xc020001f,%esi
call   1040 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xc1,%esi
mov    %eax,%edx
pop    %rbx
jmp    1050 <check@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Initialize Memory Controller (SRAM)\0A\00"
@.str.1 = [193 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/csturton/wirepatch/refs/heads/master/ddr2/cores/adv_debug_sys/Software/adv_jtag_bridge/or32_selftest.c\00"
define void @init_sram() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @dbg_wb_write32(i32 -1828716536, i32 0)
%3 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 191, i32 %2)
%4 = call i32 @dbg_wb_write32(i32 -1828716532, i32 -67108864)
%5 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 192, i32 %4)
%6 = call i32 @dbg_wb_write32(i32 -1828716508, i32 -1071644641)
%7 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 193, i32 %6)
ret void
}

LLVM IR (-O2):
@.str.1 = [193 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/csturton/wirepatch/refs/heads/master/ddr2/cores/adv_debug_sys/Software/adv_jtag_bridge/or32_selftest.c\00"
@str = [36 x i8] c"Initialize Memory Controller (SRAM)\00"
define void @init_sram() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @dbg_wb_write32(i32 -1828716536, i32 0)
%3 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 191, i32 %2)
%4 = tail call i32 @dbg_wb_write32(i32 -1828716532, i32 -67108864)
%5 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 192, i32 %4)
%6 = tail call i32 @dbg_wb_write32(i32 -1828716508, i32 -1071644641)
%7 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 193, i32 %6)
ret void
}