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

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ make_table(int *, int);
int /*<<< orphan*/ print_table_32(char *, int *, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
void make_tables_32(int java) {
  int i;
  for (i = 0; i < 4; i++) {
    uint64_t tab1[256], tab2[256];
    int j;
    make_table(tab1, i);
    make_table(tab2, i + 4);
    for (j = 0; j < 256; j++) {
      uint64_t v;
      v = tab1[j];
      if (((v << 32) | (v >> 32)) != tab2[j])
        abort();
    }
  }
  for (i = 0; i < 4; i++) {
    uint64_t tab[256];
    char name[20];
    make_table(tab, i);
    sprintf(name, "T%d", i);
    print_table_32(name, tab, java);
  }
}


x86 assembly (clang, -O0):
<make_tables_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc40,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1213 <make_tables_32+0xd3>
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <make_table@plt>
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%esi
add    $0x4,%esi
call   1040 <make_table@plt>
movl   $0x0,-0x814(%rbp)
cmpl   $0x100,-0x814(%rbp)
jge    1200 <make_tables_32+0xc0>
movslq -0x814(%rbp),%rax
mov    -0x410(%rbp,%rax,4),%eax
mov    %eax,-0x818(%rbp)
mov    -0x818(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    -0x818(%rbp),%edx
mov    $0x20,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movslq -0x814(%rbp),%rcx
cmp    -0x810(%rbp,%rcx,4),%eax
je     11e7 <make_tables_32+0xa7>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11ec <make_tables_32+0xac>
mov    -0x814(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x814(%rbp)
jmp    118a <make_tables_32+0x4a>
jmp    1205 <make_tables_32+0xc5>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1155 <make_tables_32+0x15>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    126d <make_tables_32+0x12d>
lea    -0xc20(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <make_table@plt>
lea    -0xc40(%rbp),%rdi
mov    -0x8(%rbp),%edx
lea    0xdbc(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0xc40(%rbp),%rdi
lea    -0xc20(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1050 <print_table_32@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    121a <make_tables_32+0xda>
add    $0xc40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_tables_32>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x808,%rsp
mov    %edi,%r14d
lea    0x400(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <make_table@plt>
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    $0x4,%esi
call   1030 <make_table@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <make_table@plt>
mov    %rbp,%rdi
mov    $0x5,%esi
call   1030 <make_table@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <make_table@plt>
mov    %rbp,%rdi
mov    $0x6,%esi
call   1030 <make_table@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <make_table@plt>
mov    %rbp,%rdi
mov    $0x7,%esi
call   1030 <make_table@plt>
lea    0x400(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <make_table@plt>
lea    0xe37(%rip),%r15
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    %r15,%rsi
xor    %edx,%edx
call   1050 <sprintf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <print_table_32@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <make_table@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
mov    $0x1,%edx
call   1050 <sprintf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <print_table_32@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <make_table@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
mov    $0x2,%edx
call   1050 <sprintf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <print_table_32@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <make_table@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
mov    $0x3,%edx
call   1050 <sprintf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <print_table_32@plt>
add    $0x808,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"T%d\00"
define void @make_tables_32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [256 x i32]
%5 = alloca [256 x i32]
%6 = alloca i32
%7 = alloca i32
%8 = alloca [256 x i32]
%9 = alloca [20 x i8]
store i32 %0, i32* %2
store i32 0, i32* %3
br label %10
10: ; preds = %46, %1
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 4
br i1 %12, label %13, label %49
13: ; preds = %10
%14 = getelementptr inbounds [256 x i32], [256 x i32]* %4, i64 0, i64 0
%15 = load i32, i32* %3
%16 = call i32 @make_table(i32* %14, i32 %15)
%17 = getelementptr inbounds [256 x i32], [256 x i32]* %5, i64 0, i64 0
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 4
%20 = call i32 @make_table(i32* %17, i32 %19)
store i32 0, i32* %6
br label %21
21: ; preds = %42, %13
%22 = load i32, i32* %6
%23 = icmp slt i32 %22, 256
br i1 %23, label %24, label %45
24: ; preds = %21
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [256 x i32], [256 x i32]* %4, i64 0, i64 %26
%28 = load i32, i32* %27
store i32 %28, i32* %7
%29 = load i32, i32* %7
%30 = shl i32 %29, 32
%31 = load i32, i32* %7
%32 = ashr i32 %31, 32
%33 = or i32 %30, %32
%34 = load i32, i32* %6
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [256 x i32], [256 x i32]* %5, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = icmp ne i32 %33, %37
br i1 %38, label %39, label %41
39: ; preds = %24
%40 = call i32 (...) @abort()
unreachable
41: ; preds = %24
br label %42
42: ; preds = %41
%43 = load i32, i32* %6
%44 = add nsw i32 %43, 1
store i32 %44, i32* %6
br label %21
45: ; preds = %21
br label %46
46: ; preds = %45
%47 = load i32, i32* %3
%48 = add nsw i32 %47, 1
store i32 %48, i32* %3
br label %10
49: ; preds = %10
store i32 0, i32* %3
br label %50
50: ; preds = %64, %49
%51 = load i32, i32* %3
%52 = icmp slt i32 %51, 4
br i1 %52, label %53, label %67
53: ; preds = %50
%54 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 0
%55 = load i32, i32* %3
%56 = call i32 @make_table(i32* %54, i32 %55)
%57 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%58 = load i32, i32* %3
%59 = call i32 @sprintf(i8* %57, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %58)
%60 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%61 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 0
%62 = load i32, i32* %2
%63 = call i32 @print_table_32(i8* %60, i32* %61, i32 %62)
br label %64
64: ; preds = %53
%65 = load i32, i32* %3
%66 = add nsw i32 %65, 1
store i32 %66, i32* %3
br label %50
67: ; preds = %50
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"T%d\00"
define void @make_tables_32(i32 %0) {
%2 = alloca [256 x i32]
%3 = alloca [256 x i32]
%4 = alloca [256 x i32]
%5 = alloca [20 x i8]
%6 = bitcast [256 x i32]* %2 to i8*
%7 = bitcast [256 x i32]* %3 to i8*
%8 = getelementptr inbounds [256 x i32], [256 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [256 x i32], [256 x i32]* %3, i64 0, i64 0
%10 = call i32 @make_table(i32* %8, i32 0)
%11 = call i32 @make_table(i32* %9, i32 4)
%12 = call i32 @make_table(i32* %8, i32 1)
%13 = call i32 @make_table(i32* %9, i32 5)
%14 = call i32 @make_table(i32* %8, i32 2)
%15 = call i32 @make_table(i32* %9, i32 6)
%16 = call i32 @make_table(i32* %8, i32 3)
%17 = call i32 @make_table(i32* %9, i32 7)
%18 = bitcast [256 x i32]* %4 to i8*
%19 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%20 = getelementptr inbounds [256 x i32], [256 x i32]* %4, i64 0, i64 0
%21 = call i32 @make_table(i32* %20, i32 0)
%22 = call i32 @sprintf(i8* %19, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%23 = call i32 @print_table_32(i8* %19, i32* %20, i32 %0)
%24 = call i32 @make_table(i32* %20, i32 1)
%25 = call i32 @sprintf(i8* %19, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%26 = call i32 @print_table_32(i8* %19, i32* %20, i32 %0)
%27 = call i32 @make_table(i32* %20, i32 2)
%28 = call i32 @sprintf(i8* %19, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%29 = call i32 @print_table_32(i8* %19, i32* %20, i32 %0)
%30 = call i32 @make_table(i32* %20, i32 3)
%31 = call i32 @sprintf(i8* %19, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%32 = call i32 @print_table_32(i8* %19, i32* %20, i32 %0)
ret void
}