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

/* Variables and functions */
int /*<<< orphan*/ generate_tables1(int, scalar_t__ const *, unsigned int,
                                    unsigned int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, ...);
void generate_tables(int small, unsigned n, const uint32_t *tab, unsigned wlen,
                     unsigned rlen) {
  char *name;
  unsigned x, y, z;
  unsigned acc_hi, acc_lo, acc_ptr;
  if (n == 1) {
    generate_tables1(small, tab, wlen, rlen);
    return;
  }
  name = small ? "T256" : "T512";
  printf("\n");
  printf("#if SPH_HAMSI_EXPAND_%s == %u\n", small ? "SMALL" : "BIG", n);
  printf("\n");
  for (x = 0; x < wlen; x += n) {
    unsigned m;
    m = wlen - x;
    if (m > n)
      m = n;
    printf("static const sph_u32 %s_%u[%u][%u] = {\n", name, x, 1U << m, rlen);
    for (y = 0; y < (1U << m); y++) {
      if (y == 0) {
        printf("\t");
      } else {
        printf(",\n\t");
      }
      for (z = 0; z < rlen; z++) {
        uint32_t a;
        unsigned k;
        a = 0;
        for (k = 0; k < m; k++) {
          uint32_t b;
          b = *(tab + rlen * (x + k) + z);
          if (y & (1U << (m - 1 - k)))
            a ^= b;
        }
        if (z == 0) {
          printf("{ ");
        } else if (z % 3 == 0) {
          printf(",\n\t  ");
        } else {
          printf(", ");
        }
        printf("SPH_C32(0x%08lx)", (unsigned long)a);
      }
      printf(" }");
    }
    printf("\n};\n\n");
  }
  printf("#define INPUT_%s   do { \\\n", small ? "SMALL" : "BIG");
  printf("\t\tunsigned acc = buf[0]; \\\n");
  printf("\t\tconst sph_u32 *rp; \\\n");
  acc_hi = 0;
  acc_lo = 8;
  acc_ptr = 0;
  for (x = 0; x < wlen; x += n) {
    unsigned m;
    char mb[30];
    m = wlen - x;
    if (m > n)
      m = n;
    if (x + m > acc_lo) {
      unsigned nb_hi;
      acc_ptr++;
      nb_hi = acc_ptr * 8;
      if (x >= nb_hi) {
        printf("\t\tacc = buf[%u]; \\\n", acc_ptr);
        acc_hi = nb_hi;
        acc_lo += 8;
      } else {
        printf("\t\tacc = (acc << 8) | buf[%u]; \\\n", acc_ptr);
        acc_lo += 8;
      }
    }
    if (acc_hi == x) {
      if (acc_lo == x + m) {
        sprintf(mb, "acc");
      } else {
        sprintf(mb, "acc >> %u", acc_lo - (x + m));
      }
    } else {
      unsigned mask;
      mask = (1U << m) - 1;
      if (acc_lo == x + m) {
        sprintf(mb, "acc & 0x%02x", mask);
      } else {
        sprintf(mb, "(acc >> %u) & 0x%02x", acc_lo - (x + m), mask);
      }
    }
    printf("\t\trp = &%s_%u[%s][0]; \\\n", name, x, mb);
    for (y = 0; y < rlen; y++) {
      printf("\t\tm%X %s rp[%u]; \\\n", y, (x == 0) ? "=" : "^=", y);
    }
  }
  printf("\t} while (0)\n");
  printf("\n");
  printf("#endif\n");
}


x86 assembly (clang, -O0):
<generate_tables>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    116d <generate_tables+0x3d>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1040 <generate_tables1@plt>
jmp    160c <generate_tables+0x4dc>
mov    -0x4(%rbp),%edx
lea    0xe8e(%rip),%rax
lea    0xe82(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x20(%rbp)
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%ecx
lea    0xe8e(%rip),%rsi
lea    0xe81(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
mov    -0x8(%rbp),%edx
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    13ab <generate_tables+0x27b>
mov    -0x14(%rbp),%eax
sub    -0x24(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    11fc <generate_tables+0xcc>
mov    -0x8(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x18(%rbp),%r8d
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x3c(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jae    138f <generate_tables+0x25f>
cmpl   $0x0,-0x28(%rbp)
jne    125c <generate_tables+0x12c>
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    126a <generate_tables+0x13a>
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    1373 <generate_tables+0x243>
movq   $0x0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jae    12fb <generate_tables+0x1cb>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    -0x24(%rbp),%edx
add    -0x4c(%rbp),%edx
imul   %edx,%ecx
mov    %ecx,%ecx
shl    $0x3,%rcx
add    %rcx,%rax
mov    -0x2c(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x58(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
sub    -0x4c(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     12e8 <generate_tables+0x1b8>
mov    -0x58(%rbp),%rax
xor    -0x48(%rbp),%rax
mov    %rax,-0x48(%rbp)
jmp    12ed <generate_tables+0x1bd>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    128c <generate_tables+0x15c>
cmpl   $0x0,-0x2c(%rbp)
jne    1318 <generate_tables+0x1e8>
lea    0xd53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1353 <generate_tables+0x223>
mov    -0x2c(%rbp),%eax
mov    $0x3,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
jne    1340 <generate_tables+0x210>
lea    0xd2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    134e <generate_tables+0x21e>
lea    0xd21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1353 <generate_tables+0x223>
mov    -0x48(%rbp),%rsi
lea    0xd0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1271 <generate_tables+0x141>
lea    0xd02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1228 <generate_tables+0xf8>
lea    0xce9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    11d5 <generate_tables+0xa5>
mov    -0x4(%rbp),%ecx
lea    0xc7a(%rip),%rsi
lea    0xc6d(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xcbb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xcc8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xcd6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x30(%rbp)
movl   $0x8,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    15e2 <generate_tables+0x4b2>
mov    -0x14(%rbp),%eax
sub    -0x24(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    1430 <generate_tables+0x300>
mov    -0x8(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x24(%rbp),%eax
add    -0x5c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jbe    14aa <generate_tables+0x37a>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0x84(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x84(%rbp),%eax
jb     148b <generate_tables+0x35b>
mov    -0x38(%rbp),%esi
lea    0xc67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x84(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x34(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x34(%rbp)
jmp    14a5 <generate_tables+0x375>
mov    -0x38(%rbp),%esi
lea    0xc53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x34(%rbp)
jmp    14aa <generate_tables+0x37a>
mov    -0x30(%rbp),%eax
cmp    -0x24(%rbp),%eax
jne    1500 <generate_tables+0x3d0>
mov    -0x34(%rbp),%eax
mov    -0x24(%rbp),%ecx
add    -0x5c(%rbp),%ecx
cmp    %ecx,%eax
jne    14de <generate_tables+0x3ae>
lea    -0x80(%rbp),%rdi
lea    0xc37(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
jmp    14fb <generate_tables+0x3cb>
lea    -0x80(%rbp),%rdi
mov    -0x34(%rbp),%edx
mov    -0x24(%rbp),%eax
add    -0x5c(%rbp),%eax
sub    %eax,%edx
lea    0xc19(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
jmp    1569 <generate_tables+0x439>
mov    -0x5c(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x88(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x24(%rbp),%ecx
add    -0x5c(%rbp),%ecx
cmp    %ecx,%eax
jne    1541 <generate_tables+0x411>
lea    -0x80(%rbp),%rdi
mov    -0x88(%rbp),%edx
lea    0xbe2(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
jmp    1564 <generate_tables+0x434>
lea    -0x80(%rbp),%rdi
mov    -0x34(%rbp),%edx
mov    -0x24(%rbp),%eax
add    -0x5c(%rbp),%eax
sub    %eax,%edx
mov    -0x88(%rbp),%ecx
lea    0xbc7(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
jmp    1569 <generate_tables+0x439>
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
lea    -0x80(%rbp),%rcx
lea    0xbbe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    15cf <generate_tables+0x49f>
mov    -0x28(%rbp),%esi
mov    -0x24(%rbp),%ecx
lea    0xbc4(%rip),%rdx
lea    0xbbe(%rip),%rax
cmp    $0x0,%ecx
cmove  %rax,%rdx
mov    -0x28(%rbp),%ecx
lea    0xb98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1589 <generate_tables+0x459>
jmp    15d4 <generate_tables+0x4a4>
mov    -0x8(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1409 <generate_tables+0x2d9>
lea    0xb80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xa8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xb72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_tables>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %rdx,%rbp
mov    %edi,%r14d
cmp    $0x1,%esi
jne    118d <generate_tables+0x3d>
mov    %r14d,%edi
mov    %rbp,%rsi
mov    %ecx,%edx
mov    %r8d,%ecx
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <generate_tables1@plt>
mov    %r8,0x10(%rsp)
mov    $0xa,%edi
mov    %ecx,0xc(%rsp)
mov    %esi,%r15d
call   1030 <putchar@plt>
test   %r14d,%r14d
lea    0xe58(%rip),%rax
lea    0xe4c(%rip),%rcx
cmove  %rax,%rcx
mov    %rcx,0x50(%rsp)
lea    0xe6b(%rip),%rax
lea    0xe5e(%rip),%rbx
cmove  %rax,%rbx
lea    0xe34(%rip),%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%r14d
test   %r14d,%r14d
je     162f <generate_tables+0x4df>
mov    %rbx,0x58(%rsp)
mov    %rbp,0x60(%rsp)
mov    0x10(%rsp),%rax
mov    %eax,%ecx
mov    %rcx,0x68(%rsp)
mov    %eax,%ecx
imul   %r15d,%ecx
mov    %ecx,0x38(%rsp)
add    %eax,%eax
mov    %eax,0x4c(%rsp)
mov    %r14d,%eax
movl   $0x0,0x1c(%rsp)
xor    %ecx,%ecx
xor    %edx,%edx
mov    %r15d,0x18(%rsp)
mov    0x4c(%rsp),%ebx
jmp    1280 <generate_tables+0x130>
nopl   0x0(%rax,%rax,1)
lea    0xf2a(%rip),%rdi
call   1040 <puts@plt>
mov    0x18(%rsp),%r15d
mov    0x2c(%rsp),%edx
add    %r15d,%edx
mov    0x3c(%rsp),%ecx
add    $0x1,%ecx
mov    0x1c(%rsp),%eax
add    0x38(%rsp),%eax
mov    %eax,0x1c(%rsp)
mov    0x40(%rsp),%eax
sub    %r15d,%eax
mov    0xc(%rsp),%r14d
cmp    %r14d,%edx
jae    1466 <generate_tables+0x316>
cmp    %eax,%r15d
mov    %eax,0x40(%rsp)
cmovb  %r15d,%eax
mov    %eax,%esi
add    $0xffffffff,%esi
mov    %esi,0x48(%rsp)
and    $0xfffffffe,%eax
mov    %rax,0x30(%rsp)
mov    %ecx,0x3c(%rsp)
mov    %ecx,%eax
imul   %r15d,%eax
mov    %r14d,%ecx
sub    %eax,%ecx
cmp    %ecx,%r15d
cmovb  %r15d,%ecx
mov    %rcx,0x20(%rsp)
sub    %edx,%r14d
cmp    %r15d,%r14d
cmova  %r15d,%r14d
mov    $0x1,%eax
mov    %r14d,%ecx
shl    %cl,%eax
xor    %r12d,%r12d
lea    0xd5e(%rip),%rdi
mov    0x50(%rsp),%rsi
mov    %edx,0x2c(%rsp)
mov    %eax,0x44(%rsp)
mov    %eax,%ecx
mov    0x10(%rsp),%r8
xor    %eax,%eax
call   1050 <printf@plt>
jmp    131d <generate_tables+0x1cd>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xd75(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r12d
cmp    0x44(%rsp),%r12d
je     1240 <generate_tables+0xf0>
test   %r12d,%r12d
je     1340 <generate_tables+0x1f0>
lea    0xd32(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    134a <generate_tables+0x1fa>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    0x10(%rsp),%rax
test   %eax,%eax
je     1300 <generate_tables+0x1b0>
xor    %r15d,%r15d
jmp    1387 <generate_tables+0x237>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xcfd(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r15
cmp    0x68(%rsp),%r15
je     1300 <generate_tables+0x1b0>
test   %r14d,%r14d
mov    0x10(%rsp),%r8
mov    0x30(%rsp),%rbp
je     13d0 <generate_tables+0x280>
mov    0x60(%rsp),%rax
lea    (%rax,%r15,8),%rax
cmpl   $0x1,0x20(%rsp)
jne    1410 <generate_tables+0x2c0>
xor    %ecx,%ecx
xor    %r13d,%r13d
testb  $0x1,0x20(%rsp)
je     13d3 <generate_tables+0x283>
mov    %ecx,%edx
not    %edx
add    %r14d,%edx
bt     %edx,%r12d
jae    13d3 <generate_tables+0x283>
add    0x2c(%rsp),%ecx
imul   %r8d,%ecx
xor    (%rax,%rcx,8),%r13
jmp    13d3 <generate_tables+0x283>
nopl   (%rax)
xor    %r13d,%r13d
lea    0xc85(%rip),%rdi
test   %r15,%r15
je     1360 <generate_tables+0x210>
imul   $0xaaaaaaab,%r15d,%eax
cmp    $0x55555556,%eax
lea    0xc76(%rip),%rdi
lea    0xc69(%rip),%rax
cmovb  %rax,%rdi
jmp    1360 <generate_tables+0x210>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x48(%rsp),%edx
mov    0x1c(%rsp),%ecx
mov    %ecx,%esi
xor    %ecx,%ecx
xor    %r13d,%r13d
jmp    1442 <generate_tables+0x2f2>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x2,%rcx
add    %ebx,%esi
add    $0xfffffffe,%edx
cmp    %rcx,%rbp
je     13ab <generate_tables+0x25b>
bt     %edx,%r12d
jae    144e <generate_tables+0x2fe>
mov    %esi,%edi
xor    (%rax,%rdi,8),%r13
mov    %ecx,%edi
xor    $0x1e,%edi
add    %r14d,%edi
bt     %edi,%r12d
jae    1430 <generate_tables+0x2e0>
lea    (%r8,%rsi,1),%edi
xor    (%rax,%rdi,8),%r13
jmp    1430 <generate_tables+0x2e0>
lea    0xc12(%rip),%rdi
mov    0x58(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xcab(%rip),%rdi
call   1040 <puts@plt>
lea    0xcba(%rip),%rdi
call   1040 <puts@plt>
mov    0x18(%rsp),%ecx
mov    0xc(%rsp),%eax
test   %eax,%eax
je     1658 <generate_tables+0x508>
mov    $0x8,%esi
lea    0xc67(%rip),%r15
xor    %r13d,%r13d
xor    %edx,%edx
mov    %rdx,0x30(%rsp)
xor    %ebx,%ebx
jmp    14db <generate_tables+0x38b>
nopl   0x0(%rax,%rax,1)
mov    0x18(%rsp),%ecx
add    %ecx,%r13d
mov    0xc(%rsp),%eax
cmp    %eax,%r13d
mov    0x20(%rsp),%esi
mov    %r12d,%ebx
jae    1658 <generate_tables+0x508>
mov    %eax,%r14d
sub    %r13d,%r14d
cmp    %ecx,%r14d
cmova  %ecx,%r14d
lea    (%r14,%r13,1),%r12d
cmp    %esi,%r12d
jbe    1535 <generate_tables+0x3e5>
mov    0x30(%rsp),%rax
mov    %eax,%ebp
add    $0x1,%ebp
lea    0x8(,%rax,8),%eax
cmp    %eax,%r13d
lea    0xb8e(%rip),%rdi
lea    0xb9b(%rip),%rcx
cmovb  %rcx,%rdi
cmovae %eax,%ebx
mov    %esi,0x20(%rsp)
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x20(%rsp),%esi
add    $0x8,%esi
mov    %ebp,%eax
mov    %rax,0x30(%rsp)
cmp    %r13d,%ebx
mov    %esi,0x20(%rsp)
jne    1560 <generate_tables+0x410>
mov    %esi,%edx
sub    %r12d,%edx
jne    1590 <generate_tables+0x440>
mov    %ebx,%r12d
movl   $0x636361,0x70(%rsp)
lea    0x70(%rsp),%rbx
jmp    15cb <generate_tables+0x47b>
nopw   0x0(%rax,%rax,1)
mov    $0xffffffff,%eax
mov    %r14d,%ecx
shl    %cl,%eax
not    %eax
mov    %esi,%edx
sub    %r12d,%edx
jne    15b0 <generate_tables+0x460>
mov    %ebx,%r12d
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
lea    0xb54(%rip),%rsi
mov    %eax,%edx
jmp    15a2 <generate_tables+0x452>
nopl   0x0(%rax)
mov    %ebx,%r12d
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
lea    0xb2d(%rip),%rsi
xor    %eax,%eax
call   1070 <sprintf@plt>
jmp    15cb <generate_tables+0x47b>
nopl   0x0(%rax,%rax,1)
mov    %ebx,%r12d
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
lea    0xb24(%rip),%rsi
mov    %eax,%ecx
xor    %eax,%eax
call   1070 <sprintf@plt>
lea    0xb29(%rip),%rdi
mov    0x50(%rsp),%rsi
mov    %r13d,%edx
mov    %rbx,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x10(%rsp)
je     14c0 <generate_tables+0x370>
test   %r13d,%r13d
lea    0xb2f(%rip),%r14
lea    0xb29(%rip),%rax
cmove  %rax,%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %ebp,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,0x10(%rsp)
jne    1610 <generate_tables+0x4c0>
jmp    14c0 <generate_tables+0x370>
lea    0xa49(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xae4(%rip),%rdi
call   1040 <puts@plt>
lea    0xaf3(%rip),%rdi
call   1040 <puts@plt>
lea    0xafe(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xaf5(%rip),%rdi
call   1040 <puts@plt>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"T256\00"
@.str.1 = [5 x i8] c"T512\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [31 x i8] c"#if SPH_HAMSI_EXPAND_%s == %u\0A\00"
@.str.4 = [6 x i8] c"SMALL\00"
@.str.5 = [4 x i8] c"BIG\00"
@.str.6 = [40 x i8] c"static const sph_u32 %s_%u[%u][%u] = {\0A\00"
@.str.7 = [2 x i8] c"\09\00"
@.str.8 = [4 x i8] c",\0A\09\00"
@.str.9 = [3 x i8] c"{ \00"
@.str.10 = [6 x i8] c",\0A\09 \00"
@.str.11 = [3 x i8] c", \00"
@.str.12 = [17 x i8] c"SPH_C32(0x%08lx)\00"
@.str.13 = [3 x i8] c" }\00"
@.str.14 = [6 x i8] c"\0A};\0A\0A\00"
@.str.15 = [27 x i8] c"#define INPUT_%s do { \\\0A\00"
@.str.16 = [28 x i8] c"\09\09unsigned acc = buf[0]; \\\0A\00"
@.str.17 = [24 x i8] c"\09\09const sph_u32 *rp; \\\0A\00"
@.str.18 = [20 x i8] c"\09\09acc = buf[%u]; \\\0A\00"
@.str.19 = [33 x i8] c"\09\09acc = (acc << 8) | buf[%u]; \\\0A\00"
@.str.20 = [4 x i8] c"acc\00"
@.str.21 = [10 x i8] c"acc >> %u\00"
@.str.22 = [13 x i8] c"acc & 0x%02x\00"
@.str.23 = [21 x i8] c"(acc >> %u) & 0x%02x\00"
@.str.24 = [25 x i8] c"\09\09rp = &%s_%u[%s][0]; \\\0A\00"
@.str.25 = [20 x i8] c"\09\09m%X %s rp[%u]; \\\0A\00"
@.str.26 = [2 x i8] c"=\00"
@.str.27 = [3 x i8] c"^=\00"
@.str.28 = [14 x i8] c"\09} while (0)\0A\00"
@.str.29 = [8 x i8] c"#endif\0A\00"
define void @generate_tables(i32 %0, i32 %1, i64* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i64
%20 = alloca i32
%21 = alloca i64
%22 = alloca i32
%23 = alloca [30 x i8]
%24 = alloca i32
%25 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i64* %2, i64** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%26 = load i32, i32* %7
%27 = icmp eq i32 %26, 1
br i1 %27, label %28, label %34
28: ; preds = %5
%29 = load i32, i32* %6
%30 = load i64*, i64** %8
%31 = load i32, i32* %9
%32 = load i32, i32* %10
%33 = call i32 @generate_tables1(i32 %29, i64* %30, i32 %31, i32 %32)
br label %270
34: ; preds = %5
%35 = load i32, i32* %6
%36 = icmp ne i32 %35, 0
%37 = zext i1 %36 to i64
%38 = select i1 %36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
store i8* %38, i8** %11
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%40 = load i32, i32* %6
%41 = icmp ne i32 %40, 0
%42 = zext i1 %41 to i64
%43 = select i1 %41, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0)
%44 = load i32, i32* %7
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i8* %43, i32 %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %12
br label %47
47: ; preds = %145, %34
%48 = load i32, i32* %12
%49 = load i32, i32* %9
%50 = icmp ult i32 %48, %49
br i1 %50, label %51, label %149
51: ; preds = %47
%52 = load i32, i32* %9
%53 = load i32, i32* %12
%54 = sub i32 %52, %53
store i32 %54, i32* %18
%55 = load i32, i32* %18
%56 = load i32, i32* %7
%57 = icmp ugt i32 %55, %56
br i1 %57, label %58, label %60
58: ; preds = %51
%59 = load i32, i32* %7
store i32 %59, i32* %18
br label %60
60: ; preds = %58, %51
%61 = load i8*, i8** %11
%62 = load i32, i32* %12
%63 = load i32, i32* %18
%64 = shl i32 1, %63
%65 = load i32, i32* %10
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0), i8* %61, i32 %62, i32 %64, i32 %65)
store i32 0, i32* %13
br label %67
67: ; preds = %140, %60
%68 = load i32, i32* %13
%69 = load i32, i32* %18
%70 = shl i32 1, %69
%71 = icmp ult i32 %68, %70
br i1 %71, label %72, label %143
72: ; preds = %67
%73 = load i32, i32* %13
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %77
75: ; preds = %72
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %79
77: ; preds = %72
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
br label %79
79: ; preds = %77, %75
store i32 0, i32* %14
br label %80
80: ; preds = %135, %79
%81 = load i32, i32* %14
%82 = load i32, i32* %10
%83 = icmp ult i32 %81, %82
br i1 %83, label %84, label %138
84: ; preds = %80
store i64 0, i64* %19
store i32 0, i32* %20
br label %85
85: ; preds = %115, %84
%86 = load i32, i32* %20
%87 = load i32, i32* %18
%88 = icmp ult i32 %86, %87
br i1 %88, label %89, label %118
89: ; preds = %85
%90 = load i64*, i64** %8
%91 = load i32, i32* %10
%92 = load i32, i32* %12
%93 = load i32, i32* %20
%94 = add i32 %92, %93
%95 = mul i32 %91, %94
%96 = zext i32 %95 to i64
%97 = getelementptr inbounds i64, i64* %90, i64 %96
%98 = load i32, i32* %14
%99 = zext i32 %98 to i64
%100 = getelementptr inbounds i64, i64* %97, i64 %99
%101 = load i64, i64* %100
store i64 %101, i64* %21
%102 = load i32, i32* %13
%103 = load i32, i32* %18
%104 = sub i32 %103, 1
%105 = load i32, i32* %20
%106 = sub i32 %104, %105
%107 = shl i32 1, %106
%108 = and i32 %102, %107
%109 = icmp ne i32 %108, 0
br i1 %109, label %110, label %114
110: ; preds = %89
%111 = load i64, i64* %21
%112 = load i64, i64* %19
%113 = xor i64 %112, %111
store i64 %113, i64* %19
br label %114
114: ; preds = %110, %89
br label %115
115: ; preds = %114
%116 = load i32, i32* %20
%117 = add i32 %116, 1
store i32 %117, i32* %20
br label %85
118: ; preds = %85
%119 = load i32, i32* %14
%120 = icmp eq i32 %119, 0
br i1 %120, label %121, label %123
121: ; preds = %118
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
br label %132
123: ; preds = %118
%124 = load i32, i32* %14
%125 = urem i32 %124, 3
%126 = icmp eq i32 %125, 0
br i1 %126, label %127, label %129
127: ; preds = %123
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %131
129: ; preds = %123
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
br label %131
131: ; preds = %129, %127
br label %132
132: ; preds = %131, %121
%133 = load i64, i64* %19
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), i64 %133)
br label %135
135: ; preds = %132
%136 = load i32, i32* %14
%137 = add i32 %136, 1
store i32 %137, i32* %14
br label %80
138: ; preds = %80
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %140
140: ; preds = %138
%141 = load i32, i32* %13
%142 = add i32 %141, 1
store i32 %142, i32* %13
br label %67
143: ; preds = %67
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
br label %145
145: ; preds = %143
%146 = load i32, i32* %7
%147 = load i32, i32* %12
%148 = add i32 %147, %146
store i32 %148, i32* %12
br label %47
149: ; preds = %47
%150 = load i32, i32* %6
%151 = icmp ne i32 %150, 0
%152 = zext i1 %151 to i64
%153 = select i1 %151, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0)
%154 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.15, i64 0, i64 0), i8* %153)
%155 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.16, i64 0, i64 0))
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.17, i64 0, i64 0))
store i32 0, i32* %15
store i32 8, i32* %16
store i32 0, i32* %17
store i32 0, i32* %12
br label %157
157: ; preds = %262, %149
%158 = load i32, i32* %12
%159 = load i32, i32* %9
%160 = icmp ult i32 %158, %159
br i1 %160, label %161, label %266
161: ; preds = %157
%162 = load i32, i32* %9
%163 = load i32, i32* %12
%164 = sub i32 %162, %163
store i32 %164, i32* %22
%165 = load i32, i32* %22
%166 = load i32, i32* %7
%167 = icmp ugt i32 %165, %166
br i1 %167, label %168, label %170
168: ; preds = %161
%169 = load i32, i32* %7
store i32 %169, i32* %22
br label %170
170: ; preds = %168, %161
%171 = load i32, i32* %12
%172 = load i32, i32* %22
%173 = add i32 %171, %172
%174 = load i32, i32* %16
%175 = icmp ugt i32 %173, %174
br i1 %175, label %176, label %196
176: ; preds = %170
%177 = load i32, i32* %17
%178 = add i32 %177, 1
store i32 %178, i32* %17
%179 = load i32, i32* %17
%180 = mul i32 %179, 8
store i32 %180, i32* %24
%181 = load i32, i32* %12
%182 = load i32, i32* %24
%183 = icmp uge i32 %181, %182
br i1 %183, label %184, label %190
184: ; preds = %176
%185 = load i32, i32* %17
%186 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.18, i64 0, i64 0), i32 %185)
%187 = load i32, i32* %24
store i32 %187, i32* %15
%188 = load i32, i32* %16
%189 = add i32 %188, 8
store i32 %189, i32* %16
br label %195
190: ; preds = %176
%191 = load i32, i32* %17
%192 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.19, i64 0, i64 0), i32 %191)
%193 = load i32, i32* %16
%194 = add i32 %193, 8
store i32 %194, i32* %16
br label %195
195: ; preds = %190, %184
br label %196
196: ; preds = %195, %170
%197 = load i32, i32* %15
%198 = load i32, i32* %12
%199 = icmp eq i32 %197, %198
br i1 %199, label %200, label %218
200: ; preds = %196
%201 = load i32, i32* %16
%202 = load i32, i32* %12
%203 = load i32, i32* %22
%204 = add i32 %202, %203
%205 = icmp eq i32 %201, %204
br i1 %205, label %206, label %209
206: ; preds = %200
%207 = getelementptr inbounds [30 x i8], [30 x i8]* %23, i64 0, i64 0
%208 = call i32 (i8*, i8*, ...) @sprintf(i8* %207, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0))
br label %217
209: ; preds = %200
%210 = getelementptr inbounds [30 x i8], [30 x i8]* %23, i64 0, i64 0
%211 = load i32, i32* %16
%212 = load i32, i32* %12
%213 = load i32, i32* %22
%214 = add i32 %212, %213
%215 = sub i32 %211, %214
%216 = call i32 (i8*, i8*, ...) @sprintf(i8* %210, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.21, i64 0, i64 0), i32 %215)
br label %217
217: ; preds = %209, %206
br label %241
218: ; preds = %196
%219 = load i32, i32* %22
%220 = shl i32 1, %219
%221 = sub i32 %220, 1
store i32 %221, i32* %25
%222 = load i32, i32* %16
%223 = load i32, i32* %12
%224 = load i32, i32* %22
%225 = add i32 %223, %224
%226 = icmp eq i32 %222, %225
br i1 %226, label %227, label %231
227: ; preds = %218
%228 = getelementptr inbounds [30 x i8], [30 x i8]* %23, i64 0, i64 0
%229 = load i32, i32* %25
%230 = call i32 (i8*, i8*, ...) @sprintf(i8* %228, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.22, i64 0, i64 0), i32 %229)
br label %240
231: ; preds = %218
%232 = getelementptr inbounds [30 x i8], [30 x i8]* %23, i64 0, i64 0
%233 = load i32, i32* %16
%234 = load i32, i32* %12
%235 = load i32, i32* %22
%236 = add i32 %234, %235
%237 = sub i32 %233, %236
%238 = load i32, i32* %25
%239 = call i32 (i8*, i8*, ...) @sprintf(i8* %232, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.23, i64 0, i64 0), i32 %237, i32 %238)
br label %240
240: ; preds = %231, %227
br label %241
241: ; preds = %240, %217
%242 = load i8*, i8** %11
%243 = load i32, i32* %12
%244 = getelementptr inbounds [30 x i8], [30 x i8]* %23, i64 0, i64 0
%245 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.24, i64 0, i64 0), i8* %242, i32 %243, i8* %244)
store i32 0, i32* %13
br label %246
246: ; preds = %258, %241
%247 = load i32, i32* %13
%248 = load i32, i32* %10
%249 = icmp ult i32 %247, %248
br i1 %249, label %250, label %261
250: ; preds = %246
%251 = load i32, i32* %13
%252 = load i32, i32* %12
%253 = icmp eq i32 %252, 0
%254 = zext i1 %253 to i64
%255 = select i1 %253, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.27, i64 0, i64 0)
%256 = load i32, i32* %13
%257 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.25, i64 0, i64 0), i32 %251, i8* %255, i32 %256)
br label %258
258: ; preds = %250
%259 = load i32, i32* %13
%260 = add i32 %259, 1
store i32 %260, i32* %13
br label %246
261: ; preds = %246
br label %262
262: ; preds = %261
%263 = load i32, i32* %7
%264 = load i32, i32* %12
%265 = add i32 %264, %263
store i32 %265, i32* %12
br label %157
266: ; preds = %157
%267 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.28, i64 0, i64 0))
%268 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%269 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.29, i64 0, i64 0))
br label %270
270: ; preds = %266, %28
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"T256\00"
@.str.1 = [5 x i8] c"T512\00"
@.str.3 = [31 x i8] c"#if SPH_HAMSI_EXPAND_%s == %u\0A\00"
@.str.4 = [6 x i8] c"SMALL\00"
@.str.5 = [4 x i8] c"BIG\00"
@.str.6 = [40 x i8] c"static const sph_u32 %s_%u[%u][%u] = {\0A\00"
@.str.8 = [4 x i8] c",\0A\09\00"
@.str.9 = [3 x i8] c"{ \00"
@.str.10 = [6 x i8] c",\0A\09 \00"
@.str.11 = [3 x i8] c", \00"
@.str.12 = [17 x i8] c"SPH_C32(0x%08lx)\00"
@.str.13 = [3 x i8] c" }\00"
@.str.15 = [27 x i8] c"#define INPUT_%s do { \\\0A\00"
@.str.18 = [20 x i8] c"\09\09acc = buf[%u]; \\\0A\00"
@.str.19 = [33 x i8] c"\09\09acc = (acc << 8) | buf[%u]; \\\0A\00"
@.str.21 = [10 x i8] c"acc >> %u\00"
@.str.22 = [13 x i8] c"acc & 0x%02x\00"
@.str.23 = [21 x i8] c"(acc >> %u) & 0x%02x\00"
@.str.24 = [25 x i8] c"\09\09rp = &%s_%u[%s][0]; \\\0A\00"
@.str.25 = [20 x i8] c"\09\09m%X %s rp[%u]; \\\0A\00"
@.str.26 = [2 x i8] c"=\00"
@.str.27 = [3 x i8] c"^=\00"
@str = [27 x i8] c"\09\09unsigned acc = buf[0]; \\\00"
@str.30 = [23 x i8] c"\09\09const sph_u32 *rp; \\\00"
@str.31 = [13 x i8] c"\09} while (0)\00"
@str.32 = [7 x i8] c"#endif\00"
@str.33 = [5 x i8] c"\0A};\0A\00"
define void @generate_tables(i32 %0, i32 %1, i64* %2, i32 %3, i32 %4) {
%6 = alloca [30 x i8]
%7 = icmp eq i32 %1, 1
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @generate_tables1(i32 %0, i64* %2, i32 %3, i32 %4)
br label %196
10: ; preds = %5
%11 = icmp eq i32 %0, 0
%12 = select i1 %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
%13 = tail call i32 @putchar(i32 10)
%14 = select i1 %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i8* %14, i32 %1)
%16 = tail call i32 @putchar(i32 10)
%17 = icmp eq i32 %3, 0
br i1 %17, label %188, label %18
18: ; preds = %10
%19 = icmp eq i32 %4, 0
%20 = zext i32 %4 to i64
br label %21
21: ; preds = %18, %124
%22 = phi i32 [ 0, %18 ], [ %128, %124 ]
%23 = phi i32 [ 0, %18 ], [ %126, %124 ]
%24 = mul i32 %22, %1
%25 = sub i32 %3, %24
%26 = call i32 @llvm.umin.i32(i32 %1, i32 %25)
%27 = zext i32 %26 to i64
%28 = sub i32 %3, %23
%29 = icmp ugt i32 %28, %1
%30 = select i1 %29, i32 %1, i32 %28
%31 = shl nuw i32 1, %30
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0), i8* %12, i32 %23, i32 %31, i32 %4)
%33 = icmp eq i32 %30, 0
%34 = and i64 %27, 1
%35 = icmp eq i32 %26, 1
%36 = and i64 %27, 4294967294
%37 = icmp eq i64 %34, 0
br label %38
38: ; preds = %21, %120
%39 = phi i32 [ 0, %21 ], [ %122, %120 ]
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = tail call i32 @putchar(i32 9)
br label %45
43: ; preds = %38
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
br label %45
45: ; preds = %43, %41
br i1 %19, label %120, label %46
46: ; preds = %45, %114
%47 = phi i64 [ %118, %114 ], [ 0, %45 ]
br i1 %33, label %106, label %48
48: ; preds = %46
%49 = getelementptr inbounds i64, i64* %2, i64 %47
br i1 %35, label %88, label %50
50: ; preds = %48, %83
%51 = phi i64 [ %85, %83 ], [ 0, %48 ]
%52 = phi i64 [ %84, %83 ], [ 0, %48 ]
%53 = phi i64 [ %86, %83 ], [ 0, %48 ]
%54 = trunc i64 %51 to i32
%55 = xor i32 %54, -1
%56 = add i32 %30, %55
%57 = shl nuw i32 1, %56
%58 = and i32 %57, %39
%59 = icmp eq i32 %58, 0
br i1 %59, label %67, label %60
60: ; preds = %50
%61 = add i32 %23, %54
%62 = mul i32 %61, %4
%63 = zext i32 %62 to i64
%64 = getelementptr inbounds i64, i64* %49, i64 %63
%65 = load i64, i64* %64
%66 = xor i64 %65, %52
br label %67
67: ; preds = %60, %50
%68 = phi i64 [ %66, %60 ], [ %52, %50 ]
%69 = trunc i64 %51 to i32
%70 = xor i32 %69, -2
%71 = add i32 %30, %70
%72 = shl nuw i32 1, %71
%73 = and i32 %72, %39
%74 = icmp eq i32 %73, 0
br i1 %74, label %83, label %75
75: ; preds = %67
%76 = or i32 %69, 1
%77 = add i32 %23, %76
%78 = mul i32 %77, %4
%79 = zext i32 %78 to i64
%80 = getelementptr inbounds i64, i64* %49, i64 %79
%81 = load i64, i64* %80
%82 = xor i64 %81, %68
br label %83
83: ; preds = %75, %67
%84 = phi i64 [ %82, %75 ], [ %68, %67 ]
%85 = add nuw nsw i64 %51, 2
%86 = add i64 %53, 2
%87 = icmp eq i64 %86, %36
br i1 %87, label %88, label %50
88: ; preds = %83, %48
%89 = phi i64 [ undef, %48 ], [ %84, %83 ]
%90 = phi i64 [ 0, %48 ], [ %85, %83 ]
%91 = phi i64 [ 0, %48 ], [ %84, %83 ]
br i1 %37, label %106, label %92
92: ; preds = %88
%93 = trunc i64 %90 to i32
%94 = xor i32 %93, -1
%95 = add i32 %30, %94
%96 = shl nuw i32 1, %95
%97 = and i32 %96, %39
%98 = icmp eq i32 %97, 0
br i1 %98, label %106, label %99
99: ; preds = %92
%100 = add i32 %23, %93
%101 = mul i32 %100, %4
%102 = zext i32 %101 to i64
%103 = getelementptr inbounds i64, i64* %49, i64 %102
%104 = load i64, i64* %103
%105 = xor i64 %104, %91
br label %106
106: ; preds = %88, %99, %92, %46
%107 = phi i64 [ 0, %46 ], [ %89, %88 ], [ %105, %99 ], [ %91, %92 ]
%108 = icmp eq i64 %47, 0
br i1 %108, label %114, label %109
109: ; preds = %106
%110 = trunc i64 %47 to i32
%111 = urem i32 %110, 3
%112 = icmp eq i32 %111, 0
%113 = select i1 %112, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0)
br label %114
114: ; preds = %109, %106
%115 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), %106 ], [ %113, %109 ]
%116 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %115)
%117 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), i64 %107)
%118 = add nuw nsw i64 %47, 1
%119 = icmp eq i64 %118, %20
br i1 %119, label %120, label %46
120: ; preds = %114, %45
%121 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%122 = add nuw i32 %39, 1
%123 = icmp eq i32 %122, %31
br i1 %123, label %124, label %38
124: ; preds = %120
%125 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.33, i64 0, i64 0))
%126 = add i32 %23, %1
%127 = icmp ult i32 %126, %3
%128 = add i32 %22, 1
br i1 %127, label %21, label %129
129: ; preds = %124
%130 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.15, i64 0, i64 0), i8* %14)
%131 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%132 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.30, i64 0, i64 0))
br i1 %17, label %192, label %133
133: ; preds = %129
%134 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%135 = bitcast [30 x i8]* %6 to i32*
%136 = icmp eq i32 %4, 0
br label %137
137: ; preds = %133, %185
%138 = phi i32 [ 0, %133 ], [ %186, %185 ]
%139 = phi i32 [ 0, %133 ], [ %158, %185 ]
%140 = phi i32 [ 8, %133 ], [ %157, %185 ]
%141 = phi i32 [ 0, %133 ], [ %156, %185 ]
%142 = sub i32 %3, %138
%143 = icmp ugt i32 %142, %1
%144 = select i1 %143, i32 %1, i32 %142
%145 = add i32 %144, %138
%146 = icmp ugt i32 %145, %140
br i1 %146, label %147, label %155
147: ; preds = %137
%148 = add i32 %139, 1
%149 = shl i32 %148, 3
%150 = icmp ult i32 %138, %149
%151 = select i1 %150, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.18, i64 0, i64 0)
%152 = select i1 %150, i32 %141, i32 %149
%153 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %151, i32 %148)
%154 = add i32 %140, 8
br label %155
155: ; preds = %147, %137
%156 = phi i32 [ %152, %147 ], [ %141, %137 ]
%157 = phi i32 [ %154, %147 ], [ %140, %137 ]
%158 = phi i32 [ %148, %147 ], [ %139, %137 ]
%159 = icmp eq i32 %156, %138
br i1 %159, label %160, label %166
160: ; preds = %155
%161 = icmp eq i32 %157, %145
br i1 %161, label %162, label %163
162: ; preds = %160
store i32 6513505, i32* %135
br label %175
163: ; preds = %160
%164 = sub i32 %157, %145
%165 = call i32 (i8*, i8*, ...) @sprintf(i8* %134, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.21, i64 0, i64 0), i32 %164)
br label %175
166: ; preds = %155
%167 = shl nsw i32 -1, %144
%168 = xor i32 %167, -1
%169 = icmp eq i32 %157, %145
br i1 %169, label %170, label %172
170: ; preds = %166
%171 = call i32 (i8*, i8*, ...) @sprintf(i8* %134, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.22, i64 0, i64 0), i32 %168)
br label %175
172: ; preds = %166
%173 = sub i32 %157, %145
%174 = call i32 (i8*, i8*, ...) @sprintf(i8* %134, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.23, i64 0, i64 0), i32 %173, i32 %168)
br label %175
175: ; preds = %170, %172, %162, %163
%176 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.24, i64 0, i64 0), i8* %12, i32 %138, i8* %134)
br i1 %136, label %185, label %177
177: ; preds = %175
%178 = icmp eq i32 %138, 0
%179 = select i1 %178, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.27, i64 0, i64 0)
br label %180
180: ; preds = %177, %180
%181 = phi i32 [ 0, %177 ], [ %183, %180 ]
%182 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.25, i64 0, i64 0), i32 %181, i8* %179, i32 %181)
%183 = add nuw i32 %181, 1
%184 = icmp eq i32 %183, %4
br i1 %184, label %185, label %180
185: ; preds = %180, %175
%186 = add i32 %138, %1
%187 = icmp ult i32 %186, %3
br i1 %187, label %137, label %192
188: ; preds = %10
%189 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.15, i64 0, i64 0), i8* %14)
%190 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%191 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.30, i64 0, i64 0))
br label %192
192: ; preds = %185, %188, %129
%193 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.31, i64 0, i64 0))
%194 = call i32 @putchar(i32 10)
%195 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.32, i64 0, i64 0))
br label %196
196: ; preds = %192, %8
ret void
}