#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*/ printf(char *, ...);
void generate_tables1(int small, const uint32_t *tab, unsigned wlen,
                      unsigned rlen) {
  char *name;
  unsigned x, y;
  name = small ? "T256" : "T512";
  printf("\n");
  printf("#if SPH_HAMSI_EXPAND_%s == 1\n", small ? "SMALL" : "BIG");
  printf("\n");
  printf("/* Note: this table lists bits within each byte from least\n");
  printf("   siginificant to most significant. */\n");
  printf("static const sph_u32 %s[%u][%u] = {\n", name, wlen, rlen);
  for (x = 0; x < wlen; x++) {
    unsigned z;
    z = 8 * (x / 8) + 7 - (x % 8);
    if (x == 0) {
      printf("\t");
    } else {
      printf(",\n\t");
    }
    for (y = 0; y < rlen; y++) {
      if (y == 0) {
        printf("{ ");
      } else if (y % 3 == 0) {
        printf(",\n\t  ");
      } else {
        printf(", ");
      }
      printf("SPH_C32(0x%08lx)", (unsigned long)tab[rlen * z + y]);
    }
    printf(" }");
  }
  printf("\n};\n\n");
  printf("#define INPUT_%s   do { \\\n", small ? "SMALL" : "BIG");
  printf("\t\tconst sph_u32 *tp = &%s[0][0]; \\\n", name);
  printf("\t\tunsigned u, v; \\\n");
  for (x = 0; x < rlen; x++)
    printf("\t\tm%X = 0; \\\n", x);
  printf("\t\tfor (u = 0; u < %u; u ++) { \\\n", wlen / 8);
  printf("\t\t\tunsigned db = buf[u]; \\\n");
  printf("\t\t\tfor (v = 0; v < 8; v ++, db >>= 1) { \\\n");
  printf("\t\t\t\tsph_u32 dm = SPH_T32(-(sph_u32)(db & 1)); \\\n");
  for (x = 0; x < rlen; x++)
    printf("\t\t\t\tm%X ^= dm & *tp ++; \\\n", x);
  printf("\t\t\t} \\\n");
  printf("\t\t} \\\n");
  printf("\t} while (0)\n\n");
  printf("#endif\n");
}


x86 assembly (clang, -O0):
<generate_tables1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edx
lea    0xed6(%rip),%rax
lea    0xeca(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x20(%rbp)
lea    0x10c8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%ecx
lea    0xed5(%rip),%rsi
lea    0xec8(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1094(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xee7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    12c3 <generate_tables1+0x1b3>
mov    -0x24(%rbp),%eax
shr    $0x3,%eax
shl    $0x3,%eax
add    $0x7,%eax
mov    -0x24(%rbp),%ecx
and    $0x7,%ecx
sub    %ecx,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    11fe <generate_tables1+0xee>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    120c <generate_tables1+0xfc>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    12a7 <generate_tables1+0x197>
cmpl   $0x0,-0x28(%rbp)
jne    123c <generate_tables1+0x12c>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1277 <generate_tables1+0x167>
mov    -0x28(%rbp),%eax
mov    $0x3,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
jne    1264 <generate_tables1+0x154>
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1272 <generate_tables1+0x162>
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1277 <generate_tables1+0x167>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
add    -0x28(%rbp),%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,8),%rsi
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1213 <generate_tables1+0x103>
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11be <generate_tables1+0xae>
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%ecx
lea    0xd53(%rip),%rsi
lea    0xd46(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xdf6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    1349 <generate_tables1+0x239>
mov    -0x24(%rbp),%esi
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    131e <generate_tables1+0x20e>
mov    -0x14(%rbp),%esi
shr    $0x3,%esi
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    13b9 <generate_tables1+0x2a9>
mov    -0x24(%rbp),%esi
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    138e <generate_tables1+0x27e>
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_tables1>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %rsi,%rbp
mov    %edi,%r14d
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r14d,%r14d
lea    0xea7(%rip),%rax
lea    0xe9b(%rip),%rbx
cmove  %rax,%rbx
lea    0xebe(%rip),%rax
lea    0xeb1(%rip),%rsi
cmove  %rax,%rsi
lea    0xe88(%rip),%rdi
mov    %rsi,0x10(%rsp)
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xf65(%rip),%rdi
call   1040 <puts@plt>
lea    0xf94(%rip),%rdi
call   1040 <puts@plt>
lea    0xe7b(%rip),%rdi
mov    %rbx,0x18(%rsp)
mov    %rbx,%rsi
mov    %r12d,%edx
mov    %r15d,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12d,0x8(%rsp)
test   %r12d,%r12d
je     12fb <generate_tables1+0x1cb>
mov    %r15d,%eax
add    $0xffffffffffffffff,%rax
mov    %rax,0x20(%rsp)
xor    %ebx,%ebx
mov    %r15d,0xc(%rsp)
jmp    1210 <generate_tables1+0xe0>
nop
lea    0xe81(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebx
cmp    0x8(%rsp),%ebx
mov    0xc(%rsp),%r15d
je     12fb <generate_tables1+0x1cb>
test   %ebx,%ebx
je     1230 <generate_tables1+0x100>
lea    0xe3c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r15d,%r15d
jne    123f <generate_tables1+0x10f>
jmp    11f0 <generate_tables1+0xc0>
nopl   0x0(%rax)
mov    $0x9,%edi
call   1030 <putchar@plt>
test   %r15d,%r15d
je     11f0 <generate_tables1+0xc0>
mov    %ebx,%r15d
xor    $0x7,%r15d
mov    0xc(%rsp),%r14d
imul   %r14d,%r15d
lea    0xe05(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%rbp,%r15,8),%rsi
lea    0xdfe(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x1,%r14d
je     11f0 <generate_tables1+0xc0>
add    $0x1,%r15d
mov    $0xffffffff,%r14d
mov    $0x1,%r13d
mov    0x20(%rsp),%r12
jmp    12d3 <generate_tables1+0x1a3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15d,%eax
mov    0x0(%rbp,%rax,8),%rsi
lea    0xdb1(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r15d
add    $0xffffffff,%r14d
add    $0x1,%r13d
add    $0xffffffffffffffff,%r12
je     11f0 <generate_tables1+0xc0>
mov    %r13d,%eax
mov    $0xaaaaaaab,%ecx
imul   %rcx,%rax
shr    $0x21,%rax
lea    (%rax,%rax,2),%eax
lea    0xd71(%rip),%rdi
add    %r14d,%eax
je     12a0 <generate_tables1+0x170>
lea    0xd6b(%rip),%rdi
jmp    12a0 <generate_tables1+0x170>
lea    0xe65(%rip),%rdi
call   1040 <puts@plt>
lea    0xd6d(%rip),%rdi
mov    0x10(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd75(%rip),%rdi
mov    0x18(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe38(%rip),%rdi
call   1040 <puts@plt>
test   %r15d,%r15d
je     13c6 <generate_tables1+0x296>
lea    0xd71(%rip),%r14
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%r15d
jne    1350 <generate_tables1+0x220>
mov    0x8(%rsp),%esi
shr    $0x3,%esi
lea    0xd56(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdff(%rip),%rdi
call   1040 <puts@plt>
lea    0xe0e(%rip),%rdi
call   1040 <puts@plt>
lea    0xe2c(%rip),%rdi
call   1040 <puts@plt>
test   %r15d,%r15d
je     13ff <generate_tables1+0x2cf>
lea    0xd40(%rip),%r14
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%r15d
jne    13b0 <generate_tables1+0x280>
jmp    13ff <generate_tables1+0x2cf>
mov    0x8(%rsp),%esi
shr    $0x3,%esi
lea    0xcf4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd9d(%rip),%rdi
call   1040 <puts@plt>
lea    0xdac(%rip),%rdi
call   1040 <puts@plt>
lea    0xdca(%rip),%rdi
call   1040 <puts@plt>
lea    0xdee(%rip),%rdi
call   1040 <puts@plt>
lea    0xde3(%rip),%rdi
call   1040 <puts@plt>
lea    0xddd(%rip),%rdi
call   1040 <puts@plt>
lea    0xddf(%rip),%rdi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

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 = [30 x i8] c"#if SPH_HAMSI_EXPAND_%s == 1\0A\00"
@.str.4 = [6 x i8] c"SMALL\00"
@.str.5 = [4 x i8] c"BIG\00"
@.str.6 = [60 x i8] c"/* Note: this table lists bits within each byte from least\0A\00"
@.str.7 = [41 x i8] c" siginificant to most significant. */\0A\00"
@.str.8 = [37 x i8] c"static const sph_u32 %s[%u][%u] = {\0A\00"
@.str.9 = [2 x i8] c"\09\00"
@.str.10 = [4 x i8] c",\0A\09\00"
@.str.11 = [3 x i8] c"{ \00"
@.str.12 = [6 x i8] c",\0A\09 \00"
@.str.13 = [3 x i8] c", \00"
@.str.14 = [17 x i8] c"SPH_C32(0x%08lx)\00"
@.str.15 = [3 x i8] c" }\00"
@.str.16 = [6 x i8] c"\0A};\0A\0A\00"
@.str.17 = [27 x i8] c"#define INPUT_%s do { \\\0A\00"
@.str.18 = [36 x i8] c"\09\09const sph_u32 *tp = &%s[0][0]; \\\0A\00"
@.str.19 = [20 x i8] c"\09\09unsigned u, v; \\\0A\00"
@.str.20 = [14 x i8] c"\09\09m%X = 0; \\\0A\00"
@.str.21 = [33 x i8] c"\09\09for (u = 0; u < %u; u ++) { \\\0A\00"
@.str.22 = [28 x i8] c"\09\09\09unsigned db = buf[u]; \\\0A\00"
@.str.23 = [43 x i8] c"\09\09\09for (v = 0; v < 8; v ++, db >>= 1) { \\\0A\00"
@.str.24 = [49 x i8] c"\09\09\09\09sph_u32 dm = SPH_T32(-(sph_u32)(db & 1)); \\\0A\00"
@.str.25 = [27 x i8] c"\09\09\09\09m%X ^= dm & *tp ++; \\\0A\00"
@.str.26 = [8 x i8] c"\09\09\09} \\\0A\00"
@.str.27 = [7 x i8] c"\09\09} \\\0A\00"
@.str.28 = [15 x i8] c"\09} while (0)\0A\0A\00"
@.str.29 = [8 x i8] c"#endif\0A\00"
define void @generate_tables1(i32 %0, i64* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i64*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %5
store i64* %1, i64** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%13 = load i32, i32* %5
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, 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* %16, i8** %9
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%18 = load i32, i32* %5
%19 = icmp ne i32 %18, 0
%20 = zext i1 %19 to i64
%21 = select i1 %19, 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)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i8* %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.6, i64 0, i64 0))
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
%26 = load i8*, i8** %9
%27 = load i32, i32* %7
%28 = load i32, i32* %8
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i8* %26, i32 %27, i32 %28)
store i32 0, i32* %10
br label %30
30: ; preds = %83, %4
%31 = load i32, i32* %10
%32 = load i32, i32* %7
%33 = icmp ult i32 %31, %32
br i1 %33, label %34, label %86
34: ; preds = %30
%35 = load i32, i32* %10
%36 = udiv i32 %35, 8
%37 = mul i32 8, %36
%38 = add i32 %37, 7
%39 = load i32, i32* %10
%40 = urem i32 %39, 8
%41 = sub i32 %38, %40
store i32 %41, i32* %12
%42 = load i32, i32* %10
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %34
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %48
46: ; preds = %34
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
br label %48
48: ; preds = %46, %44
store i32 0, i32* %11
br label %49
49: ; preds = %78, %48
%50 = load i32, i32* %11
%51 = load i32, i32* %8
%52 = icmp ult i32 %50, %51
br i1 %52, label %53, label %81
53: ; preds = %49
%54 = load i32, i32* %11
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %53
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
br label %67
58: ; preds = %53
%59 = load i32, i32* %11
%60 = urem i32 %59, 3
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %58
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
br label %66
64: ; preds = %58
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %66
66: ; preds = %64, %62
br label %67
67: ; preds = %66, %56
%68 = load i64*, i64** %6
%69 = load i32, i32* %8
%70 = load i32, i32* %12
%71 = mul i32 %69, %70
%72 = load i32, i32* %11
%73 = add i32 %71, %72
%74 = zext i32 %73 to i64
%75 = getelementptr inbounds i64, i64* %68, i64 %74
%76 = load i64, i64* %75
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i64 %76)
br label %78
78: ; preds = %67
%79 = load i32, i32* %11
%80 = add i32 %79, 1
store i32 %80, i32* %11
br label %49
81: ; preds = %49
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
br label %83
83: ; preds = %81
%84 = load i32, i32* %10
%85 = add i32 %84, 1
store i32 %85, i32* %10
br label %30
86: ; preds = %30
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
%88 = load i32, i32* %5
%89 = icmp ne i32 %88, 0
%90 = zext i1 %89 to i64
%91 = select i1 %89, 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)
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.17, i64 0, i64 0), i8* %91)
%93 = load i8*, i8** %9
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.18, i64 0, i64 0), i8* %93)
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.19, i64 0, i64 0))
store i32 0, i32* %10
br label %96
96: ; preds = %103, %86
%97 = load i32, i32* %10
%98 = load i32, i32* %8
%99 = icmp ult i32 %97, %98
br i1 %99, label %100, label %106
100: ; preds = %96
%101 = load i32, i32* %10
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.20, i64 0, i64 0), i32 %101)
br label %103
103: ; preds = %100
%104 = load i32, i32* %10
%105 = add i32 %104, 1
store i32 %105, i32* %10
br label %96
106: ; preds = %96
%107 = load i32, i32* %7
%108 = udiv i32 %107, 8
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.21, i64 0, i64 0), i32 %108)
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.22, i64 0, i64 0))
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.23, i64 0, i64 0))
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.24, i64 0, i64 0))
store i32 0, i32* %10
br label %113
113: ; preds = %120, %106
%114 = load i32, i32* %10
%115 = load i32, i32* %8
%116 = icmp ult i32 %114, %115
br i1 %116, label %117, label %123
117: ; preds = %113
%118 = load i32, i32* %10
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.25, i64 0, i64 0), i32 %118)
br label %120
120: ; preds = %117
%121 = load i32, i32* %10
%122 = add i32 %121, 1
store i32 %122, i32* %10
br label %113
123: ; preds = %113
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.26, i64 0, i64 0))
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.27, i64 0, i64 0))
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.28, i64 0, i64 0))
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.29, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"T256\00"
@.str.1 = [5 x i8] c"T512\00"
@.str.3 = [30 x i8] c"#if SPH_HAMSI_EXPAND_%s == 1\0A\00"
@.str.4 = [6 x i8] c"SMALL\00"
@.str.5 = [4 x i8] c"BIG\00"
@.str.8 = [37 x i8] c"static const sph_u32 %s[%u][%u] = {\0A\00"
@.str.10 = [4 x i8] c",\0A\09\00"
@.str.11 = [3 x i8] c"{ \00"
@.str.12 = [6 x i8] c",\0A\09 \00"
@.str.13 = [3 x i8] c", \00"
@.str.14 = [17 x i8] c"SPH_C32(0x%08lx)\00"
@.str.15 = [3 x i8] c" }\00"
@.str.17 = [27 x i8] c"#define INPUT_%s do { \\\0A\00"
@.str.18 = [36 x i8] c"\09\09const sph_u32 *tp = &%s[0][0]; \\\0A\00"
@.str.20 = [14 x i8] c"\09\09m%X = 0; \\\0A\00"
@.str.21 = [33 x i8] c"\09\09for (u = 0; u < %u; u ++) { \\\0A\00"
@.str.25 = [27 x i8] c"\09\09\09\09m%X ^= dm & *tp ++; \\\0A\00"
@str = [59 x i8] c"/* Note: this table lists bits within each byte from least\00"
@str.30 = [40 x i8] c" siginificant to most significant. */\00"
@str.31 = [5 x i8] c"\0A};\0A\00"
@str.32 = [19 x i8] c"\09\09unsigned u, v; \\\00"
@str.33 = [27 x i8] c"\09\09\09unsigned db = buf[u]; \\\00"
@str.34 = [42 x i8] c"\09\09\09for (v = 0; v < 8; v ++, db >>= 1) { \\\00"
@str.35 = [48 x i8] c"\09\09\09\09sph_u32 dm = SPH_T32(-(sph_u32)(db & 1)); \\\00"
@str.36 = [7 x i8] c"\09\09\09} \\\00"
@str.37 = [6 x i8] c"\09\09} \\\00"
@str.38 = [14 x i8] c"\09} while (0)\0A\00"
@str.39 = [7 x i8] c"#endif\00"
define void @generate_tables1(i32 %0, i64* nocapture %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %0, 0
%6 = select i1 %5, 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)
%7 = tail call i32 @putchar(i32 10)
%8 = select i1 %5, 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)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%10 = tail call i32 @putchar(i32 10)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.30, i64 0, i64 0))
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i8* %6, i32 %2, i32 %3)
%14 = icmp eq i32 %2, 0
br i1 %14, label %53, label %15
15: ; preds = %4
%16 = icmp eq i32 %3, 0
%17 = zext i32 %3 to i64
%18 = icmp eq i32 %3, 1
br label %19
19: ; preds = %15, %49
%20 = phi i32 [ 0, %15 ], [ %51, %49 ]
%21 = xor i32 %20, 7
%22 = icmp eq i32 %20, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = tail call i32 @putchar(i32 9)
br label %27
25: ; preds = %19
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
br label %27
27: ; preds = %25, %23
br i1 %16, label %49, label %28
28: ; preds = %27
%29 = mul i32 %21, %3
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%31 = zext i32 %29 to i64
%32 = getelementptr inbounds i64, i64* %1, i64 %31
%33 = load i64, i64* %32
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i64 %33)
br i1 %18, label %49, label %35
35: ; preds = %28, %35
%36 = phi i64 [ %47, %35 ], [ 1, %28 ]
%37 = trunc i64 %36 to i32
%38 = urem i32 %37, 3
%39 = icmp eq i32 %38, 0
%40 = select i1 %39, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %40)
%42 = add i32 %29, %37
%43 = zext i32 %42 to i64
%44 = getelementptr inbounds i64, i64* %1, i64 %43
%45 = load i64, i64* %44
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i64 %45)
%47 = add nuw nsw i64 %36, 1
%48 = icmp eq i64 %47, %17
br i1 %48, label %49, label %35
49: ; preds = %35, %28, %27
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%51 = add nuw i32 %20, 1
%52 = icmp eq i32 %51, %2
br i1 %52, label %53, label %19
53: ; preds = %49, %4
%54 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.31, i64 0, i64 0))
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.17, i64 0, i64 0), i8* %8)
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.18, i64 0, i64 0), i8* %6)
%57 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.32, i64 0, i64 0))
%58 = icmp eq i32 %3, 0
br i1 %58, label %75, label %59
59: ; preds = %53, %59
%60 = phi i32 [ %62, %59 ], [ 0, %53 ]
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.20, i64 0, i64 0), i32 %60)
%62 = add nuw i32 %60, 1
%63 = icmp eq i32 %62, %3
br i1 %63, label %64, label %59
64: ; preds = %59
%65 = lshr i32 %2, 3
%66 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.21, i64 0, i64 0), i32 %65)
%67 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.33, i64 0, i64 0))
%68 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.34, i64 0, i64 0))
%69 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.35, i64 0, i64 0))
br i1 %58, label %81, label %70
70: ; preds = %64, %70
%71 = phi i32 [ %73, %70 ], [ 0, %64 ]
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.25, i64 0, i64 0), i32 %71)
%73 = add nuw i32 %71, 1
%74 = icmp eq i32 %73, %3
br i1 %74, label %81, label %70
75: ; preds = %53
%76 = lshr i32 %2, 3
%77 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.21, i64 0, i64 0), i32 %76)
%78 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.33, i64 0, i64 0))
%79 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.34, i64 0, i64 0))
%80 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.35, i64 0, i64 0))
br label %81
81: ; preds = %70, %75, %64
%82 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.36, i64 0, i64 0))
%83 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.37, i64 0, i64 0))
%84 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.38, i64 0, i64 0))
%85 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.39, i64 0, i64 0))
ret void
}