#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 int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ check(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ dbg_wb_read32(int, int *);
int /*<<< orphan*/ dbg_wb_write32(int, int);
int /*<<< orphan*/ printf(char *, ...);
void init_mc(void) {
  uint32_t insn;
  printf("Initialize Memory Controller (SDRAM)\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",
        152, (dbg_wb_write32(0x93000000 + 0x00, 0xf0000000 & 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",
        153, (dbg_wb_write32(0x93000000 + 0x04, 0xf0000000 & 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",
        154, (dbg_wb_write32(0x93000000 + 0x30, 0x00011009)));
  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",
        155, (dbg_wb_write32(0x93000000 + 0x34, 0x01002009)));
  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",
        156, (dbg_wb_write32(0x93000000 + 0xe8, 0x40000000)));
  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",
        157, (dbg_wb_write32(0x93000000 + 0x80, 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",
        158, (dbg_wb_write32(0x93000000 + 0x84, (~(0x400 - 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",
        159, (dbg_wb_write32(0x93000000 + 0xa0, 0x00bf0005)));
  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",
        160, (dbg_wb_write32(0x93000000 + 0xb0, 0x00000006)));
  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",
        161, (dbg_wb_write32(0x93000000 + 0xc8, 0x00000002)));
  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",
        162, (dbg_wb_write32(0x93000000 + 0xb4, 0x00000006)));
  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",
        163, (dbg_wb_write32(0x93000000 + 0xc4, 0x00000006)));
  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",
        164, (dbg_wb_write32(0x93000000 + 0xbc, 0x00000001)));
  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",
        165, (dbg_wb_write32(0x93000000 + 0xb8, 0x00000000)));
  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",
        166, (dbg_wb_write32(0x93000000 + 0xcc, 0x000000C0)));
  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",
        167, (dbg_wb_write32(0x93000000 + 0xe8, 0x5e000000)));
  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",
        168, (dbg_wb_write32(0x93000000 + 0xe4, 0x5e000000)));
  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",
        169, (dbg_wb_write32(0x93000000 + 0xe8, 0x6e000000)));
  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",
        170, (dbg_wb_write32(0x93000000 + 0xe4, 0x6e000000)));
  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",
        171, (dbg_wb_write32(0x93000000 + 0xe4, 0x6e000000)));
  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",
        172, (dbg_wb_write32(0x93000000 + 0xe4, 0x6e000000)));
  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",
        173, (dbg_wb_write32(0x93000000 + 0xe4, 0x6e000000)));
  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",
        174, (dbg_wb_write32(0x93000000 + 0xe4, 0x6e000000)));
  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",
        175, (dbg_wb_write32(0x93000000 + 0xe4, 0x6e000000)));
  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",
        176, (dbg_wb_write32(0x93000000 + 0xe4, 0x6e000000)));
  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",
        177, (dbg_wb_write32(0x93000000 + 0xe4, 0x6e000000)));
  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",
        178, (dbg_wb_write32(0x93000000 + 0xe8, 0x7e000033)));
  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",
        179, (dbg_wb_write32(0x93000000 + 0xe4, 0x7e000033)));
  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",
        180, (dbg_wb_write32(0x93000000 + 0xa0, 0xc0bf0005)));
  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",
        182, (dbg_wb_read32(0x93000000 + 0xa0, &insn)));
  printf("expected %x, read %x\n", 0xc0bf0005, insn);
}


x86 assembly (clang, -O0):
<init_mc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x93000000,%edi
mov    $0xf0000000,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xeb8(%rip),%rdi
mov    $0x98,%esi
call   1060 <check@plt>
mov    $0x93000004,%edi
mov    $0xf0000000,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xe96(%rip),%rdi
mov    $0x99,%esi
call   1060 <check@plt>
mov    $0x93000030,%edi
mov    $0x11009,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xe74(%rip),%rdi
mov    $0x9a,%esi
call   1060 <check@plt>
mov    $0x93000034,%edi
mov    $0x1002009,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xe52(%rip),%rdi
mov    $0x9b,%esi
call   1060 <check@plt>
mov    $0x930000e8,%edi
mov    $0x40000000,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xe30(%rip),%rdi
mov    $0x9c,%esi
call   1060 <check@plt>
mov    $0x93000080,%edi
xor    %esi,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xe11(%rip),%rdi
mov    $0x9d,%esi
call   1060 <check@plt>
mov    $0x93000084,%edi
mov    $0xffff0000,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xdef(%rip),%rdi
mov    $0x9e,%esi
call   1060 <check@plt>
mov    $0x930000a0,%edi
mov    $0xbf0005,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xdcd(%rip),%rdi
mov    $0x9f,%esi
call   1060 <check@plt>
mov    $0x930000b0,%edi
mov    $0x6,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xdab(%rip),%rdi
mov    $0xa0,%esi
call   1060 <check@plt>
mov    $0x930000c8,%edi
mov    $0x2,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xd89(%rip),%rdi
mov    $0xa1,%esi
call   1060 <check@plt>
mov    $0x930000b4,%edi
mov    $0x6,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xd67(%rip),%rdi
mov    $0xa2,%esi
call   1060 <check@plt>
mov    $0x930000c4,%edi
mov    $0x6,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xd45(%rip),%rdi
mov    $0xa3,%esi
call   1060 <check@plt>
mov    $0x930000bc,%edi
mov    $0x1,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xd23(%rip),%rdi
mov    $0xa4,%esi
call   1060 <check@plt>
mov    $0x930000b8,%edi
xor    %esi,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xd04(%rip),%rdi
mov    $0xa5,%esi
call   1060 <check@plt>
mov    $0x930000cc,%edi
mov    $0xc0,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xce2(%rip),%rdi
mov    $0xa6,%esi
call   1060 <check@plt>
mov    $0x930000e8,%edi
mov    $0x5e000000,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xcc0(%rip),%rdi
mov    $0xa7,%esi
call   1060 <check@plt>
mov    $0x930000e4,%edi
mov    $0x5e000000,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xc9e(%rip),%rdi
mov    $0xa8,%esi
call   1060 <check@plt>
mov    $0x930000e8,%edi
mov    $0x6e000000,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xc7c(%rip),%rdi
mov    $0xa9,%esi
call   1060 <check@plt>
mov    $0x930000e4,%edi
mov    $0x6e000000,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xc5a(%rip),%rdi
mov    $0xaa,%esi
call   1060 <check@plt>
mov    $0x930000e4,%edi
mov    $0x6e000000,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xc38(%rip),%rdi
mov    $0xab,%esi
call   1060 <check@plt>
mov    $0x930000e4,%edi
mov    $0x6e000000,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xc16(%rip),%rdi
mov    $0xac,%esi
call   1060 <check@plt>
mov    $0x930000e4,%edi
mov    $0x6e000000,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xbf4(%rip),%rdi
mov    $0xad,%esi
call   1060 <check@plt>
mov    $0x930000e4,%edi
mov    $0x6e000000,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xbd2(%rip),%rdi
mov    $0xae,%esi
call   1060 <check@plt>
mov    $0x930000e4,%edi
mov    $0x6e000000,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xbb0(%rip),%rdi
mov    $0xaf,%esi
call   1060 <check@plt>
mov    $0x930000e4,%edi
mov    $0x6e000000,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xb8e(%rip),%rdi
mov    $0xb0,%esi
call   1060 <check@plt>
mov    $0x930000e4,%edi
mov    $0x6e000000,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xb6c(%rip),%rdi
mov    $0xb1,%esi
call   1060 <check@plt>
mov    $0x930000e8,%edi
mov    $0x7e000033,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xb4a(%rip),%rdi
mov    $0xb2,%esi
call   1060 <check@plt>
mov    $0x930000e4,%edi
mov    $0x7e000033,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xb28(%rip),%rdi
mov    $0xb3,%esi
call   1060 <check@plt>
mov    $0x930000a0,%edi
mov    $0xc0bf0005,%esi
call   1050 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xb06(%rip),%rdi
mov    $0xb4,%esi
call   1060 <check@plt>
mov    $0x930000a0,%edi
lea    -0x4(%rbp),%rsi
call   1030 <dbg_wb_read32@plt>
mov    %eax,%edx
lea    0xae5(%rip),%rdi
mov    $0xb6,%esi
call   1060 <check@plt>
mov    -0x4(%rbp),%edx
lea    0xb92(%rip),%rdi
mov    $0xc0bf0005,%esi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_mc>:
push   %rbx
sub    $0x10,%rsp
lea    0xf7b(%rip),%rdi
call   1030 <puts@plt>
mov    $0x93000000,%edi
mov    $0xf0000000,%esi
call   1060 <dbg_wb_write32@plt>
lea    0xe89(%rip),%rbx
mov    %rbx,%rdi
mov    $0x98,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x93000004,%edi
mov    $0xf0000000,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0x99,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x93000030,%edi
mov    $0x11009,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0x9a,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x93000034,%edi
mov    $0x1002009,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0x9b,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000e8,%edi
mov    $0x40000000,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0x9c,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x93000080,%edi
xor    %esi,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0x9d,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x93000084,%edi
mov    $0xffff0000,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0x9e,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000a0,%edi
mov    $0xbf0005,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0x9f,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000b0,%edi
mov    $0x6,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xa0,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000c8,%edi
mov    $0x2,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xa1,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000b4,%edi
mov    $0x6,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xa2,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000c4,%edi
mov    $0x6,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xa3,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000bc,%edi
mov    $0x1,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xa4,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000b8,%edi
xor    %esi,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xa5,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000cc,%edi
mov    $0xc0,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xa6,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000e8,%edi
mov    $0x5e000000,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xa7,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000e4,%edi
mov    $0x5e000000,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xa8,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000e8,%edi
mov    $0x6e000000,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xa9,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000e4,%edi
mov    $0x6e000000,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xaa,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000e4,%edi
mov    $0x6e000000,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xab,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000e4,%edi
mov    $0x6e000000,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xac,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000e4,%edi
mov    $0x6e000000,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xad,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000e4,%edi
mov    $0x6e000000,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xae,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000e4,%edi
mov    $0x6e000000,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xaf,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000e4,%edi
mov    $0x6e000000,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xb0,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000e4,%edi
mov    $0x6e000000,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xb1,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000e8,%edi
mov    $0x7e000033,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xb2,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000e4,%edi
mov    $0x7e000033,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xb3,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    $0x930000a0,%edi
mov    $0xc0bf0005,%esi
call   1060 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xb4,%esi
mov    %eax,%edx
call   1070 <check@plt>
lea    0xc(%rsp),%rsi
mov    $0x930000a0,%edi
call   1040 <dbg_wb_read32@plt>
mov    %rbx,%rdi
mov    $0xb6,%esi
mov    %eax,%edx
call   1070 <check@plt>
mov    0xc(%rsp),%edx
lea    0xbd0(%rip),%rdi
mov    $0xc0bf0005,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Initialize Memory Controller (SDRAM)\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"
@.str.2 = [22 x i8] c"expected %x, read %x\0A\00"
define void @init_mc() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @dbg_wb_write32(i32 -1828716544, i32 -268435456)
%4 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 152, i32 %3)
%5 = call i32 @dbg_wb_write32(i32 -1828716540, i32 -268435456)
%6 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 153, i32 %5)
%7 = call i32 @dbg_wb_write32(i32 -1828716496, i32 69641)
%8 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 154, i32 %7)
%9 = call i32 @dbg_wb_write32(i32 -1828716492, i32 16785417)
%10 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 155, i32 %9)
%11 = call i32 @dbg_wb_write32(i32 -1828716312, i32 1073741824)
%12 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 156, i32 %11)
%13 = call i32 @dbg_wb_write32(i32 -1828716416, i32 0)
%14 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 157, i32 %13)
%15 = call i32 @dbg_wb_write32(i32 -1828716412, i32 -65536)
%16 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 158, i32 %15)
%17 = call i32 @dbg_wb_write32(i32 -1828716384, i32 12517381)
%18 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 159, i32 %17)
%19 = call i32 @dbg_wb_write32(i32 -1828716368, i32 6)
%20 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 160, i32 %19)
%21 = call i32 @dbg_wb_write32(i32 -1828716344, i32 2)
%22 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 161, i32 %21)
%23 = call i32 @dbg_wb_write32(i32 -1828716364, i32 6)
%24 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 162, i32 %23)
%25 = call i32 @dbg_wb_write32(i32 -1828716348, i32 6)
%26 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 163, i32 %25)
%27 = call i32 @dbg_wb_write32(i32 -1828716356, i32 1)
%28 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 164, i32 %27)
%29 = call i32 @dbg_wb_write32(i32 -1828716360, i32 0)
%30 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 165, i32 %29)
%31 = call i32 @dbg_wb_write32(i32 -1828716340, i32 192)
%32 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 166, i32 %31)
%33 = call i32 @dbg_wb_write32(i32 -1828716312, i32 1577058304)
%34 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 167, i32 %33)
%35 = call i32 @dbg_wb_write32(i32 -1828716316, i32 1577058304)
%36 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 168, i32 %35)
%37 = call i32 @dbg_wb_write32(i32 -1828716312, i32 1845493760)
%38 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 169, i32 %37)
%39 = call i32 @dbg_wb_write32(i32 -1828716316, i32 1845493760)
%40 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 170, i32 %39)
%41 = call i32 @dbg_wb_write32(i32 -1828716316, i32 1845493760)
%42 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 171, i32 %41)
%43 = call i32 @dbg_wb_write32(i32 -1828716316, i32 1845493760)
%44 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 172, i32 %43)
%45 = call i32 @dbg_wb_write32(i32 -1828716316, i32 1845493760)
%46 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 173, i32 %45)
%47 = call i32 @dbg_wb_write32(i32 -1828716316, i32 1845493760)
%48 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 174, i32 %47)
%49 = call i32 @dbg_wb_write32(i32 -1828716316, i32 1845493760)
%50 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 175, i32 %49)
%51 = call i32 @dbg_wb_write32(i32 -1828716316, i32 1845493760)
%52 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 176, i32 %51)
%53 = call i32 @dbg_wb_write32(i32 -1828716316, i32 1845493760)
%54 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 177, i32 %53)
%55 = call i32 @dbg_wb_write32(i32 -1828716312, i32 2113929267)
%56 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 178, i32 %55)
%57 = call i32 @dbg_wb_write32(i32 -1828716316, i32 2113929267)
%58 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 179, i32 %57)
%59 = call i32 @dbg_wb_write32(i32 -1828716384, i32 -1061224443)
%60 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 180, i32 %59)
%61 = call i32 @dbg_wb_read32(i32 -1828716384, i32* %1)
%62 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 182, i32 %61)
%63 = load i32, i32* %1
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 -1061224443, i32 %63)
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.2 = [22 x i8] c"expected %x, read %x\0A\00"
@str = [37 x i8] c"Initialize Memory Controller (SDRAM)\00"
define void @init_mc() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @dbg_wb_write32(i32 -1828716544, i32 -268435456)
%5 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 152, i32 %4)
%6 = tail call i32 @dbg_wb_write32(i32 -1828716540, i32 -268435456)
%7 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 153, i32 %6)
%8 = tail call i32 @dbg_wb_write32(i32 -1828716496, i32 69641)
%9 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 154, i32 %8)
%10 = tail call i32 @dbg_wb_write32(i32 -1828716492, i32 16785417)
%11 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 155, i32 %10)
%12 = tail call i32 @dbg_wb_write32(i32 -1828716312, i32 1073741824)
%13 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 156, i32 %12)
%14 = tail call i32 @dbg_wb_write32(i32 -1828716416, i32 0)
%15 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 157, i32 %14)
%16 = tail call i32 @dbg_wb_write32(i32 -1828716412, i32 -65536)
%17 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 158, i32 %16)
%18 = tail call i32 @dbg_wb_write32(i32 -1828716384, i32 12517381)
%19 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 159, i32 %18)
%20 = tail call i32 @dbg_wb_write32(i32 -1828716368, i32 6)
%21 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 160, i32 %20)
%22 = tail call i32 @dbg_wb_write32(i32 -1828716344, i32 2)
%23 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 161, i32 %22)
%24 = tail call i32 @dbg_wb_write32(i32 -1828716364, i32 6)
%25 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 162, i32 %24)
%26 = tail call i32 @dbg_wb_write32(i32 -1828716348, i32 6)
%27 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 163, i32 %26)
%28 = tail call i32 @dbg_wb_write32(i32 -1828716356, i32 1)
%29 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 164, i32 %28)
%30 = tail call i32 @dbg_wb_write32(i32 -1828716360, i32 0)
%31 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 165, i32 %30)
%32 = tail call i32 @dbg_wb_write32(i32 -1828716340, i32 192)
%33 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 166, i32 %32)
%34 = tail call i32 @dbg_wb_write32(i32 -1828716312, i32 1577058304)
%35 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 167, i32 %34)
%36 = tail call i32 @dbg_wb_write32(i32 -1828716316, i32 1577058304)
%37 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 168, i32 %36)
%38 = tail call i32 @dbg_wb_write32(i32 -1828716312, i32 1845493760)
%39 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 169, i32 %38)
%40 = tail call i32 @dbg_wb_write32(i32 -1828716316, i32 1845493760)
%41 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 170, i32 %40)
%42 = tail call i32 @dbg_wb_write32(i32 -1828716316, i32 1845493760)
%43 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 171, i32 %42)
%44 = tail call i32 @dbg_wb_write32(i32 -1828716316, i32 1845493760)
%45 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 172, i32 %44)
%46 = tail call i32 @dbg_wb_write32(i32 -1828716316, i32 1845493760)
%47 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 173, i32 %46)
%48 = tail call i32 @dbg_wb_write32(i32 -1828716316, i32 1845493760)
%49 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 174, i32 %48)
%50 = tail call i32 @dbg_wb_write32(i32 -1828716316, i32 1845493760)
%51 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 175, i32 %50)
%52 = tail call i32 @dbg_wb_write32(i32 -1828716316, i32 1845493760)
%53 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 176, i32 %52)
%54 = tail call i32 @dbg_wb_write32(i32 -1828716316, i32 1845493760)
%55 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 177, i32 %54)
%56 = tail call i32 @dbg_wb_write32(i32 -1828716312, i32 2113929267)
%57 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 178, i32 %56)
%58 = tail call i32 @dbg_wb_write32(i32 -1828716316, i32 2113929267)
%59 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 179, i32 %58)
%60 = tail call i32 @dbg_wb_write32(i32 -1828716384, i32 -1061224443)
%61 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 180, i32 %60)
%62 = call i32 @dbg_wb_read32(i32 -1828716384, i32* %1)
%63 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 182, i32 %62)
%64 = load i32, i32* %1
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 -1061224443, i32 %64)
ret void
}