#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int lrand48();
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(int *, int *, int);
int /*<<< orphan*/ printf(char *, int, unsigned int, unsigned int);
int /*<<< orphan*/ reed_sol_galois_w08_region_multby_2(char *, int);
int /*<<< orphan*/ reed_sol_galois_w16_region_multby_2(char *, int);
int /*<<< orphan*/ srand48(int /*<<< orphan*/);
scalar_t__ sscanf(char *, char *, int *);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  unsigned char *x, *y;
  unsigned short *xs, *ys;
  unsigned int *xi, *yi;
  int *a32, *copy;
  int i;
  int w;
  if (argc != 2)
    usage(NULL);
  if (sscanf(argv[1], "%d", &w) == 0 || (w != 8 && w != 16 && w != 32))
    usage("Bad w");
  srand48(time(0));
  a32 = (int *)malloc(sizeof(int) * (4));
  copy = (int *)malloc(sizeof(int) * (4));
  y = (unsigned char *)a32;
  for (i = 0; i < 4 * sizeof(int); i++)
    y[i] = lrand48() % 255;
  memcpy(copy, a32, sizeof(int) * 4);
  if (w == 8) {
    x = (unsigned char *)copy;
    y = (unsigned char *)a32;
    reed_sol_galois_w08_region_multby_2((char *)a32, sizeof(int) * 4);
    for (i = 0; i < 4 * sizeof(int) / sizeof(char); i++) {
      printf("Char %2d: %3u *2 = %3u\n", i, x[i], y[i]);
    }
  } else if (w == 16) {
    xs = (unsigned short *)copy;
    ys = (unsigned short *)a32;
    reed_sol_galois_w16_region_multby_2((char *)a32, sizeof(int) * 4);
    for (i = 0; i < 4 * sizeof(int) / sizeof(short); i++) {
      printf("Short %2d: %5u *2 = %5u\n", i, xs[i], ys[i]);
    }
  } else if (w == 32) {
    xi = (unsigned int *)copy;
    yi = (unsigned int *)a32;
    reed_sol_galois_w16_region_multby_2((char *)a32, sizeof(int) * 4);
    for (i = 0; i < 4 * sizeof(int) / sizeof(int); i++) {
      printf("Int %2d: %10u *2 = %10u\n", i, xi[i], yi[i]);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11c9 <main+0x29>
xor    %eax,%eax
mov    %eax,%edi
call   10b0 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe28(%rip),%rsi
lea    -0x58(%rbp),%rdx
call   1080 <sscanf@plt>
cmp    $0x0,%rax
je     1209 <main+0x69>
cmpl   $0x8,-0x58(%rbp)
je     1215 <main+0x75>
cmpl   $0x10,-0x58(%rbp)
je     1215 <main+0x75>
cmpl   $0x20,-0x58(%rbp)
je     1215 <main+0x75>
lea    0xdf3(%rip),%rdi
call   10b0 <usage@plt>
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   10a0 <srand48@plt>
mov    $0x10,%edi
call   1070 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    $0x10,%edi
call   1070 <malloc@plt>
mov    %rax,-0x50(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x54(%rbp)
movslq -0x54(%rbp),%rax
cmp    $0x10,%rax
jae    1284 <main+0xe4>
mov    $0x0,%al
call   1090 <lrand48@plt>
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    124e <main+0xae>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    $0x10,%edx
call   1050 <memcpy@plt>
cmpl   $0x8,-0x58(%rbp)
jne    130d <main+0x16d>
mov    -0x50(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x48(%rbp),%rdi
mov    $0x10,%esi
call   1030 <reed_sol_galois_w08_region_multby_2@plt>
movl   $0x0,-0x54(%rbp)
movslq -0x54(%rbp),%rax
cmp    $0x10,%rax
jae    1308 <main+0x168>
mov    -0x54(%rbp),%esi
mov    -0x18(%rbp),%rax
movslq -0x54(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
mov    -0x20(%rbp),%rax
movslq -0x54(%rbp),%rcx
movzbl (%rax,%rcx,1),%ecx
lea    0xd14(%rip),%rdi
call   1040 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    12c5 <main+0x125>
jmp    1403 <main+0x263>
cmpl   $0x10,-0x58(%rbp)
jne    1384 <main+0x1e4>
mov    -0x50(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x48(%rbp),%rdi
mov    $0x10,%esi
call   10c0 <reed_sol_galois_w16_region_multby_2@plt>
movl   $0x0,-0x54(%rbp)
movslq -0x54(%rbp),%rax
cmp    $0x8,%rax
jae    137f <main+0x1df>
mov    -0x54(%rbp),%esi
mov    -0x28(%rbp),%rax
movslq -0x54(%rbp),%rcx
movzwl (%rax,%rcx,2),%edx
mov    -0x30(%rbp),%rax
movslq -0x54(%rbp),%rcx
movzwl (%rax,%rcx,2),%ecx
lea    0xcb5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    133c <main+0x19c>
jmp    13fe <main+0x25e>
cmpl   $0x20,-0x58(%rbp)
jne    13f9 <main+0x259>
mov    -0x50(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x48(%rbp),%rdi
mov    $0x10,%esi
call   10c0 <reed_sol_galois_w16_region_multby_2@plt>
movl   $0x0,-0x54(%rbp)
movslq -0x54(%rbp),%rax
cmp    $0x4,%rax
jae    13f4 <main+0x254>
mov    -0x54(%rbp),%esi
mov    -0x38(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x40(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xc59(%rip),%rdi
call   1040 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    13b3 <main+0x213>
jmp    13f9 <main+0x259>
jmp    13fe <main+0x25e>
jmp    1403 <main+0x263>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
je     11b8 <main+0x18>
xor    %edi,%edi
call   10b0 <usage@plt>
mov    0x8(%rbx),%rdi
lea    0xe3d(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1080 <sscanf@plt>
test   %rax,%rax
je     11ec <main+0x4c>
mov    0xc(%rsp),%eax
cmp    $0x20,%rax
ja     11ec <main+0x4c>
movabs $0x100010100,%rcx
bt     %rax,%rcx
jb     11f8 <main+0x58>
lea    0xe10(%rip),%rdi
call   10b0 <usage@plt>
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   10a0 <srand48@plt>
mov    $0x10,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
mov    $0x10,%edi
call   1070 <malloc@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1090 <lrand48@plt>
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x7,%ecx
add    %edx,%ecx
add    %eax,%ecx
mov    %cl,(%rbx)
xor    %eax,%eax
call   1090 <lrand48@plt>
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x7,%ecx
add    %edx,%ecx
add    %eax,%ecx
mov    %cl,0x1(%rbx)
xor    %eax,%eax
call   1090 <lrand48@plt>
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x7,%ecx
add    %edx,%ecx
add    %eax,%ecx
mov    %cl,0x2(%rbx)
xor    %eax,%eax
call   1090 <lrand48@plt>
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x7,%ecx
add    %edx,%ecx
add    %eax,%ecx
mov    %cl,0x3(%rbx)
xor    %eax,%eax
call   1090 <lrand48@plt>
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x7,%ecx
add    %edx,%ecx
add    %eax,%ecx
mov    %cl,0x4(%rbx)
xor    %eax,%eax
call   1090 <lrand48@plt>
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x7,%ecx
add    %edx,%ecx
add    %eax,%ecx
mov    %cl,0x5(%rbx)
xor    %eax,%eax
call   1090 <lrand48@plt>
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x7,%ecx
add    %edx,%ecx
add    %eax,%ecx
mov    %cl,0x6(%rbx)
xor    %eax,%eax
call   1090 <lrand48@plt>
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x7,%ecx
add    %edx,%ecx
add    %eax,%ecx
mov    %cl,0x7(%rbx)
xor    %eax,%eax
call   1090 <lrand48@plt>
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x7,%ecx
add    %edx,%ecx
add    %eax,%ecx
mov    %cl,0x8(%rbx)
xor    %eax,%eax
call   1090 <lrand48@plt>
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x7,%ecx
add    %edx,%ecx
add    %eax,%ecx
mov    %cl,0x9(%rbx)
xor    %eax,%eax
call   1090 <lrand48@plt>
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x7,%ecx
add    %edx,%ecx
add    %eax,%ecx
mov    %cl,0xa(%rbx)
xor    %eax,%eax
call   1090 <lrand48@plt>
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x7,%ecx
add    %edx,%ecx
add    %eax,%ecx
mov    %cl,0xb(%rbx)
xor    %eax,%eax
call   1090 <lrand48@plt>
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x7,%ecx
add    %edx,%ecx
add    %eax,%ecx
mov    %cl,0xc(%rbx)
xor    %eax,%eax
call   1090 <lrand48@plt>
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x7,%ecx
add    %edx,%ecx
add    %eax,%ecx
mov    %cl,0xd(%rbx)
xor    %eax,%eax
call   1090 <lrand48@plt>
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x7,%ecx
add    %edx,%ecx
add    %eax,%ecx
mov    %cl,0xe(%rbx)
xor    %eax,%eax
call   1090 <lrand48@plt>
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x7,%ecx
add    %edx,%ecx
add    %eax,%ecx
mov    %cl,0xf(%rbx)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1050 <memcpy@plt>
mov    0xc(%rsp),%eax
cmp    $0x20,%eax
je     160d <main+0x46d>
cmp    $0x10,%eax
je     166c <main+0x4cc>
cmp    $0x8,%eax
jne    172b <main+0x58b>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1030 <reed_sol_galois_w08_region_multby_2@plt>
movzbl (%r14),%edx
movzbl (%rbx),%ecx
lea    0xb50(%rip),%r15
mov    %r15,%rdi
xor    %esi,%esi
call   1040 <printf@plt>
movzbl 0x1(%r14),%edx
movzbl 0x1(%rbx),%ecx
mov    %r15,%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
movzbl 0x2(%r14),%edx
movzbl 0x2(%rbx),%ecx
mov    %r15,%rdi
mov    $0x2,%esi
call   1040 <printf@plt>
movzbl 0x3(%r14),%edx
movzbl 0x3(%rbx),%ecx
mov    %r15,%rdi
mov    $0x3,%esi
call   1040 <printf@plt>
movzbl 0x4(%r14),%edx
movzbl 0x4(%rbx),%ecx
mov    %r15,%rdi
mov    $0x4,%esi
call   1040 <printf@plt>
movzbl 0x5(%r14),%edx
movzbl 0x5(%rbx),%ecx
mov    %r15,%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
movzbl 0x6(%r14),%edx
movzbl 0x6(%rbx),%ecx
mov    %r15,%rdi
mov    $0x6,%esi
call   1040 <printf@plt>
movzbl 0x7(%r14),%edx
movzbl 0x7(%rbx),%ecx
mov    %r15,%rdi
mov    $0x7,%esi
call   1040 <printf@plt>
movzbl 0x8(%r14),%edx
movzbl 0x8(%rbx),%ecx
mov    %r15,%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
movzbl 0x9(%r14),%edx
movzbl 0x9(%rbx),%ecx
mov    %r15,%rdi
mov    $0x9,%esi
call   1040 <printf@plt>
movzbl 0xa(%r14),%edx
movzbl 0xa(%rbx),%ecx
mov    %r15,%rdi
mov    $0xa,%esi
call   1040 <printf@plt>
movzbl 0xb(%r14),%edx
movzbl 0xb(%rbx),%ecx
mov    %r15,%rdi
mov    $0xb,%esi
call   1040 <printf@plt>
movzbl 0xc(%r14),%edx
movzbl 0xc(%rbx),%ecx
mov    %r15,%rdi
mov    $0xc,%esi
call   1040 <printf@plt>
movzbl 0xd(%r14),%edx
movzbl 0xd(%rbx),%ecx
mov    %r15,%rdi
mov    $0xd,%esi
call   1040 <printf@plt>
movzbl 0xe(%r14),%edx
movzbl 0xe(%rbx),%ecx
mov    %r15,%rdi
mov    $0xe,%esi
call   1040 <printf@plt>
movzbl 0xf(%r14),%edx
movzbl 0xf(%rbx),%ecx
mov    %r15,%rdi
mov    $0xf,%esi
jmp    1726 <main+0x586>
mov    %rbx,%rdi
mov    $0x10,%esi
call   10c0 <reed_sol_galois_w16_region_multby_2@plt>
mov    (%r14),%edx
mov    (%rbx),%ecx
lea    0xa14(%rip),%r15
mov    %r15,%rdi
xor    %esi,%esi
call   1040 <printf@plt>
mov    0x4(%r14),%edx
mov    0x4(%rbx),%ecx
mov    %r15,%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
mov    0x8(%r14),%edx
mov    0x8(%rbx),%ecx
mov    %r15,%rdi
mov    $0x2,%esi
call   1040 <printf@plt>
mov    0xc(%r14),%edx
mov    0xc(%rbx),%ecx
mov    %r15,%rdi
mov    $0x3,%esi
jmp    1726 <main+0x586>
mov    %rbx,%rdi
mov    $0x10,%esi
call   10c0 <reed_sol_galois_w16_region_multby_2@plt>
movzwl (%r14),%edx
movzwl (%rbx),%ecx
lea    0x99a(%rip),%r15
mov    %r15,%rdi
xor    %esi,%esi
call   1040 <printf@plt>
movzwl 0x2(%r14),%edx
movzwl 0x2(%rbx),%ecx
mov    %r15,%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
movzwl 0x4(%r14),%edx
movzwl 0x4(%rbx),%ecx
mov    %r15,%rdi
mov    $0x2,%esi
call   1040 <printf@plt>
movzwl 0x6(%r14),%edx
movzwl 0x6(%rbx),%ecx
mov    %r15,%rdi
mov    $0x3,%esi
call   1040 <printf@plt>
movzwl 0x8(%r14),%edx
movzwl 0x8(%rbx),%ecx
mov    %r15,%rdi
mov    $0x4,%esi
call   1040 <printf@plt>
movzwl 0xa(%r14),%edx
movzwl 0xa(%rbx),%ecx
mov    %r15,%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
movzwl 0xc(%r14),%edx
movzwl 0xc(%rbx),%ecx
mov    %r15,%rdi
mov    $0x6,%esi
call   1040 <printf@plt>
movzwl 0xe(%r14),%edx
movzwl 0xe(%rbx),%ecx
mov    %r15,%rdi
mov    $0x7,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"Bad w\00"
@.str.2 = [24 x i8] c"Char %2d: %3u *2 = %3u\0A\00"
@.str.3 = [25 x i8] c"Short %2d: %5u *2 = %5u\0A\00"
@.str.4 = [25 x i8] c"Int %2d: %10u *2 = %10u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i16*
%9 = alloca i16*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 2
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 @usage(i8* null)
br label %20
20: ; preds = %18, %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i64 @sscanf(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
%25 = icmp eq i64 %24, 0
br i1 %25, label %35, label %26
26: ; preds = %20
%27 = load i32, i32* %15
%28 = icmp ne i32 %27, 8
br i1 %28, label %29, label %37
29: ; preds = %26
%30 = load i32, i32* %15
%31 = icmp ne i32 %30, 16
br i1 %31, label %32, label %37
32: ; preds = %29
%33 = load i32, i32* %15
%34 = icmp ne i32 %33, 32
br i1 %34, label %35, label %37
35: ; preds = %32, %20
%36 = call i32 @usage(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %37
37: ; preds = %35, %32, %29, %26
%38 = call i32 @time(i32 0)
%39 = call i32 @srand48(i32 %38)
%40 = call i64 @malloc(i32 16)
%41 = inttoptr i64 %40 to i32*
store i32* %41, i32** %12
%42 = call i64 @malloc(i32 16)
%43 = inttoptr i64 %42 to i32*
store i32* %43, i32** %13
%44 = load i32*, i32** %12
%45 = bitcast i32* %44 to i8*
store i8* %45, i8** %7
store i32 0, i32* %14
br label %46
46: ; preds = %58, %37
%47 = load i32, i32* %14
%48 = sext i32 %47 to i64
%49 = icmp ult i64 %48, 16
br i1 %49, label %50, label %61
50: ; preds = %46
%51 = call i32 (...) @lrand48()
%52 = srem i32 %51, 255
%53 = trunc i32 %52 to i8
%54 = load i8*, i8** %7
%55 = load i32, i32* %14
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8, i8* %54, i64 %56
store i8 %53, i8* %57
br label %58
58: ; preds = %50
%59 = load i32, i32* %14
%60 = add nsw i32 %59, 1
store i32 %60, i32* %14
br label %46
61: ; preds = %46
%62 = load i32*, i32** %13
%63 = load i32*, i32** %12
%64 = call i32 @memcpy(i32* %62, i32* %63, i32 16)
%65 = load i32, i32* %15
%66 = icmp eq i32 %65, 8
br i1 %66, label %67, label %98
67: ; preds = %61
%68 = load i32*, i32** %13
%69 = bitcast i32* %68 to i8*
store i8* %69, i8** %6
%70 = load i32*, i32** %12
%71 = bitcast i32* %70 to i8*
store i8* %71, i8** %7
%72 = load i32*, i32** %12
%73 = bitcast i32* %72 to i8*
%74 = call i32 @reed_sol_galois_w08_region_multby_2(i8* %73, i32 16)
store i32 0, i32* %14
br label %75
75: ; preds = %94, %67
%76 = load i32, i32* %14
%77 = sext i32 %76 to i64
%78 = icmp ult i64 %77, 16
br i1 %78, label %79, label %97
79: ; preds = %75
%80 = load i32, i32* %14
%81 = load i8*, i8** %6
%82 = load i32, i32* %14
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i8, i8* %81, i64 %83
%85 = load i8, i8* %84
%86 = zext i8 %85 to i32
%87 = load i8*, i8** %7
%88 = load i32, i32* %14
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i8, i8* %87, i64 %89
%91 = load i8, i8* %90
%92 = zext i8 %91 to i32
%93 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %80, i32 %86, i32 %92)
br label %94
94: ; preds = %79
%95 = load i32, i32* %14
%96 = add nsw i32 %95, 1
store i32 %96, i32* %14
br label %75
97: ; preds = %75
br label %164
98: ; preds = %61
%99 = load i32, i32* %15
%100 = icmp eq i32 %99, 16
br i1 %100, label %101, label %132
101: ; preds = %98
%102 = load i32*, i32** %13
%103 = bitcast i32* %102 to i16*
store i16* %103, i16** %8
%104 = load i32*, i32** %12
%105 = bitcast i32* %104 to i16*
store i16* %105, i16** %9
%106 = load i32*, i32** %12
%107 = bitcast i32* %106 to i8*
%108 = call i32 @reed_sol_galois_w16_region_multby_2(i8* %107, i32 16)
store i32 0, i32* %14
br label %109
109: ; preds = %128, %101
%110 = load i32, i32* %14
%111 = sext i32 %110 to i64
%112 = icmp ult i64 %111, 8
br i1 %112, label %113, label %131
113: ; preds = %109
%114 = load i32, i32* %14
%115 = load i16*, i16** %8
%116 = load i32, i32* %14
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds i16, i16* %115, i64 %117
%119 = load i16, i16* %118
%120 = zext i16 %119 to i32
%121 = load i16*, i16** %9
%122 = load i32, i32* %14
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds i16, i16* %121, i64 %123
%125 = load i16, i16* %124
%126 = zext i16 %125 to i32
%127 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %114, i32 %120, i32 %126)
br label %128
128: ; preds = %113
%129 = load i32, i32* %14
%130 = add nsw i32 %129, 1
store i32 %130, i32* %14
br label %109
131: ; preds = %109
br label %163
132: ; preds = %98
%133 = load i32, i32* %15
%134 = icmp eq i32 %133, 32
br i1 %134, label %135, label %162
135: ; preds = %132
%136 = load i32*, i32** %13
store i32* %136, i32** %10
%137 = load i32*, i32** %12
store i32* %137, i32** %11
%138 = load i32*, i32** %12
%139 = bitcast i32* %138 to i8*
%140 = call i32 @reed_sol_galois_w16_region_multby_2(i8* %139, i32 16)
store i32 0, i32* %14
br label %141
141: ; preds = %158, %135
%142 = load i32, i32* %14
%143 = sext i32 %142 to i64
%144 = icmp ult i64 %143, 4
br i1 %144, label %145, label %161
145: ; preds = %141
%146 = load i32, i32* %14
%147 = load i32*, i32** %10
%148 = load i32, i32* %14
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds i32, i32* %147, i64 %149
%151 = load i32, i32* %150
%152 = load i32*, i32** %11
%153 = load i32, i32* %14
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds i32, i32* %152, i64 %154
%156 = load i32, i32* %155
%157 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %146, i32 %151, i32 %156)
br label %158
158: ; preds = %145
%159 = load i32, i32* %14
%160 = add nsw i32 %159, 1
store i32 %160, i32* %14
br label %141
161: ; preds = %141
br label %162
162: ; preds = %161, %132
br label %163
163: ; preds = %162, %131
br label %164
164: ; preds = %163, %97
%165 = load i32, i32* %3
ret i32 %165
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"Bad w\00"
@.str.2 = [24 x i8] c"Char %2d: %3u *2 = %3u\0A\00"
@.str.3 = [25 x i8] c"Short %2d: %5u *2 = %5u\0A\00"
@.str.4 = [25 x i8] c"Int %2d: %10u *2 = %10u\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp eq i32 %0, 2
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @usage(i8* null)
br label %8
8: ; preds = %6, %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = call i64 @sscanf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%12 = icmp eq i64 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %8
%14 = load i32, i32* %3
switch i32 %14, label %15 [
i32 32, label %17
i32 16, label %17
i32 8, label %17
]
15: ; preds = %13, %8
%16 = call i32 @usage(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %13, %13, %13, %15
%18 = call i32 @time(i32 0)
%19 = call i32 @srand48(i32 %18)
%20 = call i64 @malloc(i32 16)
%21 = call i64 @malloc(i32 16)
%22 = inttoptr i64 %20 to i8*
%23 = call i32 (...) @lrand48()
%24 = srem i32 %23, 255
%25 = trunc i32 %24 to i8
store i8 %25, i8* %22
%26 = call i32 (...) @lrand48()
%27 = srem i32 %26, 255
%28 = trunc i32 %27 to i8
%29 = getelementptr inbounds i8, i8* %22, i64 1
store i8 %28, i8* %29
%30 = call i32 (...) @lrand48()
%31 = srem i32 %30, 255
%32 = trunc i32 %31 to i8
%33 = getelementptr inbounds i8, i8* %22, i64 2
store i8 %32, i8* %33
%34 = call i32 (...) @lrand48()
%35 = srem i32 %34, 255
%36 = trunc i32 %35 to i8
%37 = getelementptr inbounds i8, i8* %22, i64 3
store i8 %36, i8* %37
%38 = call i32 (...) @lrand48()
%39 = srem i32 %38, 255
%40 = trunc i32 %39 to i8
%41 = getelementptr inbounds i8, i8* %22, i64 4
store i8 %40, i8* %41
%42 = call i32 (...) @lrand48()
%43 = srem i32 %42, 255
%44 = trunc i32 %43 to i8
%45 = getelementptr inbounds i8, i8* %22, i64 5
store i8 %44, i8* %45
%46 = call i32 (...) @lrand48()
%47 = srem i32 %46, 255
%48 = trunc i32 %47 to i8
%49 = getelementptr inbounds i8, i8* %22, i64 6
store i8 %48, i8* %49
%50 = call i32 (...) @lrand48()
%51 = srem i32 %50, 255
%52 = trunc i32 %51 to i8
%53 = getelementptr inbounds i8, i8* %22, i64 7
store i8 %52, i8* %53
%54 = call i32 (...) @lrand48()
%55 = srem i32 %54, 255
%56 = trunc i32 %55 to i8
%57 = getelementptr inbounds i8, i8* %22, i64 8
store i8 %56, i8* %57
%58 = call i32 (...) @lrand48()
%59 = srem i32 %58, 255
%60 = trunc i32 %59 to i8
%61 = getelementptr inbounds i8, i8* %22, i64 9
store i8 %60, i8* %61
%62 = call i32 (...) @lrand48()
%63 = srem i32 %62, 255
%64 = trunc i32 %63 to i8
%65 = getelementptr inbounds i8, i8* %22, i64 10
store i8 %64, i8* %65
%66 = call i32 (...) @lrand48()
%67 = srem i32 %66, 255
%68 = trunc i32 %67 to i8
%69 = getelementptr inbounds i8, i8* %22, i64 11
store i8 %68, i8* %69
%70 = call i32 (...) @lrand48()
%71 = srem i32 %70, 255
%72 = trunc i32 %71 to i8
%73 = getelementptr inbounds i8, i8* %22, i64 12
store i8 %72, i8* %73
%74 = call i32 (...) @lrand48()
%75 = srem i32 %74, 255
%76 = trunc i32 %75 to i8
%77 = getelementptr inbounds i8, i8* %22, i64 13
store i8 %76, i8* %77
%78 = call i32 (...) @lrand48()
%79 = srem i32 %78, 255
%80 = trunc i32 %79 to i8
%81 = getelementptr inbounds i8, i8* %22, i64 14
store i8 %80, i8* %81
%82 = call i32 (...) @lrand48()
%83 = srem i32 %82, 255
%84 = trunc i32 %83 to i8
%85 = getelementptr inbounds i8, i8* %22, i64 15
store i8 %84, i8* %85
%86 = inttoptr i64 %20 to i32*
%87 = inttoptr i64 %21 to i32*
%88 = call i32 @memcpy(i32* %87, i32* %86, i32 16)
%89 = load i32, i32* %3
switch i32 %89, label %266 [
i32 8, label %90
i32 16, label %188
i32 32, label %246
]
90: ; preds = %17
%91 = inttoptr i64 %21 to i8*
%92 = call i32 @reed_sol_galois_w08_region_multby_2(i8* %22, i32 16)
%93 = load i8, i8* %91
%94 = zext i8 %93 to i32
%95 = load i8, i8* %22
%96 = zext i8 %95 to i32
%97 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 %94, i32 %96)
%98 = getelementptr inbounds i8, i8* %91, i64 1
%99 = load i8, i8* %98
%100 = zext i8 %99 to i32
%101 = load i8, i8* %29
%102 = zext i8 %101 to i32
%103 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 %100, i32 %102)
%104 = getelementptr inbounds i8, i8* %91, i64 2
%105 = load i8, i8* %104
%106 = zext i8 %105 to i32
%107 = load i8, i8* %33
%108 = zext i8 %107 to i32
%109 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 %106, i32 %108)
%110 = getelementptr inbounds i8, i8* %91, i64 3
%111 = load i8, i8* %110
%112 = zext i8 %111 to i32
%113 = load i8, i8* %37
%114 = zext i8 %113 to i32
%115 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 3, i32 %112, i32 %114)
%116 = getelementptr inbounds i8, i8* %91, i64 4
%117 = load i8, i8* %116
%118 = zext i8 %117 to i32
%119 = load i8, i8* %41
%120 = zext i8 %119 to i32
%121 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 4, i32 %118, i32 %120)
%122 = getelementptr inbounds i8, i8* %91, i64 5
%123 = load i8, i8* %122
%124 = zext i8 %123 to i32
%125 = load i8, i8* %45
%126 = zext i8 %125 to i32
%127 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 5, i32 %124, i32 %126)
%128 = getelementptr inbounds i8, i8* %91, i64 6
%129 = load i8, i8* %128
%130 = zext i8 %129 to i32
%131 = load i8, i8* %49
%132 = zext i8 %131 to i32
%133 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 6, i32 %130, i32 %132)
%134 = getelementptr inbounds i8, i8* %91, i64 7
%135 = load i8, i8* %134
%136 = zext i8 %135 to i32
%137 = load i8, i8* %53
%138 = zext i8 %137 to i32
%139 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 7, i32 %136, i32 %138)
%140 = getelementptr inbounds i8, i8* %91, i64 8
%141 = load i8, i8* %140
%142 = zext i8 %141 to i32
%143 = load i8, i8* %57
%144 = zext i8 %143 to i32
%145 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 8, i32 %142, i32 %144)
%146 = getelementptr inbounds i8, i8* %91, i64 9
%147 = load i8, i8* %146
%148 = zext i8 %147 to i32
%149 = load i8, i8* %61
%150 = zext i8 %149 to i32
%151 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 9, i32 %148, i32 %150)
%152 = getelementptr inbounds i8, i8* %91, i64 10
%153 = load i8, i8* %152
%154 = zext i8 %153 to i32
%155 = load i8, i8* %65
%156 = zext i8 %155 to i32
%157 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 10, i32 %154, i32 %156)
%158 = getelementptr inbounds i8, i8* %91, i64 11
%159 = load i8, i8* %158
%160 = zext i8 %159 to i32
%161 = load i8, i8* %69
%162 = zext i8 %161 to i32
%163 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 11, i32 %160, i32 %162)
%164 = getelementptr inbounds i8, i8* %91, i64 12
%165 = load i8, i8* %164
%166 = zext i8 %165 to i32
%167 = load i8, i8* %73
%168 = zext i8 %167 to i32
%169 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 12, i32 %166, i32 %168)
%170 = getelementptr inbounds i8, i8* %91, i64 13
%171 = load i8, i8* %170
%172 = zext i8 %171 to i32
%173 = load i8, i8* %77
%174 = zext i8 %173 to i32
%175 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 13, i32 %172, i32 %174)
%176 = getelementptr inbounds i8, i8* %91, i64 14
%177 = load i8, i8* %176
%178 = zext i8 %177 to i32
%179 = load i8, i8* %81
%180 = zext i8 %179 to i32
%181 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 14, i32 %178, i32 %180)
%182 = getelementptr inbounds i8, i8* %91, i64 15
%183 = load i8, i8* %182
%184 = zext i8 %183 to i32
%185 = load i8, i8* %85
%186 = zext i8 %185 to i32
%187 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 15, i32 %184, i32 %186)
br label %266
188: ; preds = %17
%189 = inttoptr i64 %21 to i16*
%190 = inttoptr i64 %20 to i16*
%191 = call i32 @reed_sol_galois_w16_region_multby_2(i8* %22, i32 16)
%192 = load i16, i16* %189
%193 = zext i16 %192 to i32
%194 = load i16, i16* %190
%195 = zext i16 %194 to i32
%196 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 %193, i32 %195)
%197 = getelementptr inbounds i16, i16* %189, i64 1
%198 = load i16, i16* %197
%199 = zext i16 %198 to i32
%200 = getelementptr inbounds i16, i16* %190, i64 1
%201 = load i16, i16* %200
%202 = zext i16 %201 to i32
%203 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 %199, i32 %202)
%204 = getelementptr inbounds i16, i16* %189, i64 2
%205 = load i16, i16* %204
%206 = zext i16 %205 to i32
%207 = getelementptr inbounds i16, i16* %190, i64 2
%208 = load i16, i16* %207
%209 = zext i16 %208 to i32
%210 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 2, i32 %206, i32 %209)
%211 = getelementptr inbounds i16, i16* %189, i64 3
%212 = load i16, i16* %211
%213 = zext i16 %212 to i32
%214 = getelementptr inbounds i16, i16* %190, i64 3
%215 = load i16, i16* %214
%216 = zext i16 %215 to i32
%217 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 3, i32 %213, i32 %216)
%218 = getelementptr inbounds i16, i16* %189, i64 4
%219 = load i16, i16* %218
%220 = zext i16 %219 to i32
%221 = getelementptr inbounds i16, i16* %190, i64 4
%222 = load i16, i16* %221
%223 = zext i16 %222 to i32
%224 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 4, i32 %220, i32 %223)
%225 = getelementptr inbounds i16, i16* %189, i64 5
%226 = load i16, i16* %225
%227 = zext i16 %226 to i32
%228 = getelementptr inbounds i16, i16* %190, i64 5
%229 = load i16, i16* %228
%230 = zext i16 %229 to i32
%231 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 5, i32 %227, i32 %230)
%232 = getelementptr inbounds i16, i16* %189, i64 6
%233 = load i16, i16* %232
%234 = zext i16 %233 to i32
%235 = getelementptr inbounds i16, i16* %190, i64 6
%236 = load i16, i16* %235
%237 = zext i16 %236 to i32
%238 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 6, i32 %234, i32 %237)
%239 = getelementptr inbounds i16, i16* %189, i64 7
%240 = load i16, i16* %239
%241 = zext i16 %240 to i32
%242 = getelementptr inbounds i16, i16* %190, i64 7
%243 = load i16, i16* %242
%244 = zext i16 %243 to i32
%245 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 7, i32 %241, i32 %244)
br label %266
246: ; preds = %17
%247 = call i32 @reed_sol_galois_w16_region_multby_2(i8* %22, i32 16)
%248 = load i32, i32* %87
%249 = load i32, i32* %86
%250 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 0, i32 %248, i32 %249)
%251 = getelementptr inbounds i32, i32* %87, i64 1
%252 = load i32, i32* %251
%253 = getelementptr inbounds i32, i32* %86, i64 1
%254 = load i32, i32* %253
%255 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 1, i32 %252, i32 %254)
%256 = getelementptr inbounds i32, i32* %87, i64 2
%257 = load i32, i32* %256
%258 = getelementptr inbounds i32, i32* %86, i64 2
%259 = load i32, i32* %258
%260 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 2, i32 %257, i32 %259)
%261 = getelementptr inbounds i32, i32* %87, i64 3
%262 = load i32, i32* %261
%263 = getelementptr inbounds i32, i32* %86, i64 3
%264 = load i32, i32* %263
%265 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 3, i32 %262, i32 %264)
br label %266
266: ; preds = %246, %188, %90, %17
ret i32 0
}