#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 /*<<< orphan*/ printf(char *, ...);
int main() {
  unsigned int crc;
  unsigned int mask;
  unsigned int crcpoly = 0xEDB88320;
  unsigned int crc_gentab[256];
  unsigned int i, j;
  for (i = 0; i < 256; i++) {
    crc = i;
    for (j = 0; j < 8; j++) {
      mask = -(crc & 0x01);
      crc = (crc >> 1) ^ (crcpoly & mask);
    }
    crc_gentab[i] = crc;
  }
  printf("\n");
  printf("unsigned char crc_gentab[%u] = {\n    ", 256);
  for (i = 0; i < 256; i++) {
    printf("0x%.2x", crc_gentab[i]);
    if (i == 255)
      printf("};\n");
    else if (((i + 1) % 8) == 0)
      printf(",\n    ");
    else
      printf(", ");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xedb88320,-0x10(%rbp)
movl   $0x0,-0x414(%rbp)
cmpl   $0x100,-0x414(%rbp)
jae    11b9 <main+0xa9>
mov    -0x414(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x418(%rbp)
cmpl   $0x8,-0x418(%rbp)
jae    1195 <main+0x85>
mov    -0x8(%rbp),%ecx
and    $0x1,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    -0x10(%rbp),%ecx
and    -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x418(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x418(%rbp)
jmp    1156 <main+0x46>
mov    -0x8(%rbp),%ecx
mov    -0x414(%rbp),%eax
mov    %ecx,-0x410(%rbp,%rax,4)
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
jmp    1133 <main+0x23>
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe32(%rip),%rdi
mov    $0x100,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x414(%rbp)
cmpl   $0x100,-0x414(%rbp)
jae    1286 <main+0x176>
mov    -0x414(%rbp),%eax
mov    -0x410(%rbp,%rax,4),%esi
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xff,-0x414(%rbp)
jne    1232 <main+0x122>
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    126d <main+0x15d>
mov    -0x414(%rbp),%eax
add    $0x1,%eax
and    $0x7,%eax
cmp    $0x0,%eax
jne    125a <main+0x14a>
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1268 <main+0x158>
lea    0xdd7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    126d <main+0x15d>
jmp    1272 <main+0x162>
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
jmp    11e4 <main+0xd4>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x408,%rsp
movdqa 0xeba(%rip),%xmm0
xor    %eax,%eax
movdqa 0xec0(%rip),%xmm1
movdqa 0xec8(%rip),%xmm2
movdqa 0xed0(%rip),%xmm3
movdqa %xmm0,%xmm4
pand   %xmm1,%xmm4
pxor   %xmm5,%xmm5
psubd  %xmm4,%xmm5
movdqa %xmm0,%xmm4
psrld  $0x1,%xmm4
pand   %xmm2,%xmm5
pxor   %xmm4,%xmm5
pand   %xmm1,%xmm4
pxor   %xmm6,%xmm6
psubd  %xmm4,%xmm6
psrld  $0x1,%xmm5
pand   %xmm2,%xmm6
pxor   %xmm5,%xmm6
pand   %xmm1,%xmm5
pxor   %xmm4,%xmm4
psubd  %xmm5,%xmm4
psrld  $0x1,%xmm6
pand   %xmm2,%xmm4
pxor   %xmm6,%xmm4
pand   %xmm1,%xmm6
pxor   %xmm5,%xmm5
psubd  %xmm6,%xmm5
psrld  $0x1,%xmm4
pand   %xmm2,%xmm5
pxor   %xmm4,%xmm5
pand   %xmm1,%xmm4
pxor   %xmm6,%xmm6
psubd  %xmm4,%xmm6
psrld  $0x1,%xmm5
pand   %xmm2,%xmm6
pxor   %xmm5,%xmm6
pand   %xmm1,%xmm5
pxor   %xmm4,%xmm4
psubd  %xmm5,%xmm4
psrld  $0x1,%xmm6
pand   %xmm2,%xmm4
pxor   %xmm6,%xmm4
pand   %xmm1,%xmm6
pxor   %xmm5,%xmm5
psubd  %xmm6,%xmm5
psrld  $0x1,%xmm4
pand   %xmm2,%xmm5
pxor   %xmm4,%xmm5
pand   %xmm1,%xmm4
pxor   %xmm6,%xmm6
psubd  %xmm4,%xmm6
psrld  $0x1,%xmm5
pand   %xmm2,%xmm6
pxor   %xmm5,%xmm6
movdqa %xmm6,(%rsp,%rax,4)
add    $0x4,%rax
paddd  %xmm3,%xmm0
cmp    $0x100,%rax
jne    1160 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xde6(%rip),%rdi
mov    $0x100,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xffffffffffffff00,%rbx
lea    0xdf2(%rip),%r14
lea    0xdf2(%rip),%r15
lea    0xdf2(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x400(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0xffffffffffffffff,%rbx
je     12c4 <main+0x194>
lea    0x101(%rbx),%eax
test   $0x7,%al
mov    %r12,%rdi
cmove  %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
inc    %rbx
jne    1290 <main+0x160>
jmp    12d0 <main+0x1a0>
lea    0xdac(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [38 x i8] c"unsigned char crc_gentab[%u] = {\0A \00"
@.str.2 = [7 x i8] c"0x%.2x\00"
@.str.3 = [4 x i8] c"};\0A\00"
@.str.4 = [7 x i8] c",\0A \00"
@.str.5 = [3 x i8] c", \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [256 x i32]
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 -306674912, i32* %4
store i32 0, i32* %6
br label %8
8: ; preds = %34, %0
%9 = load i32, i32* %6
%10 = icmp ult i32 %9, 256
br i1 %10, label %11, label %37
11: ; preds = %8
%12 = load i32, i32* %6
store i32 %12, i32* %2
store i32 0, i32* %7
br label %13
13: ; preds = %26, %11
%14 = load i32, i32* %7
%15 = icmp ult i32 %14, 8
br i1 %15, label %16, label %29
16: ; preds = %13
%17 = load i32, i32* %2
%18 = and i32 %17, 1
%19 = sub i32 0, %18
store i32 %19, i32* %3
%20 = load i32, i32* %2
%21 = lshr i32 %20, 1
%22 = load i32, i32* %4
%23 = load i32, i32* %3
%24 = and i32 %22, %23
%25 = xor i32 %21, %24
store i32 %25, i32* %2
br label %26
26: ; preds = %16
%27 = load i32, i32* %7
%28 = add i32 %27, 1
store i32 %28, i32* %7
br label %13
29: ; preds = %13
%30 = load i32, i32* %2
%31 = load i32, i32* %6
%32 = zext i32 %31 to i64
%33 = getelementptr inbounds [256 x i32], [256 x i32]* %5, i64 0, i64 %32
store i32 %30, i32* %33
br label %34
34: ; preds = %29
%35 = load i32, i32* %6
%36 = add i32 %35, 1
store i32 %36, i32* %6
br label %8
37: ; preds = %8
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 256)
store i32 0, i32* %6
br label %40
40: ; preds = %64, %37
%41 = load i32, i32* %6
%42 = icmp ult i32 %41, 256
br i1 %42, label %43, label %67
43: ; preds = %40
%44 = load i32, i32* %6
%45 = zext i32 %44 to i64
%46 = getelementptr inbounds [256 x i32], [256 x i32]* %5, i64 0, i64 %45
%47 = load i32, i32* %46
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %47)
%49 = load i32, i32* %6
%50 = icmp eq i32 %49, 255
br i1 %50, label %51, label %53
51: ; preds = %43
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %63
53: ; preds = %43
%54 = load i32, i32* %6
%55 = add i32 %54, 1
%56 = urem i32 %55, 8
%57 = icmp eq i32 %56, 0
br i1 %57, label %58, label %60
58: ; preds = %53
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %62
60: ; preds = %53
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %62
62: ; preds = %60, %58
br label %63
63: ; preds = %62, %51
br label %64
64: ; preds = %63
%65 = load i32, i32* %6
%66 = add i32 %65, 1
store i32 %66, i32* %6
br label %40
67: ; preds = %40
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [38 x i8] c"unsigned char crc_gentab[%u] = {\0A \00"
@.str.2 = [7 x i8] c"0x%.2x\00"
@.str.4 = [7 x i8] c",\0A \00"
@.str.5 = [3 x i8] c", \00"
@str = [3 x i8] c"};\00"
define i32 @main() {
%1 = alloca [256 x i32]
%2 = bitcast [256 x i32]* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = phi i64 [ 0, %0 ], [ %48, %3 ]
%5 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %0 ], [ %49, %3 ]
%6 = and <4 x i32> %5, <i32 1, i32 1, i32 1, i32 1>
%7 = sub nsw <4 x i32> zeroinitializer, %6
%8 = lshr <4 x i32> %5, <i32 1, i32 1, i32 1, i32 1>
%9 = and <4 x i32> %7, <i32 -306674912, i32 -306674912, i32 -306674912, i32 -306674912>
%10 = xor <4 x i32> %9, %8
%11 = and <4 x i32> %8, <i32 1, i32 1, i32 1, i32 1>
%12 = sub nsw <4 x i32> zeroinitializer, %11
%13 = lshr <4 x i32> %10, <i32 1, i32 1, i32 1, i32 1>
%14 = and <4 x i32> %12, <i32 -306674912, i32 -306674912, i32 -306674912, i32 -306674912>
%15 = xor <4 x i32> %14, %13
%16 = and <4 x i32> %13, <i32 1, i32 1, i32 1, i32 1>
%17 = sub nsw <4 x i32> zeroinitializer, %16
%18 = lshr <4 x i32> %15, <i32 1, i32 1, i32 1, i32 1>
%19 = and <4 x i32> %17, <i32 -306674912, i32 -306674912, i32 -306674912, i32 -306674912>
%20 = xor <4 x i32> %19, %18
%21 = and <4 x i32> %18, <i32 1, i32 1, i32 1, i32 1>
%22 = sub nsw <4 x i32> zeroinitializer, %21
%23 = lshr <4 x i32> %20, <i32 1, i32 1, i32 1, i32 1>
%24 = and <4 x i32> %22, <i32 -306674912, i32 -306674912, i32 -306674912, i32 -306674912>
%25 = xor <4 x i32> %24, %23
%26 = and <4 x i32> %23, <i32 1, i32 1, i32 1, i32 1>
%27 = sub nsw <4 x i32> zeroinitializer, %26
%28 = lshr <4 x i32> %25, <i32 1, i32 1, i32 1, i32 1>
%29 = and <4 x i32> %27, <i32 -306674912, i32 -306674912, i32 -306674912, i32 -306674912>
%30 = xor <4 x i32> %29, %28
%31 = and <4 x i32> %28, <i32 1, i32 1, i32 1, i32 1>
%32 = sub nsw <4 x i32> zeroinitializer, %31
%33 = lshr <4 x i32> %30, <i32 1, i32 1, i32 1, i32 1>
%34 = and <4 x i32> %32, <i32 -306674912, i32 -306674912, i32 -306674912, i32 -306674912>
%35 = xor <4 x i32> %34, %33
%36 = and <4 x i32> %33, <i32 1, i32 1, i32 1, i32 1>
%37 = sub nsw <4 x i32> zeroinitializer, %36
%38 = lshr <4 x i32> %35, <i32 1, i32 1, i32 1, i32 1>
%39 = and <4 x i32> %37, <i32 -306674912, i32 -306674912, i32 -306674912, i32 -306674912>
%40 = xor <4 x i32> %39, %38
%41 = and <4 x i32> %38, <i32 1, i32 1, i32 1, i32 1>
%42 = sub nsw <4 x i32> zeroinitializer, %41
%43 = lshr <4 x i32> %40, <i32 1, i32 1, i32 1, i32 1>
%44 = and <4 x i32> %42, <i32 -306674912, i32 -306674912, i32 -306674912, i32 -306674912>
%45 = xor <4 x i32> %44, %43
%46 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 %4
%47 = bitcast i32* %46 to <4 x i32>*
store <4 x i32> %45, <4 x i32>* %47
%48 = add nuw i64 %4, 4
%49 = add <4 x i32> %5, <i32 4, i32 4, i32 4, i32 4>
%50 = icmp eq i64 %48, 256
br i1 %50, label %51, label %3
51: ; preds = %3
%52 = tail call i32 @putchar(i32 10)
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 256)
br label %54
54: ; preds = %51, %62
%55 = phi i64 [ 0, %51 ], [ %63, %62 ]
%56 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 %55
%57 = load i32, i32* %56
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %57)
%59 = icmp eq i64 %55, 255
br i1 %59, label %60, label %62
60: ; preds = %54
%61 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
br label %69
62: ; preds = %54
%63 = add nuw nsw i64 %55, 1
%64 = and i64 %63, 7
%65 = icmp eq i64 %64, 0
%66 = select i1 %65, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0)
%67 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %66)
%68 = icmp eq i64 %63, 256
br i1 %68, label %69, label %54
69: ; preds = %62, %60
ret i32 0
}