#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 */
struct timeval {
  int /*<<< orphan*/ tv_usec;
};

/* Variables and functions */
int crc16(int, unsigned char *, int);
int crc32_be(int, unsigned char *, int);
int crc32_le(int, unsigned char *, int);
unsigned int crc_ccitt(int, unsigned char *, int);
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int random();
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int main() {
  int i;
  struct timeval tv;
  unsigned char buf[1024];
  int j;
  struct crc_result {
    unsigned int init;
    unsigned int offset;
    unsigned int length;
    unsigned int result;
  } result[32];
  if (gettimeofday(&tv, NULL)) {
    perror("gettimeofday failed");
    return 1;
  }
  srandom(tv.tv_usec);
  for (i = 0; i < 1024; i++)
    buf[i] = random();
  printf("static const char test_data[%d] = {\n", 1024);
  for (i = 0; i < 1024; i += 8) {
    printf("\t");
    for (j = 0; j < 8; j++) {
      printf("0x%02x,", buf[i + j]);
      if (j < 7)
        printf(" ");
      else
        printf("\n");
    }
  }
  printf("};\n\n");
  printf("struct test_result {\n");
  printf("\tint init;\n");
  printf("\tint offset;\n");
  printf("\tint length;\n");
  printf("\tint result;\n");
  printf("};\n\n");
  for (i = 0; i < 32; i++) {
    result[i].init = random() & 0xffff;
    result[i].offset = random() & 0x3f;
    result[i].length = random() & 0x1ff;
    result[i].result =
        crc_ccitt(result[i].init, buf + result[i].offset, result[i].length);
  }
  printf("static const struct test_result crc_ccitt_result[%d] = {\n", 32);
  for (i = 0; i < 32; i++) {
    printf("\t{0x%08x, ", result[i].init);
    printf("%2d, ", result[i].offset);
    printf("%4d, ", result[i].length);
    printf("0x%08x},\n", result[i].result);
  }
  printf("};\n\n");
  for (i = 0; i < 32; i++) {
    result[i].init = random() & 0xffff;
    result[i].offset = random() & 0x3f;
    result[i].length = random() & 0x1ff;
    result[i].result =
        crc16(result[i].init, buf + result[i].offset, result[i].length);
  }
  printf("static const struct test_result crc16_result[%d] = {\n", 32);
  for (i = 0; i < 32; i++) {
    printf("\t{0x%08x, ", result[i].init);
    printf("%2d, ", result[i].offset);
    printf("%4d, ", result[i].length);
    printf("0x%08x},\n", result[i].result);
  }
  printf("};\n\n");
  for (i = 0; i < 32; i++) {
    result[i].init = random() & 0xffff;
    result[i].init = (result[i].init << 16) | (random() & 0xffff);
    result[i].offset = random() & 0x3f;
    result[i].length = random() & 0x1ff;
    result[i].result =
        crc32_le(result[i].init, buf + result[i].offset, result[i].length);
  }
  printf("static const struct test_result crc32_le_result[%d] = {\n", 32);
  for (i = 0; i < 32; i++) {
    printf("\t{0x%08x, ", result[i].init);
    printf("%2d, ", result[i].offset);
    printf("%4d, ", result[i].length);
    printf("0x%08x},\n", result[i].result);
  }
  printf("};\n\n");
  for (i = 0; i < 32; i++) {
    result[i].init = random() & 0xffff;
    result[i].init = (result[i].init << 16) | (random() & 0xffff);
    result[i].offset = random() & 0x3f;
    result[i].length = random() & 0x1ff;
    result[i].result =
        crc32_be(result[i].init, buf + result[i].offset, result[i].length);
  }
  printf("static const struct test_result crc32_be_result[%d] = {\n", 32);
  for (i = 0; i < 32; i++) {
    printf("\t{0x%08x, ", result[i].init);
    printf("%2d, ", result[i].offset);
    printf("%4d, ", result[i].length);
    printf("0x%08x},\n", result[i].result);
  }
  printf("};\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x630,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gettimeofday@plt>
cmp    $0x0,%rax
je     11d1 <main+0x41>
lea    0xe40(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1aa1 <main+0x911>
mov    -0x10(%rbp),%edi
call   1040 <srandom@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x400,-0x8(%rbp)
jge    120f <main+0x7f>
mov    $0x0,%al
call   1090 <random@plt>
mov    %al,%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x410(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11e0 <main+0x50>
lea    0xdfe(%rip),%rdi
mov    $0x400,%esi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x400,-0x8(%rbp)
jge    12d6 <main+0x146>
lea    0xdfc(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x414(%rbp)
cmpl   $0x8,-0x414(%rbp)
jge    12c3 <main+0x133>
mov    -0x8(%rbp),%eax
add    -0x414(%rbp),%eax
cltq
movzbl -0x410(%rbp,%rax,1),%esi
ff
lea    0xdc6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
cmpl   $0x7,-0x414(%rbp)
jge    129c <main+0x10c>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    12aa <main+0x11a>
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    12af <main+0x11f>
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
jmp    124e <main+0xbe>
jmp    12c8 <main+0x138>
mov    -0x8(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x8(%rbp)
jmp    1229 <main+0x99>
lea    0xd66(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd5d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd65(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd63(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd63(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd63(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd12(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    1423 <main+0x293>
mov    $0x0,%al
call   1090 <random@plt>
mov    %eax,%ecx
and    $0xffff,%ecx
movslq -0x8(%rbp),%rdx
lea    -0x620(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1090 <random@plt>
mov    %eax,%ecx
and    $0x3f,%ecx
movslq -0x8(%rbp),%rdx
lea    -0x620(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,0x4(%rax)
mov    $0x0,%al
call   1090 <random@plt>
mov    %eax,%ecx
and    $0x1ff,%ecx
movslq -0x8(%rbp),%rdx
lea    -0x620(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,0x8(%rax)
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%edi
lea    -0x410(%rbp),%rsi
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x4(%rax),%eax
add    %rax,%rsi
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%edx
call   1050 <crc_ccitt@plt>
mov    %eax,%ecx
movslq -0x8(%rbp),%rdx
lea    -0x620(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,0xc(%rax)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    133f <main+0x1af>
lea    0xc6a(%rip),%rdi
mov    $0x20,%esi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    14e0 <main+0x350>
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%esi
lea    0xc6c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x4(%rax),%esi
lea    0xc54(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%esi
lea    0xc37(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0xc(%rax),%esi
lea    0xc1a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    143d <main+0x2ad>
lea    0xb5c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    15d9 <main+0x449>
mov    $0x0,%al
call   1090 <random@plt>
mov    %eax,%ecx
and    $0xffff,%ecx
movslq -0x8(%rbp),%rdx
lea    -0x620(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1090 <random@plt>
mov    %eax,%ecx
and    $0x3f,%ecx
movslq -0x8(%rbp),%rdx
lea    -0x620(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,0x4(%rax)
mov    $0x0,%al
call   1090 <random@plt>
mov    %eax,%ecx
and    $0x1ff,%ecx
movslq -0x8(%rbp),%rdx
lea    -0x620(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,0x8(%rax)
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%edi
lea    -0x410(%rbp),%rsi
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x4(%rax),%eax
add    %rax,%rsi
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%edx
call   10b0 <crc16@plt>
mov    %eax,%ecx
movslq -0x8(%rbp),%rdx
lea    -0x620(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,0xc(%rax)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    14f5 <main+0x365>
lea    0xb0f(%rip),%rdi
mov    $0x20,%esi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    1696 <main+0x506>
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%esi
lea    0xab6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x4(%rax),%esi
lea    0xa9e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%esi
lea    0xa81(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0xc(%rax),%esi
lea    0xa64(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    15f3 <main+0x463>
lea    0x9a6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    17d4 <main+0x644>
mov    $0x0,%al
call   1090 <random@plt>
mov    %eax,%ecx
and    $0xffff,%ecx
movslq -0x8(%rbp),%rdx
lea    -0x620(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,(%rax)
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%eax
shl    $0x10,%eax
mov    %eax,-0x624(%rbp)
mov    $0x0,%al
call   1090 <random@plt>
mov    -0x624(%rbp),%ecx
and    $0xffff,%eax
or     %eax,%ecx
movslq -0x8(%rbp),%rdx
lea    -0x620(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1090 <random@plt>
mov    %eax,%ecx
and    $0x3f,%ecx
movslq -0x8(%rbp),%rdx
lea    -0x620(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,0x4(%rax)
mov    $0x0,%al
call   1090 <random@plt>
mov    %eax,%ecx
and    $0x1ff,%ecx
movslq -0x8(%rbp),%rdx
lea    -0x620(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,0x8(%rax)
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%edi
lea    -0x410(%rbp),%rsi
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x4(%rax),%eax
add    %rax,%rsi
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%edx
call   1030 <crc32_le@plt>
mov    %eax,%ecx
movslq -0x8(%rbp),%rdx
lea    -0x620(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,0xc(%rax)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    16ab <main+0x51b>
lea    0x94a(%rip),%rdi
mov    $0x20,%esi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    1891 <main+0x701>
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%esi
lea    0x8bb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x4(%rax),%esi
lea    0x8a3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%esi
lea    0x886(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0xc(%rax),%esi
lea    0x869(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    17ee <main+0x65e>
lea    0x7ab(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    19cf <main+0x83f>
mov    $0x0,%al
call   1090 <random@plt>
mov    %eax,%ecx
and    $0xffff,%ecx
movslq -0x8(%rbp),%rdx
lea    -0x620(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,(%rax)
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%eax
shl    $0x10,%eax
mov    %eax,-0x628(%rbp)
mov    $0x0,%al
call   1090 <random@plt>
mov    -0x628(%rbp),%ecx
and    $0xffff,%eax
or     %eax,%ecx
movslq -0x8(%rbp),%rdx
lea    -0x620(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1090 <random@plt>
mov    %eax,%ecx
and    $0x3f,%ecx
movslq -0x8(%rbp),%rdx
lea    -0x620(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,0x4(%rax)
mov    $0x0,%al
call   1090 <random@plt>
mov    %eax,%ecx
and    $0x1ff,%ecx
movslq -0x8(%rbp),%rdx
lea    -0x620(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,0x8(%rax)
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%edi
lea    -0x410(%rbp),%rsi
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x4(%rax),%eax
add    %rax,%rsi
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%edx
call   1080 <crc32_be@plt>
mov    %eax,%ecx
movslq -0x8(%rbp),%rdx
lea    -0x620(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,0xc(%rax)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    18a6 <main+0x716>
lea    0x788(%rip),%rdi
mov    $0x20,%esi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    1a8c <main+0x8fc>
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%esi
lea    0x6c0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x4(%rax),%esi
lea    0x6a8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%esi
lea    0x68b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movslq -0x8(%rbp),%rcx
lea    -0x620(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0xc(%rax),%esi
lea    0x66e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    19e9 <main+0x859>
lea    0x5b0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x630,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x610,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1090 <gettimeofday@plt>
test   %rax,%rax
jne    1753 <main+0x5a3>
mov    0x8(%rsp),%edi
call   1050 <srandom@plt>
xor    %ebx,%ebx
nop
xor    %eax,%eax
call   10b0 <random@plt>
mov    %al,0x210(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0x400,%rbx
jne    11e0 <main+0x30>
lea    0xe12(%rip),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xfffffffffffffff8,%rbx
lea    0xe1d(%rip),%r14
nopl   0x0(%rax)
mov    $0x9,%edi
call   1030 <putchar@plt>
movzbl 0x218(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movzbl 0x219(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movzbl 0x21a(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movzbl 0x21b(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movzbl 0x21c(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movzbl 0x21d(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movzbl 0x21e(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movzbl 0x21f(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x8,%rbx
cmp    $0x3f8,%rbx
jb     1220 <main+0x70>
lea    0xe69(%rip),%rbx
mov    %rbx,%rdi
call   1070 <puts@plt>
lea    0xe13(%rip),%rdi
call   1070 <puts@plt>
lea    0xe1c(%rip),%rdi
call   1070 <puts@plt>
lea    0xe1b(%rip),%rdi
call   1070 <puts@plt>
lea    0xe1c(%rip),%rdi
call   1070 <puts@plt>
lea    0xe1d(%rip),%rdi
call   1070 <puts@plt>
mov    %rbx,%rdi
call   1070 <puts@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   10b0 <random@plt>
movzwl %ax,%eax
mov    %eax,0x10(%rsp,%rbx,1)
xor    %eax,%eax
call   10b0 <random@plt>
and    $0x3f,%eax
mov    %eax,0x14(%rsp,%rbx,1)
xor    %eax,%eax
call   10b0 <random@plt>
and    $0x1ff,%eax
mov    %eax,0x18(%rsp,%rbx,1)
mov    0x10(%rsp,%rbx,1),%edi
mov    0x14(%rsp,%rbx,1),%ecx
lea    (%rsp,%rcx,1),%rsi
add    $0x210,%rsi
mov    %eax,%edx
call   1060 <crc_ccitt@plt>
mov    %eax,0x1c(%rsp,%rbx,1)
add    $0x10,%rbx
cmp    $0x200,%rbx
jne    1370 <main+0x1c0>
lea    0xc73(%rip),%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xc9a(%rip),%r14
lea    0xc9e(%rip),%r15
lea    0xc9d(%rip),%r12
lea    0xc9c(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp,%rbp,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x14(%rsp,%rbp,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x18(%rsp,%rbp,1),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x1c(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
add    $0x10,%rbp
cmp    $0x200,%rbp
jne    1400 <main+0x250>
lea    0xd3f(%rip),%rdi
call   1070 <puts@plt>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   10b0 <random@plt>
movzwl %ax,%eax
mov    %eax,0x10(%rsp,%rbx,1)
xor    %eax,%eax
call   10b0 <random@plt>
and    $0x3f,%eax
mov    %eax,0x14(%rsp,%rbx,1)
xor    %eax,%eax
call   10b0 <random@plt>
and    $0x1ff,%eax
mov    %eax,0x18(%rsp,%rbx,1)
mov    0x10(%rsp,%rbx,1),%edi
mov    0x14(%rsp,%rbx,1),%ecx
lea    (%rsp,%rcx,1),%rsi
add    $0x210,%rsi
mov    %eax,%edx
call   10d0 <crc16@plt>
mov    %eax,0x1c(%rsp,%rbx,1)
add    $0x10,%rbx
cmp    $0x200,%rbx
jne    1460 <main+0x2b0>
lea    0xbde(%rip),%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xbaa(%rip),%r14
lea    0xbae(%rip),%r15
lea    0xbad(%rip),%r12
lea    0xbac(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp,%rbp,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x14(%rsp,%rbp,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x18(%rsp,%rbp,1),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x1c(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
add    $0x10,%rbp
cmp    $0x200,%rbp
jne    14f0 <main+0x340>
lea    0xc4f(%rip),%rdi
call   1070 <puts@plt>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   10b0 <random@plt>
mov    %eax,%ebp
movzwl %bp,%eax
mov    %eax,0x10(%rsp,%rbx,1)
shl    $0x10,%ebp
xor    %eax,%eax
call   10b0 <random@plt>
movzwl %ax,%eax
or     %ebp,%eax
mov    %eax,0x10(%rsp,%rbx,1)
xor    %eax,%eax
call   10b0 <random@plt>
and    $0x3f,%eax
mov    %eax,0x14(%rsp,%rbx,1)
xor    %eax,%eax
call   10b0 <random@plt>
and    $0x1ff,%eax
mov    %eax,0x18(%rsp,%rbx,1)
mov    0x10(%rsp,%rbx,1),%edi
mov    0x14(%rsp,%rbx,1),%ecx
lea    (%rsp,%rcx,1),%rsi
add    $0x210,%rsi
mov    %eax,%edx
call   1040 <crc32_le@plt>
mov    %eax,0x1c(%rsp,%rbx,1)
add    $0x10,%rbx
cmp    $0x200,%rbx
jne    1550 <main+0x3a0>
lea    0xb0f(%rip),%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xaa5(%rip),%r14
lea    0xaa9(%rip),%r15
lea    0xaa8(%rip),%r12
lea    0xaa7(%rip),%rbx
xor    %ebp,%ebp
nopl   (%rax)
mov    0x10(%rsp,%rbp,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x14(%rsp,%rbp,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x18(%rsp,%rbp,1),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x1c(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
add    $0x10,%rbp
cmp    $0x200,%rbp
jne    15f0 <main+0x440>
lea    0xb4f(%rip),%rdi
call   1070 <puts@plt>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   10b0 <random@plt>
mov    %eax,%ebx
movzwl %bx,%eax
mov    %eax,0x10(%rsp,%rbp,1)
shl    $0x10,%ebx
xor    %eax,%eax
call   10b0 <random@plt>
movzwl %ax,%eax
or     %ebx,%eax
mov    %eax,0x10(%rsp,%rbp,1)
xor    %eax,%eax
call   10b0 <random@plt>
and    $0x3f,%eax
mov    %eax,0x14(%rsp,%rbp,1)
xor    %eax,%eax
call   10b0 <random@plt>
and    $0x1ff,%eax
mov    %eax,0x18(%rsp,%rbp,1)
mov    0x10(%rsp,%rbp,1),%edi
mov    0x14(%rsp,%rbp,1),%ecx
lea    (%rsp,%rcx,1),%rsi
add    $0x210,%rsi
mov    %eax,%edx
call   10a0 <crc32_be@plt>
mov    %eax,0x1c(%rsp,%rbp,1)
add    $0x10,%rbp
cmp    $0x200,%rbp
jne    1650 <main+0x4a0>
lea    0xa48(%rip),%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0x9a5(%rip),%r14
lea    0x9a9(%rip),%r15
lea    0x9a8(%rip),%r12
lea    0x9a7(%rip),%rbx
xor    %ebp,%ebp
nopl   (%rax)
mov    0x10(%rsp,%rbp,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x14(%rsp,%rbp,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x18(%rsp,%rbp,1),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x1c(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
add    $0x10,%rbp
cmp    $0x200,%rbp
jne    16f0 <main+0x540>
lea    0xa4f(%rip),%rdi
call   1070 <puts@plt>
xor    %eax,%eax
add    $0x610,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x8a6(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%eax
jmp    1743 <main+0x593>

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.crc_result = type { i32, i32, i32, i32 }
@.str = [20 x i8] c"gettimeofday failed\00"
@.str.1 = [37 x i8] c"static const char test_data[%d] = {\0A\00"
@.str.2 = [2 x i8] c"\09\00"
@.str.3 = [8 x i8] c"0x%02x,\00"
@.str.4 = [2 x i8] c" \00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [5 x i8] c"};\0A\0A\00"
@.str.7 = [22 x i8] c"struct test_result {\0A\00"
@.str.8 = [12 x i8] c"\09int init;\0A\00"
@.str.9 = [14 x i8] c"\09int offset;\0A\00"
@.str.10 = [14 x i8] c"\09int length;\0A\00"
@.str.11 = [14 x i8] c"\09int result;\0A\00"
@.str.12 = [58 x i8] c"static const struct test_result crc_ccitt_result[%d] = {\0A\00"
@.str.13 = [11 x i8] c"\09{0x%08x, \00"
@.str.14 = [6 x i8] c"%2d, \00"
@.str.15 = [6 x i8] c"%4d, \00"
@.str.16 = [10 x i8] c"0x%08x},\0A\00"
@.str.17 = [54 x i8] c"static const struct test_result crc16_result[%d] = {\0A\00"
@.str.18 = [57 x i8] c"static const struct test_result crc32_le_result[%d] = {\0A\00"
@.str.19 = [57 x i8] c"static const struct test_result crc32_be_result[%d] = {\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.timeval
%4 = alloca [1024 x i8]
%5 = alloca i32
%6 = alloca [32 x %struct.crc_result]
store i32 0, i32* %1
%7 = call i64 @gettimeofday(%struct.timeval* %3, i32* null)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %426
11: ; preds = %0
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%13 = load i32, i32* %12
%14 = call i32 @srandom(i32 %13)
store i32 0, i32* %2
br label %15
15: ; preds = %24, %11
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 1024
br i1 %17, label %18, label %27
18: ; preds = %15
%19 = call i32 (...) @random()
%20 = trunc i32 %19 to i8
%21 = load i32, i32* %2
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %22
store i8 %20, i8* %23
br label %24
24: ; preds = %18
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
br label %15
27: ; preds = %15
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 1024)
store i32 0, i32* %2
br label %29
29: ; preds = %57, %27
%30 = load i32, i32* %2
%31 = icmp slt i32 %30, 1024
br i1 %31, label %32, label %60
32: ; preds = %29
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %5
br label %34
34: ; preds = %53, %32
%35 = load i32, i32* %5
%36 = icmp slt i32 %35, 8
br i1 %36, label %37, label %56
37: ; preds = %34
%38 = load i32, i32* %2
%39 = load i32, i32* %5
%40 = add nsw i32 %38, %39
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %41
%43 = load i8, i8* %42
%44 = zext i8 %43 to i32
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %44)
%46 = load i32, i32* %5
%47 = icmp slt i32 %46, 7
br i1 %47, label %48, label %50
48: ; preds = %37
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %52
50: ; preds = %37
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %52
52: ; preds = %50, %48
br label %53
53: ; preds = %52
%54 = load i32, i32* %5
%55 = add nsw i32 %54, 1
store i32 %55, i32* %5
br label %34
56: ; preds = %34
br label %57
57: ; preds = %56
%58 = load i32, i32* %2
%59 = add nsw i32 %58, 8
store i32 %59, i32* %2
br label %29
60: ; preds = %29
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0))
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %2
br label %68
68: ; preds = %113, %60
%69 = load i32, i32* %2
%70 = icmp slt i32 %69, 32
br i1 %70, label %71, label %116
71: ; preds = %68
%72 = call i32 (...) @random()
%73 = and i32 %72, 65535
%74 = load i32, i32* %2
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %75
%77 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %76, i32 0, i32 0
store i32 %73, i32* %77
%78 = call i32 (...) @random()
%79 = and i32 %78, 63
%80 = load i32, i32* %2
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %81
%83 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %82, i32 0, i32 1
store i32 %79, i32* %83
%84 = call i32 (...) @random()
%85 = and i32 %84, 511
%86 = load i32, i32* %2
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %87
%89 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %88, i32 0, i32 2
store i32 %85, i32* %89
%90 = load i32, i32* %2
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %91
%93 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %92, i32 0, i32 0
%94 = load i32, i32* %93
%95 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%96 = load i32, i32* %2
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %97
%99 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %98, i32 0, i32 1
%100 = load i32, i32* %99
%101 = zext i32 %100 to i64
%102 = getelementptr inbounds i8, i8* %95, i64 %101
%103 = load i32, i32* %2
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %104
%106 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %105, i32 0, i32 2
%107 = load i32, i32* %106
%108 = call i32 @crc_ccitt(i32 %94, i8* %102, i32 %107)
%109 = load i32, i32* %2
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %110
%112 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %111, i32 0, i32 3
store i32 %108, i32* %112
br label %113
113: ; preds = %71
%114 = load i32, i32* %2
%115 = add nsw i32 %114, 1
store i32 %115, i32* %2
br label %68
116: ; preds = %68
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.12, i64 0, i64 0), i32 32)
store i32 0, i32* %2
br label %118
118: ; preds = %146, %116
%119 = load i32, i32* %2
%120 = icmp slt i32 %119, 32
br i1 %120, label %121, label %149
121: ; preds = %118
%122 = load i32, i32* %2
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %123
%125 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %124, i32 0, i32 0
%126 = load i32, i32* %125
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i32 %126)
%128 = load i32, i32* %2
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %129
%131 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %130, i32 0, i32 1
%132 = load i32, i32* %131
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i32 %132)
%134 = load i32, i32* %2
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %135
%137 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %136, i32 0, i32 2
%138 = load i32, i32* %137
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i32 %138)
%140 = load i32, i32* %2
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %141
%143 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %142, i32 0, i32 3
%144 = load i32, i32* %143
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0), i32 %144)
br label %146
146: ; preds = %121
%147 = load i32, i32* %2
%148 = add nsw i32 %147, 1
store i32 %148, i32* %2
br label %118
149: ; preds = %118
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %2
br label %151
151: ; preds = %196, %149
%152 = load i32, i32* %2
%153 = icmp slt i32 %152, 32
br i1 %153, label %154, label %199
154: ; preds = %151
%155 = call i32 (...) @random()
%156 = and i32 %155, 65535
%157 = load i32, i32* %2
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %158
%160 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %159, i32 0, i32 0
store i32 %156, i32* %160
%161 = call i32 (...) @random()
%162 = and i32 %161, 63
%163 = load i32, i32* %2
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %164
%166 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %165, i32 0, i32 1
store i32 %162, i32* %166
%167 = call i32 (...) @random()
%168 = and i32 %167, 511
%169 = load i32, i32* %2
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %170
%172 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %171, i32 0, i32 2
store i32 %168, i32* %172
%173 = load i32, i32* %2
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %174
%176 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %175, i32 0, i32 0
%177 = load i32, i32* %176
%178 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%179 = load i32, i32* %2
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %180
%182 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %181, i32 0, i32 1
%183 = load i32, i32* %182
%184 = zext i32 %183 to i64
%185 = getelementptr inbounds i8, i8* %178, i64 %184
%186 = load i32, i32* %2
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %187
%189 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %188, i32 0, i32 2
%190 = load i32, i32* %189
%191 = call i32 @crc16(i32 %177, i8* %185, i32 %190)
%192 = load i32, i32* %2
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %193
%195 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %194, i32 0, i32 3
store i32 %191, i32* %195
br label %196
196: ; preds = %154
%197 = load i32, i32* %2
%198 = add nsw i32 %197, 1
store i32 %198, i32* %2
br label %151
199: ; preds = %151
%200 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.17, i64 0, i64 0), i32 32)
store i32 0, i32* %2
br label %201
201: ; preds = %229, %199
%202 = load i32, i32* %2
%203 = icmp slt i32 %202, 32
br i1 %203, label %204, label %232
204: ; preds = %201
%205 = load i32, i32* %2
%206 = sext i32 %205 to i64
%207 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %206
%208 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %207, i32 0, i32 0
%209 = load i32, i32* %208
%210 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i32 %209)
%211 = load i32, i32* %2
%212 = sext i32 %211 to i64
%213 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %212
%214 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %213, i32 0, i32 1
%215 = load i32, i32* %214
%216 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i32 %215)
%217 = load i32, i32* %2
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %218
%220 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %219, i32 0, i32 2
%221 = load i32, i32* %220
%222 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i32 %221)
%223 = load i32, i32* %2
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %224
%226 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %225, i32 0, i32 3
%227 = load i32, i32* %226
%228 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0), i32 %227)
br label %229
229: ; preds = %204
%230 = load i32, i32* %2
%231 = add nsw i32 %230, 1
store i32 %231, i32* %2
br label %201
232: ; preds = %201
%233 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %2
br label %234
234: ; preds = %292, %232
%235 = load i32, i32* %2
%236 = icmp slt i32 %235, 32
br i1 %236, label %237, label %295
237: ; preds = %234
%238 = call i32 (...) @random()
%239 = and i32 %238, 65535
%240 = load i32, i32* %2
%241 = sext i32 %240 to i64
%242 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %241
%243 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %242, i32 0, i32 0
store i32 %239, i32* %243
%244 = load i32, i32* %2
%245 = sext i32 %244 to i64
%246 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %245
%247 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %246, i32 0, i32 0
%248 = load i32, i32* %247
%249 = shl i32 %248, 16
%250 = call i32 (...) @random()
%251 = and i32 %250, 65535
%252 = or i32 %249, %251
%253 = load i32, i32* %2
%254 = sext i32 %253 to i64
%255 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %254
%256 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %255, i32 0, i32 0
store i32 %252, i32* %256
%257 = call i32 (...) @random()
%258 = and i32 %257, 63
%259 = load i32, i32* %2
%260 = sext i32 %259 to i64
%261 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %260
%262 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %261, i32 0, i32 1
store i32 %258, i32* %262
%263 = call i32 (...) @random()
%264 = and i32 %263, 511
%265 = load i32, i32* %2
%266 = sext i32 %265 to i64
%267 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %266
%268 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %267, i32 0, i32 2
store i32 %264, i32* %268
%269 = load i32, i32* %2
%270 = sext i32 %269 to i64
%271 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %270
%272 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %271, i32 0, i32 0
%273 = load i32, i32* %272
%274 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%275 = load i32, i32* %2
%276 = sext i32 %275 to i64
%277 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %276
%278 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %277, i32 0, i32 1
%279 = load i32, i32* %278
%280 = zext i32 %279 to i64
%281 = getelementptr inbounds i8, i8* %274, i64 %280
%282 = load i32, i32* %2
%283 = sext i32 %282 to i64
%284 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %283
%285 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %284, i32 0, i32 2
%286 = load i32, i32* %285
%287 = call i32 @crc32_le(i32 %273, i8* %281, i32 %286)
%288 = load i32, i32* %2
%289 = sext i32 %288 to i64
%290 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %289
%291 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %290, i32 0, i32 3
store i32 %287, i32* %291
br label %292
292: ; preds = %237
%293 = load i32, i32* %2
%294 = add nsw i32 %293, 1
store i32 %294, i32* %2
br label %234
295: ; preds = %234
%296 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.18, i64 0, i64 0), i32 32)
store i32 0, i32* %2
br label %297
297: ; preds = %325, %295
%298 = load i32, i32* %2
%299 = icmp slt i32 %298, 32
br i1 %299, label %300, label %328
300: ; preds = %297
%301 = load i32, i32* %2
%302 = sext i32 %301 to i64
%303 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %302
%304 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %303, i32 0, i32 0
%305 = load i32, i32* %304
%306 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i32 %305)
%307 = load i32, i32* %2
%308 = sext i32 %307 to i64
%309 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %308
%310 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %309, i32 0, i32 1
%311 = load i32, i32* %310
%312 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i32 %311)
%313 = load i32, i32* %2
%314 = sext i32 %313 to i64
%315 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %314
%316 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %315, i32 0, i32 2
%317 = load i32, i32* %316
%318 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i32 %317)
%319 = load i32, i32* %2
%320 = sext i32 %319 to i64
%321 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %320
%322 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %321, i32 0, i32 3
%323 = load i32, i32* %322
%324 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0), i32 %323)
br label %325
325: ; preds = %300
%326 = load i32, i32* %2
%327 = add nsw i32 %326, 1
store i32 %327, i32* %2
br label %297
328: ; preds = %297
%329 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %2
br label %330
330: ; preds = %388, %328
%331 = load i32, i32* %2
%332 = icmp slt i32 %331, 32
br i1 %332, label %333, label %391
333: ; preds = %330
%334 = call i32 (...) @random()
%335 = and i32 %334, 65535
%336 = load i32, i32* %2
%337 = sext i32 %336 to i64
%338 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %337
%339 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %338, i32 0, i32 0
store i32 %335, i32* %339
%340 = load i32, i32* %2
%341 = sext i32 %340 to i64
%342 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %341
%343 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %342, i32 0, i32 0
%344 = load i32, i32* %343
%345 = shl i32 %344, 16
%346 = call i32 (...) @random()
%347 = and i32 %346, 65535
%348 = or i32 %345, %347
%349 = load i32, i32* %2
%350 = sext i32 %349 to i64
%351 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %350
%352 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %351, i32 0, i32 0
store i32 %348, i32* %352
%353 = call i32 (...) @random()
%354 = and i32 %353, 63
%355 = load i32, i32* %2
%356 = sext i32 %355 to i64
%357 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %356
%358 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %357, i32 0, i32 1
store i32 %354, i32* %358
%359 = call i32 (...) @random()
%360 = and i32 %359, 511
%361 = load i32, i32* %2
%362 = sext i32 %361 to i64
%363 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %362
%364 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %363, i32 0, i32 2
store i32 %360, i32* %364
%365 = load i32, i32* %2
%366 = sext i32 %365 to i64
%367 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %366
%368 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %367, i32 0, i32 0
%369 = load i32, i32* %368
%370 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%371 = load i32, i32* %2
%372 = sext i32 %371 to i64
%373 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %372
%374 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %373, i32 0, i32 1
%375 = load i32, i32* %374
%376 = zext i32 %375 to i64
%377 = getelementptr inbounds i8, i8* %370, i64 %376
%378 = load i32, i32* %2
%379 = sext i32 %378 to i64
%380 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %379
%381 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %380, i32 0, i32 2
%382 = load i32, i32* %381
%383 = call i32 @crc32_be(i32 %369, i8* %377, i32 %382)
%384 = load i32, i32* %2
%385 = sext i32 %384 to i64
%386 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %385
%387 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %386, i32 0, i32 3
store i32 %383, i32* %387
br label %388
388: ; preds = %333
%389 = load i32, i32* %2
%390 = add nsw i32 %389, 1
store i32 %390, i32* %2
br label %330
391: ; preds = %330
%392 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.19, i64 0, i64 0), i32 32)
store i32 0, i32* %2
br label %393
393: ; preds = %421, %391
%394 = load i32, i32* %2
%395 = icmp slt i32 %394, 32
br i1 %395, label %396, label %424
396: ; preds = %393
%397 = load i32, i32* %2
%398 = sext i32 %397 to i64
%399 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %398
%400 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %399, i32 0, i32 0
%401 = load i32, i32* %400
%402 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i32 %401)
%403 = load i32, i32* %2
%404 = sext i32 %403 to i64
%405 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %404
%406 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %405, i32 0, i32 1
%407 = load i32, i32* %406
%408 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i32 %407)
%409 = load i32, i32* %2
%410 = sext i32 %409 to i64
%411 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %410
%412 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %411, i32 0, i32 2
%413 = load i32, i32* %412
%414 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i32 %413)
%415 = load i32, i32* %2
%416 = sext i32 %415 to i64
%417 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %6, i64 0, i64 %416
%418 = getelementptr inbounds %struct.crc_result, %struct.crc_result* %417, i32 0, i32 3
%419 = load i32, i32* %418
%420 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0), i32 %419)
br label %421
421: ; preds = %396
%422 = load i32, i32* %2
%423 = add nsw i32 %422, 1
store i32 %423, i32* %2
br label %393
424: ; preds = %393
%425 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %1
br label %426
426: ; preds = %424, %9
%427 = load i32, i32* %1
ret i32 %427
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.crc_result = type { i32, i32, i32, i32 }
@.str = [20 x i8] c"gettimeofday failed\00"
@.str.1 = [37 x i8] c"static const char test_data[%d] = {\0A\00"
@.str.3 = [8 x i8] c"0x%02x,\00"
@.str.12 = [58 x i8] c"static const struct test_result crc_ccitt_result[%d] = {\0A\00"
@.str.13 = [11 x i8] c"\09{0x%08x, \00"
@.str.14 = [6 x i8] c"%2d, \00"
@.str.15 = [6 x i8] c"%4d, \00"
@.str.16 = [10 x i8] c"0x%08x},\0A\00"
@.str.17 = [54 x i8] c"static const struct test_result crc16_result[%d] = {\0A\00"
@.str.18 = [57 x i8] c"static const struct test_result crc32_le_result[%d] = {\0A\00"
@.str.19 = [57 x i8] c"static const struct test_result crc32_be_result[%d] = {\0A\00"
@str.20 = [21 x i8] c"struct test_result {\00"
@str.21 = [11 x i8] c"\09int init;\00"
@str.22 = [13 x i8] c"\09int offset;\00"
@str.23 = [13 x i8] c"\09int length;\00"
@str.24 = [13 x i8] c"\09int result;\00"
@str.29 = [4 x i8] c"};\0A\00"
define i32 @main() {
%1 = alloca %struct.timeval
%2 = alloca [1024 x i8]
%3 = alloca [32 x %struct.crc_result]
%4 = bitcast %struct.timeval* %1 to i8*
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%6 = bitcast [32 x %struct.crc_result]* %3 to i8*
%7 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = tail call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %248
11: ; preds = %0
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%13 = load i32, i32* %12
%14 = tail call i32 @srandom(i32 %13)
br label %15
15: ; preds = %11, %15
%16 = phi i64 [ 0, %11 ], [ %20, %15 ]
%17 = tail call i32 (...) @random()
%18 = trunc i32 %17 to i8
%19 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %16
store i8 %18, i8* %19
%20 = add nuw nsw i64 %16, 1
%21 = icmp eq i64 %20, 1024
br i1 %21, label %22, label %15
22: ; preds = %15
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 1024)
br label %24
24: ; preds = %22, %24
%25 = phi i64 [ 0, %22 ], [ %74, %24 ]
%26 = tail call i32 @putchar(i32 9)
%27 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %25
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %29)
%31 = tail call i32 @putchar(i32 32)
%32 = or i64 %25, 1
%33 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %35)
%37 = tail call i32 @putchar(i32 32)
%38 = or i64 %25, 2
%39 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %41)
%43 = tail call i32 @putchar(i32 32)
%44 = or i64 %25, 3
%45 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %44
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %47)
%49 = tail call i32 @putchar(i32 32)
%50 = or i64 %25, 4
%51 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %50
%52 = load i8, i8* %51
%53 = zext i8 %52 to i32
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %53)
%55 = tail call i32 @putchar(i32 32)
%56 = or i64 %25, 5
%57 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %56
%58 = load i8, i8* %57
%59 = zext i8 %58 to i32
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %59)
%61 = tail call i32 @putchar(i32 32)
%62 = or i64 %25, 6
%63 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %62
%64 = load i8, i8* %63
%65 = zext i8 %64 to i32
%66 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %65)
%67 = tail call i32 @putchar(i32 32)
%68 = or i64 %25, 7
%69 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %68
%70 = load i8, i8* %69
%71 = zext i8 %70 to i32
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %71)
%73 = tail call i32 @putchar(i32 10)
%74 = add nuw nsw i64 %25, 8
%75 = icmp ult i64 %25, 1016
br i1 %75, label %24, label %76
76: ; preds = %24
%77 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.29, i64 0, i64 0))
%78 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.20, i64 0, i64 0))
%79 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.21, i64 0, i64 0))
%80 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.22, i64 0, i64 0))
%81 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.23, i64 0, i64 0))
%82 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.24, i64 0, i64 0))
%83 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.29, i64 0, i64 0))
br label %84
84: ; preds = %76, %84
%85 = phi i64 [ 0, %76 ], [ %101, %84 ]
%86 = call i32 (...) @random()
%87 = and i32 %86, 65535
%88 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %85, i32 0
store i32 %87, i32* %88
%89 = call i32 (...) @random()
%90 = and i32 %89, 63
%91 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %85, i32 1
store i32 %90, i32* %91
%92 = call i32 (...) @random()
%93 = and i32 %92, 511
%94 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %85, i32 2
store i32 %93, i32* %94
%95 = load i32, i32* %88
%96 = load i32, i32* %91
%97 = zext i32 %96 to i64
%98 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %97
%99 = call i32 @crc_ccitt(i32 %95, i8* %98, i32 %93)
%100 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %85, i32 3
store i32 %99, i32* %100
%101 = add nuw nsw i64 %85, 1
%102 = icmp eq i64 %101, 32
br i1 %102, label %103, label %84
103: ; preds = %84
%104 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.12, i64 0, i64 0), i32 32)
br label %105
105: ; preds = %103, %105
%106 = phi i64 [ 0, %103 ], [ %119, %105 ]
%107 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %106, i32 0
%108 = load i32, i32* %107
%109 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i32 %108)
%110 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %106, i32 1
%111 = load i32, i32* %110
%112 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i32 %111)
%113 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %106, i32 2
%114 = load i32, i32* %113
%115 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i32 %114)
%116 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %106, i32 3
%117 = load i32, i32* %116
%118 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0), i32 %117)
%119 = add nuw nsw i64 %106, 1
%120 = icmp eq i64 %119, 32
br i1 %120, label %121, label %105
121: ; preds = %105
%122 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.29, i64 0, i64 0))
br label %123
123: ; preds = %121, %123
%124 = phi i64 [ 0, %121 ], [ %140, %123 ]
%125 = call i32 (...) @random()
%126 = and i32 %125, 65535
%127 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %124, i32 0
store i32 %126, i32* %127
%128 = call i32 (...) @random()
%129 = and i32 %128, 63
%130 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %124, i32 1
store i32 %129, i32* %130
%131 = call i32 (...) @random()
%132 = and i32 %131, 511
%133 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %124, i32 2
store i32 %132, i32* %133
%134 = load i32, i32* %127
%135 = load i32, i32* %130
%136 = zext i32 %135 to i64
%137 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %136
%138 = call i32 @crc16(i32 %134, i8* %137, i32 %132)
%139 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %124, i32 3
store i32 %138, i32* %139
%140 = add nuw nsw i64 %124, 1
%141 = icmp eq i64 %140, 32
br i1 %141, label %142, label %123
142: ; preds = %123
%143 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.17, i64 0, i64 0), i32 32)
br label %144
144: ; preds = %142, %144
%145 = phi i64 [ 0, %142 ], [ %158, %144 ]
%146 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %145, i32 0
%147 = load i32, i32* %146
%148 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i32 %147)
%149 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %145, i32 1
%150 = load i32, i32* %149
%151 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i32 %150)
%152 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %145, i32 2
%153 = load i32, i32* %152
%154 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i32 %153)
%155 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %145, i32 3
%156 = load i32, i32* %155
%157 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0), i32 %156)
%158 = add nuw nsw i64 %145, 1
%159 = icmp eq i64 %158, 32
br i1 %159, label %160, label %144
160: ; preds = %144
%161 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.29, i64 0, i64 0))
br label %162
162: ; preds = %160, %162
%163 = phi i64 [ 0, %160 ], [ %183, %162 ]
%164 = call i32 (...) @random()
%165 = and i32 %164, 65535
%166 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %163, i32 0
store i32 %165, i32* %166
%167 = shl i32 %164, 16
%168 = call i32 (...) @random()
%169 = and i32 %168, 65535
%170 = or i32 %169, %167
store i32 %170, i32* %166
%171 = call i32 (...) @random()
%172 = and i32 %171, 63
%173 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %163, i32 1
store i32 %172, i32* %173
%174 = call i32 (...) @random()
%175 = and i32 %174, 511
%176 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %163, i32 2
store i32 %175, i32* %176
%177 = load i32, i32* %166
%178 = load i32, i32* %173
%179 = zext i32 %178 to i64
%180 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %179
%181 = call i32 @crc32_le(i32 %177, i8* %180, i32 %175)
%182 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %163, i32 3
store i32 %181, i32* %182
%183 = add nuw nsw i64 %163, 1
%184 = icmp eq i64 %183, 32
br i1 %184, label %185, label %162
185: ; preds = %162
%186 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.18, i64 0, i64 0), i32 32)
br label %187
187: ; preds = %185, %187
%188 = phi i64 [ 0, %185 ], [ %201, %187 ]
%189 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %188, i32 0
%190 = load i32, i32* %189
%191 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i32 %190)
%192 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %188, i32 1
%193 = load i32, i32* %192
%194 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i32 %193)
%195 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %188, i32 2
%196 = load i32, i32* %195
%197 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i32 %196)
%198 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %188, i32 3
%199 = load i32, i32* %198
%200 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0), i32 %199)
%201 = add nuw nsw i64 %188, 1
%202 = icmp eq i64 %201, 32
br i1 %202, label %203, label %187
203: ; preds = %187
%204 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.29, i64 0, i64 0))
br label %205
205: ; preds = %203, %205
%206 = phi i64 [ 0, %203 ], [ %226, %205 ]
%207 = call i32 (...) @random()
%208 = and i32 %207, 65535
%209 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %206, i32 0
store i32 %208, i32* %209
%210 = shl i32 %207, 16
%211 = call i32 (...) @random()
%212 = and i32 %211, 65535
%213 = or i32 %212, %210
store i32 %213, i32* %209
%214 = call i32 (...) @random()
%215 = and i32 %214, 63
%216 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %206, i32 1
store i32 %215, i32* %216
%217 = call i32 (...) @random()
%218 = and i32 %217, 511
%219 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %206, i32 2
store i32 %218, i32* %219
%220 = load i32, i32* %209
%221 = load i32, i32* %216
%222 = zext i32 %221 to i64
%223 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %222
%224 = call i32 @crc32_be(i32 %220, i8* %223, i32 %218)
%225 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %206, i32 3
store i32 %224, i32* %225
%226 = add nuw nsw i64 %206, 1
%227 = icmp eq i64 %226, 32
br i1 %227, label %228, label %205
228: ; preds = %205
%229 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.19, i64 0, i64 0), i32 32)
br label %230
230: ; preds = %228, %230
%231 = phi i64 [ 0, %228 ], [ %244, %230 ]
%232 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %231, i32 0
%233 = load i32, i32* %232
%234 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i32 %233)
%235 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %231, i32 1
%236 = load i32, i32* %235
%237 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i32 %236)
%238 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %231, i32 2
%239 = load i32, i32* %238
%240 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i32 %239)
%241 = getelementptr inbounds [32 x %struct.crc_result], [32 x %struct.crc_result]* %3, i64 0, i64 %231, i32 3
%242 = load i32, i32* %241
%243 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0), i32 %242)
%244 = add nuw nsw i64 %231, 1
%245 = icmp eq i64 %244, 32
br i1 %245, label %246, label %230
246: ; preds = %230
%247 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.29, i64 0, i64 0))
br label %248
248: ; preds = %246, %9
%249 = phi i32 [ 1, %9 ], [ 0, %246 ]
ret i32 %249
}