#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 uint32_t;

/* Variables and functions */
int /*<<< orphan*/ crc32c_zeros_op(int *, size_t);
int gf2_matrix_times(int *, int);
void crc32c_zeros(uint32_t zeros[][256], size_t len) {
  uint32_t op[32];
  uint32_t n;
  crc32c_zeros_op(op, len);
  for (n = 0; n < 256; n++) {
    zeros[0][n] = gf2_matrix_times(op, n);
    zeros[1][n] = gf2_matrix_times(op, n << 8);
    zeros[2][n] = gf2_matrix_times(op, n << 16);
    zeros[3][n] = gf2_matrix_times(op, n << 24);
  }
}


x86 assembly (clang, -O0):
<crc32c_zeros>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <crc32c_zeros_op@plt>
movl   $0x0,-0x94(%rbp)
cmpl   $0x100,-0x94(%rbp)
jge    120e <crc32c_zeros+0xee>
lea    -0x90(%rbp),%rdi
mov    -0x94(%rbp),%esi
call   1040 <gf2_matrix_times@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x94(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
lea    -0x90(%rbp),%rdi
mov    -0x94(%rbp),%esi
shl    $0x8,%esi
call   1040 <gf2_matrix_times@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x94(%rbp),%rcx
mov    %edx,0x400(%rax,%rcx,4)
lea    -0x90(%rbp),%rdi
mov    -0x94(%rbp),%esi
shl    $0x10,%esi
call   1040 <gf2_matrix_times@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x94(%rbp),%rcx
mov    %edx,0x800(%rax,%rcx,4)
lea    -0x90(%rbp),%rdi
mov    -0x94(%rbp),%esi
shl    $0x18,%esi
call   1040 <gf2_matrix_times@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x94(%rbp),%rcx
mov    %edx,0xc00(%rax,%rcx,4)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    114d <crc32c_zeros+0x2d>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32c_zeros>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rdi,%r15
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <crc32c_zeros_op@plt>
xor    %r12d,%r12d
xor    %r13d,%r13d
xor    %ebx,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
call   1040 <gf2_matrix_times@plt>
mov    %eax,(%r15,%rbp,4)
mov    %r14,%rdi
mov    %r12d,%esi
call   1040 <gf2_matrix_times@plt>
mov    %eax,0x400(%r15,%rbp,4)
mov    %r14,%rdi
mov    %r13d,%esi
call   1040 <gf2_matrix_times@plt>
mov    %eax,0x800(%r15,%rbp,4)
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <gf2_matrix_times@plt>
mov    %eax,0xc00(%r15,%rbp,4)
add    $0x1,%rbp
add    $0x1000000,%ebx
add    $0x10000,%r13d
add    $0x100,%r12d
cmp    $0x100,%rbp
jne    1150 <crc32c_zeros+0x30>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @crc32c_zeros([256 x i32]* %0, i64 %1) {
%3 = alloca [256 x i32]*
%4 = alloca i64
%5 = alloca [32 x i32]
%6 = alloca i32
store [256 x i32]* %0, [256 x i32]** %3
store i64 %1, i64* %4
%7 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 0
%8 = load i64, i64* %4
%9 = call i32 @crc32c_zeros_op(i32* %7, i64 %8)
store i32 0, i32* %6
br label %10
10: ; preds = %49, %2
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 256
br i1 %12, label %13, label %52
13: ; preds = %10
%14 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 0
%15 = load i32, i32* %6
%16 = call i32 @gf2_matrix_times(i32* %14, i32 %15)
%17 = load [256 x i32]*, [256 x i32]** %3
%18 = getelementptr inbounds [256 x i32], [256 x i32]* %17, i64 0
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [256 x i32], [256 x i32]* %18, i64 0, i64 %20
store i32 %16, i32* %21
%22 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 0
%23 = load i32, i32* %6
%24 = shl i32 %23, 8
%25 = call i32 @gf2_matrix_times(i32* %22, i32 %24)
%26 = load [256 x i32]*, [256 x i32]** %3
%27 = getelementptr inbounds [256 x i32], [256 x i32]* %26, i64 1
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [256 x i32], [256 x i32]* %27, i64 0, i64 %29
store i32 %25, i32* %30
%31 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 0
%32 = load i32, i32* %6
%33 = shl i32 %32, 16
%34 = call i32 @gf2_matrix_times(i32* %31, i32 %33)
%35 = load [256 x i32]*, [256 x i32]** %3
%36 = getelementptr inbounds [256 x i32], [256 x i32]* %35, i64 2
%37 = load i32, i32* %6
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [256 x i32], [256 x i32]* %36, i64 0, i64 %38
store i32 %34, i32* %39
%40 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 0
%41 = load i32, i32* %6
%42 = shl i32 %41, 24
%43 = call i32 @gf2_matrix_times(i32* %40, i32 %42)
%44 = load [256 x i32]*, [256 x i32]** %3
%45 = getelementptr inbounds [256 x i32], [256 x i32]* %44, i64 3
%46 = load i32, i32* %6
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [256 x i32], [256 x i32]* %45, i64 0, i64 %47
store i32 %43, i32* %48
br label %49
49: ; preds = %13
%50 = load i32, i32* %6
%51 = add nsw i32 %50, 1
store i32 %51, i32* %6
br label %10
52: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @crc32c_zeros([256 x i32]* nocapture writeonly %0, i64 %1) {
%3 = alloca [32 x i32]
%4 = bitcast [32 x i32]* %3 to i8*
%5 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%6 = call i32 @crc32c_zeros_op(i32* %5, i64 %1)
br label %7
7: ; preds = %2, %7
%8 = phi i64 [ 0, %2 ], [ %24, %7 ]
%9 = trunc i64 %8 to i32
%10 = call i32 @gf2_matrix_times(i32* %5, i32 %9)
%11 = getelementptr inbounds [256 x i32], [256 x i32]* %0, i64 0, i64 %8
store i32 %10, i32* %11
%12 = trunc i64 %8 to i32
%13 = shl i32 %12, 8
%14 = call i32 @gf2_matrix_times(i32* %5, i32 %13)
%15 = getelementptr inbounds [256 x i32], [256 x i32]* %0, i64 1, i64 %8
store i32 %14, i32* %15
%16 = trunc i64 %8 to i32
%17 = shl i32 %16, 16
%18 = call i32 @gf2_matrix_times(i32* %5, i32 %17)
%19 = getelementptr inbounds [256 x i32], [256 x i32]* %0, i64 2, i64 %8
store i32 %18, i32* %19
%20 = trunc i64 %8 to i32
%21 = shl i32 %20, 24
%22 = call i32 @gf2_matrix_times(i32* %5, i32 %21)
%23 = getelementptr inbounds [256 x i32], [256 x i32]* %0, i64 3, i64 %8
store i32 %22, i32* %23
%24 = add nuw nsw i64 %8, 1
%25 = icmp eq i64 %24, 256
br i1 %25, label %26, label %7
26: ; preds = %7
ret void
}