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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_table(char *name, uint32_t *tab, int java) {
  int i;
  printf("\n");
  if (java) {
    printf("\tstatic final int[] %s = {\n", name);
  } else {
    printf("static const sph_u32 %s[] = {\n", name);
  }
  if (java) {
    for (i = 0; i < 256; i++) {
      if (i == 0) {
        printf("\t\t");
      } else if (i % 4 == 0) {
        printf(",\n\t\t");
      } else {
        printf(", ");
      }
      printf("0x%08lx", (unsigned long)tab[i]);
    }
    printf("\n\t};\n");
  } else {
    for (i = 0; i < 256; i++) {
      if (i == 0) {
        printf("\t");
      } else if (i % 3 == 0) {
        printf(",\n\t");
      } else {
        printf(", ");
      }
      printf("SPH_C32(0x%08lx)", (unsigned long)tab[i]);
    }
    printf("\n};\n");
  }
}


x86 assembly (clang, -O0):
<print_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xf25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
je     1152 <print_table+0x42>
mov    -0x8(%rbp),%rsi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1164 <print_table+0x54>
mov    -0x8(%rbp),%rsi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
je     1214 <print_table+0x104>
movl   $0x0,-0x18(%rbp)
cmpl   $0x100,-0x18(%rbp)
jge    1201 <print_table+0xf1>
cmpl   $0x0,-0x18(%rbp)
jne    119f <print_table+0x8f>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d9 <print_table+0xc9>
mov    -0x18(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11c6 <print_table+0xb6>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d4 <print_table+0xc4>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d9 <print_table+0xc9>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1175 <print_table+0x65>
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12b5 <print_table+0x1a5>
movl   $0x0,-0x18(%rbp)
cmpl   $0x100,-0x18(%rbp)
jge    12a7 <print_table+0x197>
cmpl   $0x0,-0x18(%rbp)
jne    1245 <print_table+0x135>
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127f <print_table+0x16f>
mov    -0x18(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    126c <print_table+0x15c>
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127a <print_table+0x16a>
lea    0xdcd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127f <print_table+0x16f>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xdc3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    121b <print_table+0x10b>
lea    0xdb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_table>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%r12
mov    %rdi,%r14
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %ebp,%ebp
je     11e1 <print_table+0xb1>
lea    0xea4(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r12),%rsi
lea    0xec4(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%ebx
lea    0xea6(%rip),%r14
lea    0xea4(%rip),%rbp
lea    0xec1(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   $0x3,%bl
mov    %rbp,%rdi
cmove  %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r12,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    $0x100,%rbx
jne    11b0 <print_table+0x80>
jmp    1278 <print_table+0x148>
lea    0xe34(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    (%r12),%rsi
lea    0xe48(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%ebp
mov    $0xff,%bl
lea    0xe2c(%rip),%r13
lea    0xe1a(%rip),%r14
jmp    1255 <print_table+0x125>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r12,%rbp,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
add    $0xff,%bl
cmp    $0x100,%rbp
je     1271 <print_table+0x141>
movzbl %bpl,%eax
imul   $0xab,%eax,%eax
shr    $0x9,%eax
lea    (%rax,%rax,2),%eax
mov    %r13,%rdi
add    %bl,%al
je     1230 <print_table+0x100>
mov    %r14,%rdi
jmp    1230 <print_table+0x100>
lea    0xde8(%rip),%r13
mov    %r13,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [28 x i8] c"\09static final int[] %s = {\0A\00"
@.str.2 = [31 x i8] c"static const sph_u32 %s[] = {\0A\00"
@.str.3 = [3 x i8] c"\09\09\00"
@.str.4 = [5 x i8] c",\0A\09\09\00"
@.str.5 = [3 x i8] c", \00"
@.str.6 = [8 x i8] c"0x%08lx\00"
@.str.7 = [6 x i8] c"\0A\09};\0A\00"
@.str.8 = [2 x i8] c"\09\00"
@.str.9 = [4 x i8] c",\0A\09\00"
@.str.10 = [17 x i8] c"SPH_C32(0x%08lx)\00"
@.str.11 = [5 x i8] c"\0A};\0A\00"
define void @print_table(i8* %0, i64* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i64* %1, i64** %5
store i32 %2, i32* %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %12)
br label %17
14: ; preds = %3
%15 = load i8*, i8** %4
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %14, %11
%18 = load i32, i32* %6
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %50
20: ; preds = %17
store i32 0, i32* %7
br label %21
21: ; preds = %45, %20
%22 = load i32, i32* %7
%23 = icmp slt i32 %22, 256
br i1 %23, label %24, label %48
24: ; preds = %21
%25 = load i32, i32* %7
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %38
29: ; preds = %24
%30 = load i32, i32* %7
%31 = srem i32 %30, 4
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %37
35: ; preds = %29
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %37
37: ; preds = %35, %33
br label %38
38: ; preds = %37, %27
%39 = load i64*, i64** %5
%40 = load i32, i32* %7
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i64, i64* %39, i64 %41
%43 = load i64, i64* %42
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i64 %43)
br label %45
45: ; preds = %38
%46 = load i32, i32* %7
%47 = add nsw i32 %46, 1
store i32 %47, i32* %7
br label %21
48: ; preds = %21
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
br label %80
50: ; preds = %17
store i32 0, i32* %7
br label %51
51: ; preds = %75, %50
%52 = load i32, i32* %7
%53 = icmp slt i32 %52, 256
br i1 %53, label %54, label %78
54: ; preds = %51
%55 = load i32, i32* %7
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %54
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %68
59: ; preds = %54
%60 = load i32, i32* %7
%61 = srem i32 %60, 3
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %59
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
br label %67
65: ; preds = %59
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %67
67: ; preds = %65, %63
br label %68
68: ; preds = %67, %57
%69 = load i64*, i64** %5
%70 = load i32, i32* %7
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i64, i64* %69, i64 %71
%73 = load i64, i64* %72
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i64 %73)
br label %75
75: ; preds = %68
%76 = load i32, i32* %7
%77 = add nsw i32 %76, 1
store i32 %77, i32* %7
br label %51
78: ; preds = %51
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
br label %80
80: ; preds = %78, %48
ret void
}

LLVM IR (-O2):
@.str.1 = [28 x i8] c"\09static final int[] %s = {\0A\00"
@.str.2 = [31 x i8] c"static const sph_u32 %s[] = {\0A\00"
@.str.3 = [3 x i8] c"\09\09\00"
@.str.4 = [5 x i8] c",\0A\09\09\00"
@.str.5 = [3 x i8] c", \00"
@.str.6 = [8 x i8] c"0x%08lx\00"
@.str.9 = [4 x i8] c",\0A\09\00"
@.str.10 = [17 x i8] c"SPH_C32(0x%08lx)\00"
@str = [4 x i8] c"\0A};\00"
@str.12 = [5 x i8] c"\0A\09};\00"
define void @print_table(i8* %0, i64* nocapture %1, i32 %2) {
%4 = tail call i32 @putchar(i32 10)
%5 = icmp eq i32 %2, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%9 = load i64, i64* %1
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i64 %9)
br label %16
11: ; preds = %3
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%13 = tail call i32 @putchar(i32 9)
%14 = load i64, i64* %1
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i64 %14)
br label %27
16: ; preds = %16, %6
%17 = phi i64 [ 1, %6 ], [ %25, %16 ]
%18 = and i64 %17, 3
%19 = icmp eq i64 %18, 0
%20 = select i1 %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %20)
%22 = getelementptr inbounds i64, i64* %1, i64 %17
%23 = load i64, i64* %22
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i64 %23)
%25 = add nuw nsw i64 %17, 1
%26 = icmp eq i64 %25, 256
br i1 %26, label %39, label %16
27: ; preds = %27, %11
%28 = phi i64 [ 1, %11 ], [ %37, %27 ]
%29 = trunc i64 %28 to i8
%30 = urem i8 %29, 3
%31 = icmp eq i8 %30, 0
%32 = select i1 %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0)
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %32)
%34 = getelementptr inbounds i64, i64* %1, i64 %28
%35 = load i64, i64* %34
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i64 %35)
%37 = add nuw nsw i64 %28, 1
%38 = icmp eq i64 %37, 256
br i1 %38, label %39, label %27
39: ; preds = %16, %27
%40 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0), %27 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.12, i64 0, i64 0), %16 ]
%41 = tail call i32 @puts(i8* dereferenceable(1) %40)
ret void
}