#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 uint8_t;
typedef unsigned long uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ check(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ dbg_wb_read32(int, unsigned long *);
int /*<<< orphan*/ dbg_wb_read_block16(int, int *, int);
int /*<<< orphan*/ dbg_wb_read_block32(int, unsigned long *, int);
int /*<<< orphan*/ dbg_wb_read_block8(int, int *, int);
int /*<<< orphan*/ dbg_wb_write32(int, unsigned long);
int /*<<< orphan*/ dbg_wb_write_block16(int, int *, int);
int /*<<< orphan*/ dbg_wb_write_block32(int, unsigned long *, int);
int /*<<< orphan*/ dbg_wb_write_block8(int, int *, int);
int /*<<< orphan*/ printf(char *, ...);
int test_sdram(void) {
  uint32_t insn;
  unsigned long i;
  uint32_t data4_out[0x08];
  uint32_t data4_in[0x08];
  uint16_t data2_out[0x10];
  uint16_t data2_in[0x10];
  uint8_t data1_out[0x20];
  uint8_t data1_in[0x20];
  printf("Start SDRAM WR\n");
  for (i = 0x10; i < (0x400 + 0x00000000); i = i << 1) {
    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",
          212, (dbg_wb_write32(0x00000000 + i, i)));
  }
  printf("Start SDRAM RD\n");
  for (i = 0x10; i < (0x400 + 0x00000000); i = i << 1) {
    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",
          217, (dbg_wb_read32(0x00000000 + i, &insn)));
    if (i != insn) {
      printf("SDRAM test FAIL\n");
      return 0x0800;
    }
  }
  printf("32-bit block write from %x to %x\n", 0x00000000, 0x00000000 + 0x20);
  for (i = 0; i < (0x20 / 4); i++) {
    data4_out[i] = data4_in[i] = ((4 * i + 3) << 24) | ((4 * i + 2) << 16) |
                                 ((4 * i + 1) << 8) | (4 * i);
  }
  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",
        232, (dbg_wb_write_block32(0x00000000, &data4_out[0], 0x20)));
  printf("32-bit block read from %x to %x\n", 0x00000000, 0x00000000 + 0x20);
  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",
        236, (dbg_wb_read_block32(0x00000000, &data4_out[0], 0x20)));
  for (i = 0; i < (0x20 / 4); i++) {
    if (data4_in[i] != data4_out[i]) {
      printf("SDRAM data differs. Expected: 0x%0x, read: 0x%0x\n", data4_in[i],
             data4_out[i]);
      return 0x0800;
    }
  }
  printf("16-bit block write from %x to %x\n", 0x00000000, 0x00000000 + 0x20);
  for (i = 0; i < (0x20 / 2); i++) {
    data2_out[i] = data2_in[i] = ((4 * i + 1) << 8) | (4 * i);
  }
  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",
        251, (dbg_wb_write_block16(0x00000000, &data2_out[0], 0x20)));
  printf("16-bit block read from %x to %x\n", 0x00000000, 0x00000000 + 0x20);
  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",
        255, (dbg_wb_read_block16(0x00000000, &data2_out[0], 0x20)));
  for (i = 0; i < (0x20 / 2); i++) {
    if (data2_in[i] != data2_out[i]) {
      printf("SDRAM data differs. Expected: 0x%0x, read: 0x%0x\n", data2_in[i],
             data2_out[i]);
      return 0x0800;
    }
  }
  printf("8-bit block write from %x to %x\n", 0x00000000, 0x00000000 + 0x20);
  for (i = 0; i < (0x20 / 1); i++) {
    data1_out[i] = data1_in[i] = (4 * i);
  }
  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",
        269, (dbg_wb_write_block8(0x00000000, &data1_out[0], 0x20)));
  printf("8-bit block read from %x to %x\n", 0x00000000, 0x00000000 + 0x20);
  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",
        273, (dbg_wb_read_block8(0x00000000, &data1_out[0], 0x20)));
  for (i = 0; i < (0x20 / 1); i++) {
    if (data1_in[i] != data1_out[i]) {
      printf("SDRAM data differs. Expected: 0x%0x, read: 0x%0x\n", data1_in[i],
             data1_out[i]);
      return 0x0800;
    }
  }
  printf("SDRAM OK!\n");
  return 0x0;
}


x86 assembly (clang, -O0):
<test_sdram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movq   $0x10,-0x18(%rbp)
cmpq   $0x400,-0x18(%rbp)
jae    1206 <test_sdram+0x66>
mov    -0x18(%rbp),%rax
add    $0x0,%rax
mov    %eax,%edi
mov    -0x18(%rbp),%rsi
call   1060 <dbg_wb_write32@plt>
mov    %eax,%edx
lea    0xe25(%rip),%rdi
mov    $0xd4,%esi
call   1090 <check@plt>
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    11c1 <test_sdram+0x21>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movq   $0x10,-0x18(%rbp)
cmpq   $0x400,-0x18(%rbp)
jae    128e <test_sdram+0xee>
mov    -0x18(%rbp),%rax
add    $0x0,%rax
mov    %eax,%edi
lea    -0x10(%rbp),%rsi
call   1030 <dbg_wb_read32@plt>
mov    %eax,%edx
lea    0xdca(%rip),%rdi
mov    $0xd9,%esi
call   1090 <check@plt>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1278 <test_sdram+0xd8>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x800,-0x4(%rbp)
jmp    1671 <test_sdram+0x4d1>
jmp    127d <test_sdram+0xdd>
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    121c <test_sdram+0x7c>
lea    0xe5d(%rip),%rdi
xor    %esi,%esi
mov    $0x20,%edx
mov    $0x0,%al
call   1050 <printf@plt>
movq   $0x0,-0x18(%rbp)
cmpq   $0x8,-0x18(%rbp)
jae    131d <test_sdram+0x17d>
mov    -0x18(%rbp),%rcx
shl    $0x2,%rcx
add    $0x3,%rcx
shl    $0x18,%rcx
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
add    $0x2,%rax
shl    $0x10,%rax
or     %rax,%rcx
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
add    $0x1,%rax
shl    $0x8,%rax
or     %rax,%rcx
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
or     %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,-0xa0(%rbp,%rax,8)
ff
mov    -0x18(%rbp),%rax
mov    %rcx,-0x60(%rbp,%rax,8)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    12ab <test_sdram+0x10b>
lea    -0x60(%rbp),%rsi
xor    %edi,%edi
mov    $0x20,%edx
call   10b0 <dbg_wb_write_block32@plt>
mov    %eax,%edx
lea    0xcda(%rip),%rdi
mov    $0xe8,%esi
call   1090 <check@plt>
lea    0xdcd(%rip),%rdi
xor    %esi,%esi
mov    $0x20,%edx
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x60(%rbp),%rsi
xor    %edi,%edi
mov    $0x20,%edx
call   1040 <dbg_wb_read_block32@plt>
mov    %eax,%edx
lea    0xca2(%rip),%rdi
mov    $0xec,%esi
call   1090 <check@plt>
movq   $0x0,-0x18(%rbp)
cmpq   $0x8,-0x18(%rbp)
jae    13eb <test_sdram+0x24b>
mov    -0x18(%rbp),%rax
mov    -0xa0(%rbp,%rax,8),%rax
ff
mov    -0x18(%rbp),%rcx
cmp    -0x60(%rbp,%rcx,8),%rax
je     13d5 <test_sdram+0x235>
mov    -0x18(%rbp),%rax
mov    -0xa0(%rbp,%rax,8),%rsi
ff
mov    -0x18(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rdx
lea    0xd73(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x800,-0x4(%rbp)
jmp    1671 <test_sdram+0x4d1>
jmp    13da <test_sdram+0x23a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1380 <test_sdram+0x1e0>
lea    0xd75(%rip),%rdi
xor    %esi,%esi
mov    $0x20,%edx
mov    $0x0,%al
call   1050 <printf@plt>
movq   $0x0,-0x18(%rbp)
cmpq   $0x10,-0x18(%rbp)
jae    1457 <test_sdram+0x2b7>
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
add    $0x1,%rax
shl    $0x8,%rax
mov    -0x18(%rbp),%rcx
shl    $0x2,%rcx
or     %rcx,%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,-0x120(%rbp,%rax,4)
mov    -0x18(%rbp),%rax
mov    %ecx,-0xe0(%rbp,%rax,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1408 <test_sdram+0x268>
lea    -0xe0(%rbp),%rsi
xor    %edi,%edi
mov    $0x20,%edx
call   10a0 <dbg_wb_write_block16@plt>
mov    %eax,%edx
lea    0xb9d(%rip),%rdi
mov    $0xfb,%esi
call   1090 <check@plt>
lea    0xd05(%rip),%rdi
xor    %esi,%esi
mov    $0x20,%edx
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xe0(%rbp),%rsi
xor    %edi,%edi
mov    $0x20,%edx
call   1080 <dbg_wb_read_block16@plt>
mov    %eax,%edx
lea    0xb62(%rip),%rdi
mov    $0xff,%esi
call   1090 <check@plt>
movq   $0x0,-0x18(%rbp)
cmpq   $0x10,-0x18(%rbp)
jae    152d <test_sdram+0x38d>
mov    -0x18(%rbp),%rax
mov    -0x120(%rbp,%rax,4),%eax
mov    -0x18(%rbp),%rcx
cmp    -0xe0(%rbp,%rcx,4),%eax
je     1517 <test_sdram+0x377>
mov    -0x18(%rbp),%rax
mov    -0x120(%rbp,%rax,4),%esi
mov    -0x18(%rbp),%rax
mov    -0xe0(%rbp,%rax,4),%edx
lea    0xc31(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x800,-0x4(%rbp)
jmp    1671 <test_sdram+0x4d1>
jmp    151c <test_sdram+0x37c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    14c0 <test_sdram+0x320>
lea    0xc76(%rip),%rdi
xor    %esi,%esi
mov    $0x20,%edx
mov    $0x0,%al
call   1050 <printf@plt>
movq   $0x0,-0x18(%rbp)
cmpq   $0x20,-0x18(%rbp)
jae    1586 <test_sdram+0x3e6>
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,-0x220(%rbp,%rax,4)
mov    -0x18(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    154a <test_sdram+0x3aa>
lea    -0x1a0(%rbp),%rsi
xor    %edi,%edi
mov    $0x20,%edx
call   10c0 <dbg_wb_write_block8@plt>
mov    %eax,%edx
lea    0xa6e(%rip),%rdi
mov    $0x10d,%esi
call   1090 <check@plt>
lea    0xc18(%rip),%rdi
xor    %esi,%esi
mov    $0x20,%edx
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x1a0(%rbp),%rsi
xor    %edi,%edi
mov    $0x20,%edx
call   1070 <dbg_wb_read_block8@plt>
mov    %eax,%edx
lea    0xa33(%rip),%rdi
mov    $0x111,%esi
call   1090 <check@plt>
movq   $0x0,-0x18(%rbp)
cmpq   $0x20,-0x18(%rbp)
jae    165c <test_sdram+0x4bc>
mov    -0x18(%rbp),%rax
mov    -0x220(%rbp,%rax,4),%eax
mov    -0x18(%rbp),%rcx
cmp    -0x1a0(%rbp,%rcx,4),%eax
je     1646 <test_sdram+0x4a6>
mov    -0x18(%rbp),%rax
mov    -0x220(%rbp,%rax,4),%esi
mov    -0x18(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%edx
lea    0xb02(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x800,-0x4(%rbp)
jmp    1671 <test_sdram+0x4d1>
jmp    164b <test_sdram+0x4ab>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    15ef <test_sdram+0x44f>
lea    0xb88(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sdram>:
push   %r15
push   %r14
push   %rbx
sub    $0x190,%rsp
lea    0x10f7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x10,%esi
mov    $0x10,%edi
call   1070 <dbg_wb_write32@plt>
lea    0xf22(%rip),%rbx
mov    %rbx,%rdi
mov    $0xd4,%esi
mov    %eax,%edx
call   10a0 <check@plt>
mov    $0x20,%esi
mov    $0x20,%edi
call   1070 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xd4,%esi
mov    %eax,%edx
call   10a0 <check@plt>
mov    $0x40,%esi
mov    $0x40,%edi
call   1070 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xd4,%esi
mov    %eax,%edx
call   10a0 <check@plt>
mov    $0x80,%esi
mov    $0x80,%edi
call   1070 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xd4,%esi
mov    %eax,%edx
call   10a0 <check@plt>
mov    $0x100,%esi
mov    $0x100,%edi
call   1070 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xd4,%esi
mov    %eax,%edx
call   10a0 <check@plt>
mov    $0x200,%esi
mov    $0x200,%edi
call   1070 <dbg_wb_write32@plt>
mov    %rbx,%rdi
mov    $0xd4,%esi
mov    %eax,%edx
call   10a0 <check@plt>
lea    0x103f(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    $0x10,%edi
call   1040 <dbg_wb_read32@plt>
mov    %rbx,%rdi
mov    $0xd9,%esi
mov    %eax,%edx
call   10a0 <check@plt>
cmpq   $0x10,0x8(%rsp)
jne    188e <test_sdram+0x6de>
lea    0x8(%rsp),%rsi
mov    $0x20,%edi
call   1040 <dbg_wb_read32@plt>
lea    0xe31(%rip),%rdi
mov    $0xd9,%esi
mov    %eax,%edx
call   10a0 <check@plt>
cmpq   $0x20,0x8(%rsp)
jne    188e <test_sdram+0x6de>
lea    0x8(%rsp),%rsi
mov    $0x40,%edi
call   1040 <dbg_wb_read32@plt>
lea    0xe03(%rip),%rdi
mov    $0xd9,%esi
mov    %eax,%edx
call   10a0 <check@plt>
cmpq   $0x40,0x8(%rsp)
jne    188e <test_sdram+0x6de>
lea    0x8(%rsp),%rsi
mov    $0x80,%edi
call   1040 <dbg_wb_read32@plt>
lea    0xdd5(%rip),%rdi
mov    $0xd9,%esi
mov    %eax,%edx
call   10a0 <check@plt>
cmpq   $0x80,0x8(%rsp)
jne    188e <test_sdram+0x6de>
lea    0x8(%rsp),%rsi
mov    $0x100,%edi
call   1040 <dbg_wb_read32@plt>
lea    0xda4(%rip),%rdi
mov    $0xd9,%esi
mov    %eax,%edx
call   10a0 <check@plt>
cmpq   $0x100,0x8(%rsp)
jne    188e <test_sdram+0x6de>
lea    0x8(%rsp),%rsi
mov    $0x200,%edi
call   1040 <dbg_wb_read32@plt>
lea    0xd73(%rip),%rdi
mov    $0xd9,%esi
mov    %eax,%edx
call   10a0 <check@plt>
cmpq   $0x200,0x8(%rsp)
jne    188e <test_sdram+0x6de>
lea    0xe12(%rip),%rdi
xor    %esi,%esi
mov    $0x20,%edx
xor    %eax,%eax
call   1060 <printf@plt>
movaps 0xc3c(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xc40(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xc44(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xc48(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
lea    0x50(%rsp),%r14
xor    %edi,%edi
mov    %r14,%rsi
mov    $0x20,%edx
call   10c0 <dbg_wb_write_block32@plt>
lea    0xcf5(%rip),%rbx
mov    %rbx,%rdi
mov    $0xe8,%esi
mov    %eax,%edx
call   10a0 <check@plt>
lea    0xdc2(%rip),%rdi
xor    %esi,%esi
mov    $0x20,%edx
xor    %eax,%eax
call   1060 <printf@plt>
xor    %edi,%edi
mov    %r14,%rsi
mov    $0x20,%edx
call   1050 <dbg_wb_read_block32@plt>
mov    %rbx,%rdi
mov    $0xec,%esi
mov    %eax,%edx
call   10a0 <check@plt>
mov    0x50(%rsp),%rdx
mov    $0x3020100,%esi
cmp    $0x3020100,%rdx
jne    18ac <test_sdram+0x6fc>
mov    0x58(%rsp),%rdx
mov    $0x7060504,%esi
cmp    $0x7060504,%rdx
jne    18ac <test_sdram+0x6fc>
mov    0x60(%rsp),%rdx
mov    $0xb0a0908,%esi
cmp    $0xb0a0908,%rdx
jne    18ac <test_sdram+0x6fc>
mov    0x68(%rsp),%rdx
mov    $0xf0e0d0c,%esi
cmp    $0xf0e0d0c,%rdx
jne    18ac <test_sdram+0x6fc>
mov    0x70(%rsp),%rdx
mov    $0x13121110,%esi
cmp    $0x13121110,%rdx
jne    18ac <test_sdram+0x6fc>
mov    0x78(%rsp),%rdx
mov    $0x17161514,%esi
cmp    $0x17161514,%rdx
jne    18ac <test_sdram+0x6fc>
mov    0x80(%rsp),%rdx
mov    $0x1b1a1918,%esi
cmp    $0x1b1a1918,%rdx
jne    18ac <test_sdram+0x6fc>
mov    0x88(%rsp),%rdx
mov    $0x1f1e1d1c,%esi
cmp    $0x1f1e1d1c,%rdx
jne    18ac <test_sdram+0x6fc>
lea    0xd24(%rip),%rdi
xor    %esi,%esi
mov    $0x20,%edx
xor    %eax,%eax
call   1060 <printf@plt>
movaps 0xb19(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xb1d(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xb21(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xb25(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
lea    0x10(%rsp),%r14
xor    %edi,%edi
mov    %r14,%rsi
mov    $0x20,%edx
call   10b0 <dbg_wb_write_block16@plt>
lea    0xb95(%rip),%rbx
mov    %rbx,%rdi
mov    $0xfb,%esi
mov    %eax,%edx
call   10a0 <check@plt>
lea    0xcd7(%rip),%rdi
xor    %esi,%esi
mov    $0x20,%edx
xor    %eax,%eax
call   1060 <printf@plt>
xor    %edi,%edi
mov    %r14,%rsi
mov    $0x20,%edx
call   1090 <dbg_wb_read_block16@plt>
mov    %rbx,%rdi
mov    $0xff,%esi
mov    %eax,%edx
call   10a0 <check@plt>
mov    0x10(%rsp),%edx
mov    $0x100,%esi
cmp    $0x100,%edx
jne    18bc <test_sdram+0x70c>
mov    0x14(%rsp),%edx
mov    $0x504,%esi
cmp    $0x504,%edx
jne    18bc <test_sdram+0x70c>
mov    0x18(%rsp),%edx
mov    $0x908,%esi
cmp    $0x908,%edx
jne    18bc <test_sdram+0x70c>
mov    0x1c(%rsp),%edx
mov    $0xd0c,%esi
cmp    $0xd0c,%edx
jne    18bc <test_sdram+0x70c>
mov    0x20(%rsp),%edx
mov    $0x1110,%esi
cmp    $0x1110,%edx
jne    18bc <test_sdram+0x70c>
mov    0x24(%rsp),%edx
mov    $0x1514,%esi
cmp    $0x1514,%edx
jne    18bc <test_sdram+0x70c>
mov    0x28(%rsp),%edx
mov    $0x1918,%esi
cmp    $0x1918,%edx
jne    18bc <test_sdram+0x70c>
mov    0x2c(%rsp),%edx
mov    $0x1d1c,%esi
cmp    $0x1d1c,%edx
jne    18bc <test_sdram+0x70c>
mov    0x30(%rsp),%edx
mov    $0x2120,%esi
cmp    $0x2120,%edx
jne    18bc <test_sdram+0x70c>
mov    0x34(%rsp),%edx
mov    $0x2524,%esi
cmp    $0x2524,%edx
jne    18bc <test_sdram+0x70c>
mov    0x38(%rsp),%edx
mov    $0x2928,%esi
cmp    $0x2928,%edx
jne    18bc <test_sdram+0x70c>
mov    0x3c(%rsp),%edx
mov    $0x2d2c,%esi
cmp    $0x2d2c,%edx
jne    18bc <test_sdram+0x70c>
mov    0x40(%rsp),%edx
mov    $0x3130,%esi
cmp    $0x3130,%edx
jne    18bc <test_sdram+0x70c>
mov    0x44(%rsp),%edx
mov    $0x3534,%esi
cmp    $0x3534,%edx
jne    18bc <test_sdram+0x70c>
mov    0x48(%rsp),%edx
mov    $0x3938,%esi
cmp    $0x3938,%edx
jne    18bc <test_sdram+0x70c>
mov    0x4c(%rsp),%edx
mov    $0x3d3c,%esi
cmp    $0x3d3c,%edx
jne    18bc <test_sdram+0x70c>
lea    0xb75(%rip),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0x20,%edx
xor    %eax,%eax
call   1060 <printf@plt>
movaps 0x965(%rip),%xmm0
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x90(%rsp)
movaps 0x95e(%rip),%xmm0
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps 0x957(%rip),%xmm0
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps 0x950(%rip),%xmm0
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps 0x949(%rip),%xmm0
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps 0x942(%rip),%xmm0
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps 0x93b(%rip),%xmm0
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps 0x934(%rip),%xmm0
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x100(%rsp)
lea    0x90(%rsp),%r14
xor    %edi,%edi
mov    %r14,%rsi
mov    $0x20,%edx
call   10d0 <dbg_wb_write_block8@plt>
lea    0x916(%rip),%r15
mov    %r15,%rdi
mov    $0x10d,%esi
mov    %eax,%edx
call   10a0 <check@plt>
lea    0xa9a(%rip),%rdi
xor    %esi,%esi
mov    $0x20,%edx
xor    %eax,%eax
call   1060 <printf@plt>
xor    %edi,%edi
mov    %r14,%rsi
mov    $0x20,%edx
call   1080 <dbg_wb_read_block8@plt>
mov    %r15,%rdi
mov    $0x111,%esi
mov    %eax,%edx
call   10a0 <check@plt>
mov    0x110(%rsp,%rbx,4),%esi
mov    0x90(%rsp,%rbx,4),%edx
cmp    %edx,%esi
jne    18bc <test_sdram+0x70c>
mov    0x114(%rsp,%rbx,4),%esi
mov    0x94(%rsp,%rbx,4),%edx
cmp    %edx,%esi
jne    18bc <test_sdram+0x70c>
mov    0x118(%rsp,%rbx,4),%esi
mov    0x98(%rsp,%rbx,4),%edx
cmp    %edx,%esi
jne    18bc <test_sdram+0x70c>
mov    0x11c(%rsp,%rbx,4),%esi
mov    0x9c(%rsp,%rbx,4),%edx
cmp    %edx,%esi
jne    18bc <test_sdram+0x70c>
add    $0x4,%rbx
cmp    $0x20,%rbx
jne    182c <test_sdram+0x67c>
lea    0xa53(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
jmp    189f <test_sdram+0x6ef>
lea    0xa4d(%rip),%rdi
call   1030 <puts@plt>
mov    $0x800,%eax
add    $0x190,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0x951(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    189a <test_sdram+0x6ea>
lea    0x941(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    189a <test_sdram+0x6ea>

LLVM IR (-O0):
@.str = [16 x i8] c"Start SDRAM WR\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 = [16 x i8] c"Start SDRAM RD\0A\00"
@.str.3 = [17 x i8] c"SDRAM test FAIL\0A\00"
@.str.4 = [34 x i8] c"32-bit block write from %x to %x\0A\00"
@.str.5 = [33 x i8] c"32-bit block read from %x to %x\0A\00"
@.str.6 = [50 x i8] c"SDRAM data differs. Expected: 0x%0x, read: 0x%0x\0A\00"
@.str.7 = [34 x i8] c"16-bit block write from %x to %x\0A\00"
@.str.8 = [33 x i8] c"16-bit block read from %x to %x\0A\00"
@.str.9 = [33 x i8] c"8-bit block write from %x to %x\0A\00"
@.str.10 = [32 x i8] c"8-bit block read from %x to %x\0A\00"
@.str.11 = [11 x i8] c"SDRAM OK!\0A\00"
define i32 @test_sdram() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca [8 x i64]
%5 = alloca [8 x i64]
%6 = alloca [16 x i32]
%7 = alloca [16 x i32]
%8 = alloca [32 x i32]
%9 = alloca [32 x i32]
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i64 16, i64* %3
br label %11
11: ; preds = %21, %0
%12 = load i64, i64* %3
%13 = icmp ult i64 %12, 1024
br i1 %13, label %14, label %24
14: ; preds = %11
%15 = load i64, i64* %3
%16 = add i64 0, %15
%17 = trunc i64 %16 to i32
%18 = load i64, i64* %3
%19 = call i32 @dbg_wb_write32(i32 %17, i64 %18)
%20 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 212, i32 %19)
br label %21
21: ; preds = %14
%22 = load i64, i64* %3
%23 = shl i64 %22, 1
store i64 %23, i64* %3
br label %11
24: ; preds = %11
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
store i64 16, i64* %3
br label %26
26: ; preds = %41, %24
%27 = load i64, i64* %3
%28 = icmp ult i64 %27, 1024
br i1 %28, label %29, label %44
29: ; preds = %26
%30 = load i64, i64* %3
%31 = add i64 0, %30
%32 = trunc i64 %31 to i32
%33 = call i32 @dbg_wb_read32(i32 %32, i64* %2)
%34 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 217, i32 %33)
%35 = load i64, i64* %3
%36 = load i64, i64* %2
%37 = icmp ne i64 %35, %36
br i1 %37, label %38, label %40
38: ; preds = %29
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
store i32 2048, i32* %1
br label %206
40: ; preds = %29
br label %41
41: ; preds = %40
%42 = load i64, i64* %3
%43 = shl i64 %42, 1
store i64 %43, i64* %3
br label %26
44: ; preds = %26
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i32 0, i32 32)
store i64 0, i64* %3
br label %46
46: ; preds = %71, %44
%47 = load i64, i64* %3
%48 = icmp ult i64 %47, 8
br i1 %48, label %49, label %74
49: ; preds = %46
%50 = load i64, i64* %3
%51 = mul i64 4, %50
%52 = add i64 %51, 3
%53 = shl i64 %52, 24
%54 = load i64, i64* %3
%55 = mul i64 4, %54
%56 = add i64 %55, 2
%57 = shl i64 %56, 16
%58 = or i64 %53, %57
%59 = load i64, i64* %3
%60 = mul i64 4, %59
%61 = add i64 %60, 1
%62 = shl i64 %61, 8
%63 = or i64 %58, %62
%64 = load i64, i64* %3
%65 = mul i64 4, %64
%66 = or i64 %63, %65
%67 = load i64, i64* %3
%68 = getelementptr inbounds [8 x i64], [8 x i64]* %5, i64 0, i64 %67
store i64 %66, i64* %68
%69 = load i64, i64* %3
%70 = getelementptr inbounds [8 x i64], [8 x i64]* %4, i64 0, i64 %69
store i64 %66, i64* %70
br label %71
71: ; preds = %49
%72 = load i64, i64* %3
%73 = add i64 %72, 1
store i64 %73, i64* %3
br label %46
74: ; preds = %46
%75 = getelementptr inbounds [8 x i64], [8 x i64]* %4, i64 0, i64 0
%76 = call i32 @dbg_wb_write_block32(i32 0, i64* %75, i32 32)
%77 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 232, i32 %76)
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i32 0, i32 32)
%79 = getelementptr inbounds [8 x i64], [8 x i64]* %4, i64 0, i64 0
%80 = call i32 @dbg_wb_read_block32(i32 0, i64* %79, i32 32)
%81 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 236, i32 %80)
store i64 0, i64* %3
br label %82
82: ; preds = %102, %74
%83 = load i64, i64* %3
%84 = icmp ult i64 %83, 8
br i1 %84, label %85, label %105
85: ; preds = %82
%86 = load i64, i64* %3
%87 = getelementptr inbounds [8 x i64], [8 x i64]* %5, i64 0, i64 %86
%88 = load i64, i64* %87
%89 = load i64, i64* %3
%90 = getelementptr inbounds [8 x i64], [8 x i64]* %4, i64 0, i64 %89
%91 = load i64, i64* %90
%92 = icmp ne i64 %88, %91
br i1 %92, label %93, label %101
93: ; preds = %85
%94 = load i64, i64* %3
%95 = getelementptr inbounds [8 x i64], [8 x i64]* %5, i64 0, i64 %94
%96 = load i64, i64* %95
%97 = load i64, i64* %3
%98 = getelementptr inbounds [8 x i64], [8 x i64]* %4, i64 0, i64 %97
%99 = load i64, i64* %98
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0), i64 %96, i64 %99)
store i32 2048, i32* %1
br label %206
101: ; preds = %85
br label %102
102: ; preds = %101
%103 = load i64, i64* %3
%104 = add i64 %103, 1
store i64 %104, i64* %3
br label %82
105: ; preds = %82
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i32 0, i32 32)
store i64 0, i64* %3
br label %107
107: ; preds = %123, %105
%108 = load i64, i64* %3
%109 = icmp ult i64 %108, 16
br i1 %109, label %110, label %126
110: ; preds = %107
%111 = load i64, i64* %3
%112 = mul i64 4, %111
%113 = add i64 %112, 1
%114 = shl i64 %113, 8
%115 = load i64, i64* %3
%116 = mul i64 4, %115
%117 = or i64 %114, %116
%118 = trunc i64 %117 to i32
%119 = load i64, i64* %3
%120 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 %119
store i32 %118, i32* %120
%121 = load i64, i64* %3
%122 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 %121
store i32 %118, i32* %122
br label %123
123: ; preds = %110
%124 = load i64, i64* %3
%125 = add i64 %124, 1
store i64 %125, i64* %3
br label %107
126: ; preds = %107
%127 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 0
%128 = call i32 @dbg_wb_write_block16(i32 0, i32* %127, i32 32)
%129 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 251, i32 %128)
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i32 0, i32 32)
%131 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 0
%132 = call i32 @dbg_wb_read_block16(i32 0, i32* %131, i32 32)
%133 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 255, i32 %132)
store i64 0, i64* %3
br label %134
134: ; preds = %154, %126
%135 = load i64, i64* %3
%136 = icmp ult i64 %135, 16
br i1 %136, label %137, label %157
137: ; preds = %134
%138 = load i64, i64* %3
%139 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 %138
%140 = load i32, i32* %139
%141 = load i64, i64* %3
%142 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 %141
%143 = load i32, i32* %142
%144 = icmp ne i32 %140, %143
br i1 %144, label %145, label %153
145: ; preds = %137
%146 = load i64, i64* %3
%147 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 %146
%148 = load i32, i32* %147
%149 = load i64, i64* %3
%150 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 %149
%151 = load i32, i32* %150
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0), i32 %148, i32 %151)
store i32 2048, i32* %1
br label %206
153: ; preds = %137
br label %154
154: ; preds = %153
%155 = load i64, i64* %3
%156 = add i64 %155, 1
store i64 %156, i64* %3
br label %134
157: ; preds = %134
%158 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), i32 0, i32 32)
store i64 0, i64* %3
br label %159
159: ; preds = %170, %157
%160 = load i64, i64* %3
%161 = icmp ult i64 %160, 32
br i1 %161, label %162, label %173
162: ; preds = %159
%163 = load i64, i64* %3
%164 = mul i64 4, %163
%165 = trunc i64 %164 to i32
%166 = load i64, i64* %3
%167 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 %166
store i32 %165, i32* %167
%168 = load i64, i64* %3
%169 = getelementptr inbounds [32 x i32], [32 x i32]* %8, i64 0, i64 %168
store i32 %165, i32* %169
br label %170
170: ; preds = %162
%171 = load i64, i64* %3
%172 = add i64 %171, 1
store i64 %172, i64* %3
br label %159
173: ; preds = %159
%174 = getelementptr inbounds [32 x i32], [32 x i32]* %8, i64 0, i64 0
%175 = call i32 @dbg_wb_write_block8(i32 0, i32* %174, i32 32)
%176 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 269, i32 %175)
%177 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), i32 0, i32 32)
%178 = getelementptr inbounds [32 x i32], [32 x i32]* %8, i64 0, i64 0
%179 = call i32 @dbg_wb_read_block8(i32 0, i32* %178, i32 32)
%180 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 273, i32 %179)
store i64 0, i64* %3
br label %181
181: ; preds = %201, %173
%182 = load i64, i64* %3
%183 = icmp ult i64 %182, 32
br i1 %183, label %184, label %204
184: ; preds = %181
%185 = load i64, i64* %3
%186 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 %185
%187 = load i32, i32* %186
%188 = load i64, i64* %3
%189 = getelementptr inbounds [32 x i32], [32 x i32]* %8, i64 0, i64 %188
%190 = load i32, i32* %189
%191 = icmp ne i32 %187, %190
br i1 %191, label %192, label %200
192: ; preds = %184
%193 = load i64, i64* %3
%194 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 %193
%195 = load i32, i32* %194
%196 = load i64, i64* %3
%197 = getelementptr inbounds [32 x i32], [32 x i32]* %8, i64 0, i64 %196
%198 = load i32, i32* %197
%199 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0), i32 %195, i32 %198)
store i32 2048, i32* %1
br label %206
200: ; preds = %184
br label %201
201: ; preds = %200
%202 = load i64, i64* %3
%203 = add i64 %202, 1
store i64 %203, i64* %3
br label %181
204: ; preds = %181
%205 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
store i32 0, i32* %1
br label %206
206: ; preds = %204, %192, %145, %93, %38
%207 = load i32, i32* %1
ret i32 %207
}

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.4 = [34 x i8] c"32-bit block write from %x to %x\0A\00"
@.str.5 = [33 x i8] c"32-bit block read from %x to %x\0A\00"
@.str.6 = [50 x i8] c"SDRAM data differs. Expected: 0x%0x, read: 0x%0x\0A\00"
@.str.7 = [34 x i8] c"16-bit block write from %x to %x\0A\00"
@.str.8 = [33 x i8] c"16-bit block read from %x to %x\0A\00"
@.str.9 = [33 x i8] c"8-bit block write from %x to %x\0A\00"
@.str.10 = [32 x i8] c"8-bit block read from %x to %x\0A\00"
@str = [15 x i8] c"Start SDRAM WR\00"
@str.12 = [15 x i8] c"Start SDRAM RD\00"
@str.13 = [10 x i8] c"SDRAM OK!\00"
@str.14 = [16 x i8] c"SDRAM test FAIL\00"
define i32 @test_sdram() {
%1 = alloca i64
%2 = alloca [8 x i64]
%3 = alloca [16 x i32]
%4 = alloca [32 x i32]
%5 = alloca [32 x i32]
%6 = bitcast i64* %1 to i8*
%7 = bitcast [8 x i64]* %2 to i8*
%8 = bitcast [16 x i32]* %3 to i8*
%9 = bitcast [32 x i32]* %4 to i8*
%10 = bitcast [32 x i32]* %5 to i8*
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @dbg_wb_write32(i32 16, i64 16)
%13 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 212, i32 %12)
%14 = tail call i32 @dbg_wb_write32(i32 32, i64 32)
%15 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 212, i32 %14)
%16 = tail call i32 @dbg_wb_write32(i32 64, i64 64)
%17 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 212, i32 %16)
%18 = tail call i32 @dbg_wb_write32(i32 128, i64 128)
%19 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 212, i32 %18)
%20 = tail call i32 @dbg_wb_write32(i32 256, i64 256)
%21 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 212, i32 %20)
%22 = tail call i32 @dbg_wb_write32(i32 512, i64 512)
%23 = tail call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 212, i32 %22)
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.12, i64 0, i64 0))
%25 = call i32 @dbg_wb_read32(i32 16, i64* %1)
%26 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 217, i32 %25)
%27 = load i64, i64* %1
%28 = icmp eq i64 %27, 16
br i1 %28, label %29, label %74
29: ; preds = %0
%30 = call i32 @dbg_wb_read32(i32 32, i64* %1)
%31 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 217, i32 %30)
%32 = load i64, i64* %1
%33 = icmp eq i64 %32, 32
br i1 %33, label %34, label %74
34: ; preds = %29
%35 = call i32 @dbg_wb_read32(i32 64, i64* %1)
%36 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 217, i32 %35)
%37 = load i64, i64* %1
%38 = icmp eq i64 %37, 64
br i1 %38, label %39, label %74
39: ; preds = %34
%40 = call i32 @dbg_wb_read32(i32 128, i64* %1)
%41 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 217, i32 %40)
%42 = load i64, i64* %1
%43 = icmp eq i64 %42, 128
br i1 %43, label %44, label %74
44: ; preds = %39
%45 = call i32 @dbg_wb_read32(i32 256, i64* %1)
%46 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 217, i32 %45)
%47 = load i64, i64* %1
%48 = icmp eq i64 %47, 256
br i1 %48, label %49, label %74
49: ; preds = %44
%50 = call i32 @dbg_wb_read32(i32 512, i64* %1)
%51 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 217, i32 %50)
%52 = load i64, i64* %1
%53 = icmp eq i64 %52, 512
br i1 %53, label %54, label %74
54: ; preds = %49
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i32 0, i32 32)
%56 = getelementptr inbounds [8 x i64], [8 x i64]* %2, i64 0, i64 0
%57 = bitcast [8 x i64]* %2 to <2 x i64>*
store <2 x i64> <i64 50462976, i64 117835012>, <2 x i64>* %57
%58 = getelementptr inbounds [8 x i64], [8 x i64]* %2, i64 0, i64 2
%59 = getelementptr inbounds [8 x i64], [8 x i64]* %2, i64 0, i64 3
%60 = bitcast i64* %58 to <2 x i64>*
store <2 x i64> <i64 185207048, i64 252579084>, <2 x i64>* %60
%61 = getelementptr inbounds [8 x i64], [8 x i64]* %2, i64 0, i64 4
%62 = getelementptr inbounds [8 x i64], [8 x i64]* %2, i64 0, i64 5
%63 = bitcast i64* %61 to <2 x i64>*
store <2 x i64> <i64 319951120, i64 387323156>, <2 x i64>* %63
%64 = getelementptr inbounds [8 x i64], [8 x i64]* %2, i64 0, i64 6
%65 = getelementptr inbounds [8 x i64], [8 x i64]* %2, i64 0, i64 7
%66 = bitcast i64* %64 to <2 x i64>*
store <2 x i64> <i64 454695192, i64 522067228>, <2 x i64>* %66
%67 = call i32 @dbg_wb_write_block32(i32 0, i64* %56, i32 32)
%68 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 232, i32 %67)
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i32 0, i32 32)
%70 = call i32 @dbg_wb_read_block32(i32 0, i64* %56, i32 32)
%71 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 236, i32 %70)
%72 = load i64, i64* %56
%73 = icmp eq i64 %72, 50462976
br i1 %73, label %76, label %126
74: ; preds = %49, %44, %39, %34, %29, %0
%75 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.14, i64 0, i64 0))
br label %255
76: ; preds = %54
%77 = getelementptr inbounds [8 x i64], [8 x i64]* %2, i64 0, i64 1
%78 = load i64, i64* %77
%79 = icmp eq i64 %78, 117835012
br i1 %79, label %80, label %126
80: ; preds = %76
%81 = load i64, i64* %58
%82 = icmp eq i64 %81, 185207048
br i1 %82, label %83, label %126
83: ; preds = %80
%84 = load i64, i64* %59
%85 = icmp eq i64 %84, 252579084
br i1 %85, label %86, label %126
86: ; preds = %83
%87 = load i64, i64* %61
%88 = icmp eq i64 %87, 319951120
br i1 %88, label %89, label %126
89: ; preds = %86
%90 = load i64, i64* %62
%91 = icmp eq i64 %90, 387323156
br i1 %91, label %92, label %126
92: ; preds = %89
%93 = load i64, i64* %64
%94 = icmp eq i64 %93, 454695192
br i1 %94, label %95, label %126
95: ; preds = %92
%96 = load i64, i64* %65
%97 = icmp eq i64 %96, 522067228
br i1 %97, label %98, label %126
98: ; preds = %95
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i32 0, i32 32)
%100 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%101 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 2
%102 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 3
%103 = bitcast [16 x i32]* %3 to <4 x i32>*
store <4 x i32> <i32 256, i32 1284, i32 2312, i32 3340>, <4 x i32>* %103
%104 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 4
%105 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 5
%106 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 6
%107 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 7
%108 = bitcast i32* %104 to <4 x i32>*
store <4 x i32> <i32 4368, i32 5396, i32 6424, i32 7452>, <4 x i32>* %108
%109 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 8
%110 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 9
%111 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 10
%112 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 11
%113 = bitcast i32* %109 to <4 x i32>*
store <4 x i32> <i32 8480, i32 9508, i32 10536, i32 11564>, <4 x i32>* %113
%114 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 12
%115 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 13
%116 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 14
%117 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 15
%118 = bitcast i32* %114 to <4 x i32>*
store <4 x i32> <i32 12592, i32 13620, i32 14648, i32 15676>, <4 x i32>* %118
%119 = call i32 @dbg_wb_write_block16(i32 0, i32* %100, i32 32)
%120 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 251, i32 %119)
%121 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i32 0, i32 32)
%122 = call i32 @dbg_wb_read_block16(i32 0, i32* %100, i32 32)
%123 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 255, i32 %122)
%124 = load i32, i32* %100
%125 = icmp eq i32 %124, 256
br i1 %125, label %130, label %214
126: ; preds = %95, %92, %89, %86, %83, %80, %76, %54
%127 = phi i64 [ 50462976, %54 ], [ 117835012, %76 ], [ 185207048, %80 ], [ 252579084, %83 ], [ 319951120, %86 ], [ 387323156, %89 ], [ 454695192, %92 ], [ 522067228, %95 ]
%128 = phi i64 [ %72, %54 ], [ %78, %76 ], [ %81, %80 ], [ %84, %83 ], [ %87, %86 ], [ %90, %89 ], [ %93, %92 ], [ %96, %95 ]
%129 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0), i64 %127, i64 %128)
br label %255
130: ; preds = %98
%131 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 1
%132 = load i32, i32* %131
%133 = icmp eq i32 %132, 1284
br i1 %133, label %134, label %214
134: ; preds = %130
%135 = load i32, i32* %101
%136 = icmp eq i32 %135, 2312
br i1 %136, label %137, label %214
137: ; preds = %134
%138 = load i32, i32* %102
%139 = icmp eq i32 %138, 3340
br i1 %139, label %140, label %214
140: ; preds = %137
%141 = load i32, i32* %104
%142 = icmp eq i32 %141, 4368
br i1 %142, label %143, label %214
143: ; preds = %140
%144 = load i32, i32* %105
%145 = icmp eq i32 %144, 5396
br i1 %145, label %146, label %214
146: ; preds = %143
%147 = load i32, i32* %106
%148 = icmp eq i32 %147, 6424
br i1 %148, label %149, label %214
149: ; preds = %146
%150 = load i32, i32* %107
%151 = icmp eq i32 %150, 7452
br i1 %151, label %152, label %214
152: ; preds = %149
%153 = load i32, i32* %109
%154 = icmp eq i32 %153, 8480
br i1 %154, label %155, label %214
155: ; preds = %152
%156 = load i32, i32* %110
%157 = icmp eq i32 %156, 9508
br i1 %157, label %158, label %214
158: ; preds = %155
%159 = load i32, i32* %111
%160 = icmp eq i32 %159, 10536
br i1 %160, label %161, label %214
161: ; preds = %158
%162 = load i32, i32* %112
%163 = icmp eq i32 %162, 11564
br i1 %163, label %164, label %214
164: ; preds = %161
%165 = load i32, i32* %114
%166 = icmp eq i32 %165, 12592
br i1 %166, label %167, label %214
167: ; preds = %164
%168 = load i32, i32* %115
%169 = icmp eq i32 %168, 13620
br i1 %169, label %170, label %214
170: ; preds = %167
%171 = load i32, i32* %116
%172 = icmp eq i32 %171, 14648
br i1 %172, label %173, label %214
173: ; preds = %170
%174 = load i32, i32* %117
%175 = icmp eq i32 %174, 15676
br i1 %175, label %176, label %214
176: ; preds = %173
%177 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), i32 0, i32 32)
%178 = bitcast [32 x i32]* %5 to <4 x i32>*
store <4 x i32> <i32 0, i32 4, i32 8, i32 12>, <4 x i32>* %178
%179 = bitcast [32 x i32]* %4 to <4 x i32>*
store <4 x i32> <i32 0, i32 4, i32 8, i32 12>, <4 x i32>* %179
%180 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 4
%181 = bitcast i32* %180 to <4 x i32>*
store <4 x i32> <i32 16, i32 20, i32 24, i32 28>, <4 x i32>* %181
%182 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 4
%183 = bitcast i32* %182 to <4 x i32>*
store <4 x i32> <i32 16, i32 20, i32 24, i32 28>, <4 x i32>* %183
%184 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 8
%185 = bitcast i32* %184 to <4 x i32>*
store <4 x i32> <i32 32, i32 36, i32 40, i32 44>, <4 x i32>* %185
%186 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 8
%187 = bitcast i32* %186 to <4 x i32>*
store <4 x i32> <i32 32, i32 36, i32 40, i32 44>, <4 x i32>* %187
%188 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 12
%189 = bitcast i32* %188 to <4 x i32>*
store <4 x i32> <i32 48, i32 52, i32 56, i32 60>, <4 x i32>* %189
%190 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 12
%191 = bitcast i32* %190 to <4 x i32>*
store <4 x i32> <i32 48, i32 52, i32 56, i32 60>, <4 x i32>* %191
%192 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 16
%193 = bitcast i32* %192 to <4 x i32>*
store <4 x i32> <i32 64, i32 68, i32 72, i32 76>, <4 x i32>* %193
%194 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 16
%195 = bitcast i32* %194 to <4 x i32>*
store <4 x i32> <i32 64, i32 68, i32 72, i32 76>, <4 x i32>* %195
%196 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 20
%197 = bitcast i32* %196 to <4 x i32>*
store <4 x i32> <i32 80, i32 84, i32 88, i32 92>, <4 x i32>* %197
%198 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 20
%199 = bitcast i32* %198 to <4 x i32>*
store <4 x i32> <i32 80, i32 84, i32 88, i32 92>, <4 x i32>* %199
%200 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 24
%201 = bitcast i32* %200 to <4 x i32>*
store <4 x i32> <i32 96, i32 100, i32 104, i32 108>, <4 x i32>* %201
%202 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 24
%203 = bitcast i32* %202 to <4 x i32>*
store <4 x i32> <i32 96, i32 100, i32 104, i32 108>, <4 x i32>* %203
%204 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 28
%205 = bitcast i32* %204 to <4 x i32>*
store <4 x i32> <i32 112, i32 116, i32 120, i32 124>, <4 x i32>* %205
%206 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 28
%207 = bitcast i32* %206 to <4 x i32>*
store <4 x i32> <i32 112, i32 116, i32 120, i32 124>, <4 x i32>* %207
%208 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 0
%209 = call i32 @dbg_wb_write_block8(i32 0, i32* %208, i32 32)
%210 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 269, i32 %209)
%211 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), i32 0, i32 32)
%212 = call i32 @dbg_wb_read_block8(i32 0, i32* %208, i32 32)
%213 = call i32 @check(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0), i32 273, i32 %212)
br label %242
214: ; preds = %173, %170, %167, %164, %161, %158, %155, %152, %149, %146, %143, %140, %137, %134, %130, %98
%215 = phi i32 [ 256, %98 ], [ 1284, %130 ], [ 2312, %134 ], [ 3340, %137 ], [ 4368, %140 ], [ 5396, %143 ], [ 6424, %146 ], [ 7452, %149 ], [ 8480, %152 ], [ 9508, %155 ], [ 10536, %158 ], [ 11564, %161 ], [ 12592, %164 ], [ 13620, %167 ], [ 14648, %170 ], [ 15676, %173 ]
%216 = phi i32 [ %124, %98 ], [ %132, %130 ], [ %135, %134 ], [ %138, %137 ], [ %141, %140 ], [ %144, %143 ], [ %147, %146 ], [ %150, %149 ], [ %153, %152 ], [ %156, %155 ], [ %159, %158 ], [ %162, %161 ], [ %165, %164 ], [ %168, %167 ], [ %171, %170 ], [ %174, %173 ]
%217 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0), i32 %215, i32 %216)
br label %255
218: ; preds = %242
%219 = or i64 %243, 1
%220 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 %219
%221 = load i32, i32* %220
%222 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 %219
%223 = load i32, i32* %222
%224 = icmp eq i32 %221, %223
br i1 %224, label %225, label %249
225: ; preds = %218
%226 = or i64 %243, 2
%227 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 %226
%228 = load i32, i32* %227
%229 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 %226
%230 = load i32, i32* %229
%231 = icmp eq i32 %228, %230
br i1 %231, label %232, label %249
232: ; preds = %225
%233 = or i64 %243, 3
%234 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 %233
%235 = load i32, i32* %234
%236 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 %233
%237 = load i32, i32* %236
%238 = icmp eq i32 %235, %237
br i1 %238, label %239, label %249
239: ; preds = %232
%240 = add nuw nsw i64 %243, 4
%241 = icmp eq i64 %240, 32
br i1 %241, label %253, label %242
242: ; preds = %239, %176
%243 = phi i64 [ 0, %176 ], [ %240, %239 ]
%244 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 %243
%245 = load i32, i32* %244
%246 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 %243
%247 = load i32, i32* %246
%248 = icmp eq i32 %245, %247
br i1 %248, label %218, label %249
249: ; preds = %232, %225, %218, %242
%250 = phi i32 [ %245, %242 ], [ %221, %218 ], [ %228, %225 ], [ %235, %232 ]
%251 = phi i32 [ %247, %242 ], [ %223, %218 ], [ %230, %225 ], [ %237, %232 ]
%252 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0), i32 %250, i32 %251)
br label %255
253: ; preds = %239
%254 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.13, i64 0, i64 0))
br label %255
255: ; preds = %253, %249, %214, %126, %74
%256 = phi i32 [ 2048, %74 ], [ 2048, %126 ], [ 2048, %214 ], [ 2048, %249 ], [ 0, %253 ]
ret i32 %256
}