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

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ crc16_dump_table(int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ crc32_dump_table(int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ *stdout;
int main(int argc, char *argv[], char **env) {
  FILE *out = stdout;
  fprintf(out, "crc_table_ibm[256] = {\n");
  crc16_dump_table(8, 0xa001, out);
  fprintf(out, "};\n");
  fprintf(out, "crc_table_ibm[32] = {\n");
  crc16_dump_table(5, 0xa001, out);
  fprintf(out, "};\n");
  fprintf(out, "crc32c_table[256] = {\n");
  crc32_dump_table(8, 0x82f63b78, out);
  fprintf(out, "};\n");
  fprintf(out, "crc32c_table_addr5[32] = {\n");
  crc32_dump_table(5, 0x82f63b78, out);
  fprintf(out, "};\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e8f(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%rdx
mov    $0x8,%edi
mov    $0xa001,%esi
call   1040 <crc16_dump_table@plt>
mov    -0x20(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe86(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%rdx
mov    $0x5,%edi
mov    $0xa001,%esi
call   1040 <crc16_dump_table@plt>
mov    -0x20(%rbp),%rdi
lea    0xe5f(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe6a(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%rdx
mov    $0x8,%edi
mov    $0x82f63b78,%esi
call   1030 <crc32_dump_table@plt>
mov    -0x20(%rbp),%rdi
lea    0xe2c(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe4e(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%rdx
mov    $0x5,%edi
mov    $0x82f63b78,%esi
call   1030 <crc32_dump_table@plt>
mov    -0x20(%rbp),%rdi
lea    0xdf9(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ea5(%rip),%rax
mov    (%rax),%rbx
lea    0xebb(%rip),%rdi
mov    $0x17,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    $0x8,%edi
mov    $0xa001,%esi
mov    %rbx,%rdx
call   1040 <crc16_dump_table@plt>
lea    0xea8(%rip),%r14
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xe90(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    $0x5,%edi
mov    $0xa001,%esi
mov    %rbx,%rdx
call   1040 <crc16_dump_table@plt>
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xe67(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    $0x8,%edi
mov    $0x82f63b78,%esi
mov    %rbx,%rdx
call   1030 <crc32_dump_table@plt>
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xe3e(%rip),%rdi
mov    $0x1b,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    $0x5,%edi
mov    $0x82f63b78,%esi
mov    %rbx,%rdx
call   1030 <crc32_dump_table@plt>
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1050 <fwrite@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdout = global i32* null
@.str = [24 x i8] c"crc_table_ibm[256] = {\0A\00"
@.str.1 = [4 x i8] c"};\0A\00"
@.str.2 = [23 x i8] c"crc_table_ibm[32] = {\0A\00"
@.str.3 = [23 x i8] c"crc32c_table[256] = {\0A\00"
@.str.4 = [28 x i8] c"crc32c_table_addr5[32] = {\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32*
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%9 = load i32*, i32** @stdout
store i32* %9, i32** %8
%10 = load i32*, i32** %8
%11 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%12 = load i32*, i32** %8
%13 = call i32 @crc16_dump_table(i32 8, i32 40961, i32* %12)
%14 = load i32*, i32** %8
%15 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%16 = load i32*, i32** %8
%17 = call i32 @fprintf(i32* %16, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%18 = load i32*, i32** %8
%19 = call i32 @crc16_dump_table(i32 5, i32 40961, i32* %18)
%20 = load i32*, i32** %8
%21 = call i32 @fprintf(i32* %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%22 = load i32*, i32** %8
%23 = call i32 @fprintf(i32* %22, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%24 = load i32*, i32** %8
%25 = call i32 @crc32_dump_table(i32 8, i32 -2097792136, i32* %24)
%26 = load i32*, i32** %8
%27 = call i32 @fprintf(i32* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%28 = load i32*, i32** %8
%29 = call i32 @fprintf(i32* %28, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%30 = load i32*, i32** %8
%31 = call i32 @crc32_dump_table(i32 5, i32 -2097792136, i32* %30)
%32 = load i32*, i32** %8
%33 = call i32 @fprintf(i32* %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32* null
@.str = [24 x i8] c"crc_table_ibm[256] = {\0A\00"
@.str.1 = [4 x i8] c"};\0A\00"
@.str.2 = [23 x i8] c"crc_table_ibm[32] = {\0A\00"
@.str.3 = [23 x i8] c"crc32c_table[256] = {\0A\00"
@.str.4 = [28 x i8] c"crc32c_table_addr5[32] = {\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = load i32*, i32** @stdout
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 23, i64 1, i32* %4)
%6 = tail call i32 @crc16_dump_table(i32 8, i32 40961, i32* %4)
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 3, i64 1, i32* %4)
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i64 22, i64 1, i32* %4)
%9 = tail call i32 @crc16_dump_table(i32 5, i32 40961, i32* %4)
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 3, i64 1, i32* %4)
%11 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i64 22, i64 1, i32* %4)
%12 = tail call i32 @crc32_dump_table(i32 8, i32 -2097792136, i32* %4)
%13 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 3, i64 1, i32* %4)
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i64 27, i64 1, i32* %4)
%15 = tail call i32 @crc32_dump_table(i32 5, i32 -2097792136, i32* %4)
%16 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 3, i64 1, i32* %4)
ret i32 0
}