#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*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ sbox_mix3;
typedef int /*<<< orphan*/ sbox_mix2;
typedef int /*<<< orphan*/ sbox_mix1;
typedef int /*<<< orphan*/ sbox_mix0;
typedef int /*<<< orphan*/ sbox;
typedef int /*<<< orphan*/ isbox_mix3;
typedef int /*<<< orphan*/ isbox_mix2;
typedef int /*<<< orphan*/ isbox_mix1;
typedef int /*<<< orphan*/ isbox_mix0;
typedef int /*<<< orphan*/ isbox;
typedef int /*<<< orphan*/ GF_MulE;
typedef int /*<<< orphan*/ GF_MulD;
typedef int /*<<< orphan*/ GF_MulB;
typedef int /*<<< orphan*/ GF_Mul9;
typedef int /*<<< orphan*/ GF_Mul3;
typedef int /*<<< orphan*/ GF_Mul2;

/* Variables and functions */
int /*<<< orphan*/
gen_AES_imixsbox_table(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ gen_AES_mixsbox_table(int /*<<< orphan*/ *,
                                         int /*<<< orphan*/ *,
                                         int /*<<< orphan*/ *,
                                         int /*<<< orphan*/ *, int);
int /*<<< orphan*/ gen_AES_sbox(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ gen_GF_log_ilog(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ gen_GF_mul_table(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                    int /*<<< orphan*/ *, int);
int /*<<< orphan*/ print_32bit_Ctbl(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ print_8bit_Ctbl(char *, int, int, int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  uint8_t GF_log[256];
  uint8_t GF_ilog[256];
  uint8_t sbox[256];
  uint8_t isbox[256];
  uint8_t GF_Mul2[256];
  uint8_t GF_Mul3[256];
  uint8_t GF_Mul9[256];
  uint8_t GF_MulB[256];
  uint8_t GF_MulD[256];
  uint8_t GF_MulE[256];
  uint32_t sbox_mix0[256];
  uint32_t sbox_mix1[256];
  uint32_t sbox_mix2[256];
  uint32_t sbox_mix3[256];
  uint32_t isbox_mix0[256];
  uint32_t isbox_mix1[256];
  uint32_t isbox_mix2[256];
  uint32_t isbox_mix3[256];
  gen_GF_log_ilog(GF_log, GF_ilog);
  gen_AES_sbox(GF_log, GF_ilog, sbox, isbox);
  print_8bit_Ctbl("sbox", sizeof(sbox), 16, sbox);
  ;
  print_8bit_Ctbl("isbox", sizeof(isbox), 16, isbox);
  ;
  gen_GF_mul_table(GF_log, GF_ilog, GF_Mul2, 0x02);
  print_8bit_Ctbl("GF_Mul2", sizeof(GF_Mul2), 16, GF_Mul2);
  ;
  gen_GF_mul_table(GF_log, GF_ilog, GF_Mul3, 0x03);
  print_8bit_Ctbl("GF_Mul3", sizeof(GF_Mul3), 16, GF_Mul3);
  ;
  gen_GF_mul_table(GF_log, GF_ilog, GF_Mul9, 0x09);
  print_8bit_Ctbl("GF_Mul9", sizeof(GF_Mul9), 16, GF_Mul9);
  ;
  gen_GF_mul_table(GF_log, GF_ilog, GF_MulB, 0x0b);
  print_8bit_Ctbl("GF_MulB", sizeof(GF_MulB), 16, GF_MulB);
  ;
  gen_GF_mul_table(GF_log, GF_ilog, GF_MulD, 0x0d);
  print_8bit_Ctbl("GF_MulD", sizeof(GF_MulD), 16, GF_MulD);
  ;
  gen_GF_mul_table(GF_log, GF_ilog, GF_MulE, 0x0e);
  print_8bit_Ctbl("GF_MulE", sizeof(GF_MulE), 16, GF_MulE);
  ;
  gen_AES_mixsbox_table(GF_Mul2, GF_Mul3, sbox, sbox_mix0, 0);
  gen_AES_mixsbox_table(GF_Mul2, GF_Mul3, sbox, sbox_mix1, 1);
  gen_AES_mixsbox_table(GF_Mul2, GF_Mul3, sbox, sbox_mix2, 2);
  gen_AES_mixsbox_table(GF_Mul2, GF_Mul3, sbox, sbox_mix3, 3);
  print_32bit_Ctbl("sbox_mix0", sizeof(sbox_mix0) / 4, 8, sbox_mix0);
  ;
  print_32bit_Ctbl("sbox_mix1", sizeof(sbox_mix1) / 4, 8, sbox_mix1);
  ;
  print_32bit_Ctbl("sbox_mix2", sizeof(sbox_mix2) / 4, 8, sbox_mix2);
  ;
  print_32bit_Ctbl("sbox_mix3", sizeof(sbox_mix3) / 4, 8, sbox_mix3);
  ;
  gen_AES_imixsbox_table(GF_Mul9, GF_MulB, GF_MulD, GF_MulE, isbox, isbox_mix0,
                         0);
  gen_AES_imixsbox_table(GF_Mul9, GF_MulB, GF_MulD, GF_MulE, isbox, isbox_mix1,
                         1);
  gen_AES_imixsbox_table(GF_Mul9, GF_MulB, GF_MulD, GF_MulE, isbox, isbox_mix2,
                         2);
  gen_AES_imixsbox_table(GF_Mul9, GF_MulB, GF_MulD, GF_MulE, isbox, isbox_mix3,
                         3);
  print_32bit_Ctbl("isbox_mix0", sizeof(isbox_mix0) / 4, 8, isbox_mix0);
  ;
  print_32bit_Ctbl("isbox_mix1", sizeof(isbox_mix1) / 4, 8, isbox_mix1);
  ;
  print_32bit_Ctbl("isbox_mix2", sizeof(isbox_mix2) / 4, 8, isbox_mix2);
  ;
  print_32bit_Ctbl("isbox_mix3", sizeof(isbox_mix3) / 4, 8, isbox_mix3);
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4820,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
lea    -0x810(%rbp),%rsi
call   1030 <gen_GF_log_ilog@plt>
lea    -0x410(%rbp),%rdi
lea    -0x810(%rbp),%rsi
lea    -0xc10(%rbp),%rdx
lea    -0x1010(%rbp),%rcx
call   1080 <gen_AES_sbox@plt>
lea    -0xc10(%rbp),%rcx
lea    0xe36(%rip),%rdi
mov    $0x400,%esi
mov    $0x10,%edx
call   1050 <print_8bit_Ctbl@plt>
lea    -0x1010(%rbp),%rcx
lea    0xe18(%rip),%rdi
mov    $0x400,%esi
mov    $0x10,%edx
call   1050 <print_8bit_Ctbl@plt>
lea    -0x410(%rbp),%rdi
lea    -0x810(%rbp),%rsi
lea    -0x1410(%rbp),%rdx
mov    $0x2,%ecx
call   1070 <gen_GF_mul_table@plt>
lea    -0x1410(%rbp),%rcx
lea    0xde2(%rip),%rdi
mov    $0x400,%esi
mov    $0x10,%edx
call   1050 <print_8bit_Ctbl@plt>
lea    -0x410(%rbp),%rdi
lea    -0x810(%rbp),%rsi
lea    -0x1810(%rbp),%rdx
mov    $0x3,%ecx
call   1070 <gen_GF_mul_table@plt>
lea    -0x1810(%rbp),%rcx
lea    0xdae(%rip),%rdi
mov    $0x400,%esi
mov    $0x10,%edx
call   1050 <print_8bit_Ctbl@plt>
lea    -0x410(%rbp),%rdi
lea    -0x810(%rbp),%rsi
lea    -0x1c10(%rbp),%rdx
mov    $0x9,%ecx
call   1070 <gen_GF_mul_table@plt>
lea    -0x1c10(%rbp),%rcx
lea    0xd7a(%rip),%rdi
mov    $0x400,%esi
mov    $0x10,%edx
call   1050 <print_8bit_Ctbl@plt>
lea    -0x410(%rbp),%rdi
lea    -0x810(%rbp),%rsi
lea    -0x2010(%rbp),%rdx
mov    $0xb,%ecx
call   1070 <gen_GF_mul_table@plt>
lea    -0x2010(%rbp),%rcx
lea    0xd46(%rip),%rdi
mov    $0x400,%esi
mov    $0x10,%edx
call   1050 <print_8bit_Ctbl@plt>
lea    -0x410(%rbp),%rdi
lea    -0x810(%rbp),%rsi
lea    -0x2410(%rbp),%rdx
mov    $0xd,%ecx
call   1070 <gen_GF_mul_table@plt>
lea    -0x2410(%rbp),%rcx
lea    0xd12(%rip),%rdi
mov    $0x400,%esi
mov    $0x10,%edx
call   1050 <print_8bit_Ctbl@plt>
lea    -0x410(%rbp),%rdi
lea    -0x810(%rbp),%rsi
lea    -0x2810(%rbp),%rdx
mov    $0xe,%ecx
call   1070 <gen_GF_mul_table@plt>
lea    -0x2810(%rbp),%rcx
lea    0xcde(%rip),%rdi
mov    $0x400,%esi
mov    $0x10,%edx
call   1050 <print_8bit_Ctbl@plt>
lea    -0x1410(%rbp),%rdi
lea    -0x1810(%rbp),%rsi
lea    -0xc10(%rbp),%rdx
lea    -0x2c10(%rbp),%rcx
xor    %r8d,%r8d
call   1040 <gen_AES_mixsbox_table@plt>
lea    -0x1410(%rbp),%rdi
lea    -0x1810(%rbp),%rsi
lea    -0xc10(%rbp),%rdx
lea    -0x3010(%rbp),%rcx
mov    $0x1,%r8d
call   1040 <gen_AES_mixsbox_table@plt>
lea    -0x1410(%rbp),%rdi
lea    -0x1810(%rbp),%rsi
lea    -0xc10(%rbp),%rdx
lea    -0x3410(%rbp),%rcx
mov    $0x2,%r8d
call   1040 <gen_AES_mixsbox_table@plt>
lea    -0x1410(%rbp),%rdi
lea    -0x1810(%rbp),%rsi
lea    -0xc10(%rbp),%rdx
lea    -0x3810(%rbp),%rcx
mov    $0x3,%r8d
call   1040 <gen_AES_mixsbox_table@plt>
lea    -0x2c10(%rbp),%rcx
lea    0xc31(%rip),%rdi
mov    $0x100,%esi
mov    $0x8,%edx
call   1090 <print_32bit_Ctbl@plt>
lea    -0x3010(%rbp),%rcx
lea    0xc1f(%rip),%rdi
mov    $0x100,%esi
mov    $0x8,%edx
call   1090 <print_32bit_Ctbl@plt>
lea    -0x3410(%rbp),%rcx
lea    0xc0d(%rip),%rdi
mov    $0x100,%esi
mov    $0x8,%edx
call   1090 <print_32bit_Ctbl@plt>
lea    -0x3810(%rbp),%rcx
lea    0xbfb(%rip),%rdi
mov    $0x100,%esi
mov    $0x8,%edx
call   1090 <print_32bit_Ctbl@plt>
lea    -0x1c10(%rbp),%rdi
lea    -0x2010(%rbp),%rsi
lea    -0x2410(%rbp),%rdx
lea    -0x2810(%rbp),%rcx
lea    -0x1010(%rbp),%r8
lea    -0x3c10(%rbp),%r9
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1060 <gen_AES_imixsbox_table@plt>
lea    -0x1c10(%rbp),%rdi
lea    -0x2010(%rbp),%rsi
lea    -0x2410(%rbp),%rdx
lea    -0x2810(%rbp),%rcx
lea    -0x1010(%rbp),%r8
lea    -0x4010(%rbp),%r9
movl   $0x1,(%rsp)
call   1060 <gen_AES_imixsbox_table@plt>
lea    -0x1c10(%rbp),%rdi
lea    -0x2010(%rbp),%rsi
lea    -0x2410(%rbp),%rdx
lea    -0x2810(%rbp),%rcx
lea    -0x1010(%rbp),%r8
lea    -0x4410(%rbp),%r9
movl   $0x2,(%rsp)
call   1060 <gen_AES_imixsbox_table@plt>
lea    -0x1c10(%rbp),%rdi
lea    -0x2010(%rbp),%rsi
lea    -0x2410(%rbp),%rdx
lea    -0x2810(%rbp),%rcx
lea    -0x1010(%rbp),%r8
lea    -0x4810(%rbp),%r9
movl   $0x3,(%rsp)
call   1060 <gen_AES_imixsbox_table@plt>
lea    -0x3c10(%rbp),%rcx
lea    0xae2(%rip),%rdi
mov    $0x100,%esi
mov    $0x8,%edx
call   1090 <print_32bit_Ctbl@plt>
lea    -0x4010(%rbp),%rcx
lea    0xad0(%rip),%rdi
mov    $0x100,%esi
mov    $0x8,%edx
call   1090 <print_32bit_Ctbl@plt>
lea    -0x4410(%rbp),%rcx
lea    0xabe(%rip),%rdi
mov    $0x100,%esi
mov    $0x8,%edx
call   1090 <print_32bit_Ctbl@plt>
lea    -0x4810(%rbp),%rcx
lea    0xaac(%rip),%rdi
mov    $0x100,%esi
mov    $0x8,%edx
call   1090 <print_32bit_Ctbl@plt>
xor    %eax,%eax
add    $0x4820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x4818,%rsp
lea    0x4410(%rsp),%r15
lea    0x4010(%rsp),%r12
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <gen_GF_log_ilog@plt>
lea    0x2410(%rsp),%rbp
lea    0x2010(%rsp),%rbx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbp,%rdx
mov    %rbx,%rcx
call   1080 <gen_AES_sbox@plt>
lea    0xe3d(%rip),%rdi
mov    $0x400,%esi
mov    $0x10,%edx
mov    %rbp,%rcx
call   1050 <print_8bit_Ctbl@plt>
lea    0xe23(%rip),%rdi
mov    $0x400,%esi
mov    $0x10,%edx
mov    %rbx,%rcx
call   1050 <print_8bit_Ctbl@plt>
lea    0x3c10(%rsp),%rbp
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbp,%rdx
mov    $0x2,%ecx
call   1070 <gen_GF_mul_table@plt>
lea    0xdf5(%rip),%rdi
mov    $0x400,%esi
mov    $0x10,%edx
mov    %rbp,%rcx
call   1050 <print_8bit_Ctbl@plt>
lea    0x3810(%rsp),%r13
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    $0x3,%ecx
call   1070 <gen_GF_mul_table@plt>
lea    0xdc9(%rip),%rdi
mov    $0x400,%esi
mov    $0x10,%edx
mov    %r13,%rcx
call   1050 <print_8bit_Ctbl@plt>
lea    0x1c10(%rsp),%rbx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    $0x9,%ecx
call   1070 <gen_GF_mul_table@plt>
lea    0xd9d(%rip),%rdi
mov    $0x400,%esi
mov    $0x10,%edx
mov    %rbx,%rcx
call   1050 <print_8bit_Ctbl@plt>
lea    0x1810(%rsp),%rbx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    $0xb,%ecx
call   1070 <gen_GF_mul_table@plt>
lea    0xd71(%rip),%rdi
mov    $0x400,%esi
mov    $0x10,%edx
mov    %rbx,%rcx
call   1050 <print_8bit_Ctbl@plt>
lea    0x1410(%rsp),%rbx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    $0xd,%ecx
call   1070 <gen_GF_mul_table@plt>
lea    0xd45(%rip),%rdi
mov    $0x400,%esi
mov    $0x10,%edx
mov    %rbx,%rcx
call   1050 <print_8bit_Ctbl@plt>
lea    0x3410(%rsp),%r14
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
mov    $0xe,%ecx
call   1070 <gen_GF_mul_table@plt>
lea    0xd19(%rip),%rdi
mov    $0x400,%esi
mov    $0x10,%edx
mov    %r14,%rcx
call   1050 <print_8bit_Ctbl@plt>
lea    0x1010(%rsp),%rcx
mov    %rbp,%rdi
mov    %r13,%rsi
lea    0x2410(%rsp),%rbx
mov    %rbx,%rdx
xor    %r8d,%r8d
call   1040 <gen_AES_mixsbox_table@plt>
lea    0xc10(%rsp),%rcx
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
mov    $0x1,%r8d
call   1040 <gen_AES_mixsbox_table@plt>
lea    0x3010(%rsp),%r12
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
mov    %r12,%rcx
mov    $0x2,%r8d
call   1040 <gen_AES_mixsbox_table@plt>
lea    0x2c10(%rsp),%r15
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
mov    %r15,%rcx
mov    $0x3,%r8d
call   1040 <gen_AES_mixsbox_table@plt>
lea    0xc8e(%rip),%rdi
mov    $0x100,%esi
mov    $0x8,%edx
lea    0x1010(%rsp),%rcx
call   1090 <print_32bit_Ctbl@plt>
lea    0xc7b(%rip),%rdi
mov    $0x100,%esi
mov    $0x8,%edx
lea    0xc10(%rsp),%rcx
call   1090 <print_32bit_Ctbl@plt>
lea    0xc68(%rip),%rdi
mov    $0x100,%esi
mov    $0x8,%edx
mov    %r12,%rcx
call   1090 <print_32bit_Ctbl@plt>
lea    0xc5a(%rip),%rdi
mov    $0x100,%esi
mov    $0x8,%edx
mov    %r15,%rcx
call   1090 <print_32bit_Ctbl@plt>
movl   $0x0,(%rsp)
lea    0x810(%rsp),%r9
lea    0x1c10(%rsp),%rbp
mov    %rbp,%rdi
lea    0x1810(%rsp),%r15
mov    %r15,%rsi
lea    0x1410(%rsp),%r12
mov    %r12,%rdx
mov    %r14,%rcx
lea    0x2010(%rsp),%rbx
mov    %rbx,%r8
call   1060 <gen_AES_imixsbox_table@plt>
movl   $0x1,(%rsp)
lea    0x410(%rsp),%r9
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %rbx,%r8
call   1060 <gen_AES_imixsbox_table@plt>
movl   $0x2,(%rsp)
lea    0x10(%rsp),%r9
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %rbx,%r8
call   1060 <gen_AES_imixsbox_table@plt>
movl   $0x3,(%rsp)
lea    0x2810(%rsp),%r13
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %rbx,%r8
mov    %r13,%r9
call   1060 <gen_AES_imixsbox_table@plt>
lea    0xb73(%rip),%rdi
mov    $0x100,%esi
mov    $0x8,%edx
lea    0x810(%rsp),%rcx
call   1090 <print_32bit_Ctbl@plt>
lea    0xb60(%rip),%rdi
mov    $0x100,%esi
mov    $0x8,%edx
lea    0x410(%rsp),%rcx
call   1090 <print_32bit_Ctbl@plt>
lea    0xb4d(%rip),%rdi
mov    $0x100,%esi
mov    $0x8,%edx
lea    0x10(%rsp),%rcx
call   1090 <print_32bit_Ctbl@plt>
lea    0xb3d(%rip),%rdi
mov    $0x100,%esi
mov    $0x8,%edx
mov    %r13,%rcx
call   1090 <print_32bit_Ctbl@plt>
xor    %eax,%eax
add    $0x4818,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"sbox\00"
@.str.1 = [6 x i8] c"isbox\00"
@.str.2 = [8 x i8] c"GF_Mul2\00"
@.str.3 = [8 x i8] c"GF_Mul3\00"
@.str.4 = [8 x i8] c"GF_Mul9\00"
@.str.5 = [8 x i8] c"GF_MulB\00"
@.str.6 = [8 x i8] c"GF_MulD\00"
@.str.7 = [8 x i8] c"GF_MulE\00"
@.str.8 = [10 x i8] c"sbox_mix0\00"
@.str.9 = [10 x i8] c"sbox_mix1\00"
@.str.10 = [10 x i8] c"sbox_mix2\00"
@.str.11 = [10 x i8] c"sbox_mix3\00"
@.str.12 = [11 x i8] c"isbox_mix0\00"
@.str.13 = [11 x i8] c"isbox_mix1\00"
@.str.14 = [11 x i8] c"isbox_mix2\00"
@.str.15 = [11 x i8] c"isbox_mix3\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i32]
%7 = alloca [256 x i32]
%8 = alloca [256 x i32]
%9 = alloca [256 x i32]
%10 = alloca [256 x i32]
%11 = alloca [256 x i32]
%12 = alloca [256 x i32]
%13 = alloca [256 x i32]
%14 = alloca [256 x i32]
%15 = alloca [256 x i32]
%16 = alloca [256 x i32]
%17 = alloca [256 x i32]
%18 = alloca [256 x i32]
%19 = alloca [256 x i32]
%20 = alloca [256 x i32]
%21 = alloca [256 x i32]
%22 = alloca [256 x i32]
%23 = alloca [256 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%24 = getelementptr inbounds [256 x i32], [256 x i32]* %6, i64 0, i64 0
%25 = getelementptr inbounds [256 x i32], [256 x i32]* %7, i64 0, i64 0
%26 = call i32 @gen_GF_log_ilog(i32* %24, i32* %25)
%27 = getelementptr inbounds [256 x i32], [256 x i32]* %6, i64 0, i64 0
%28 = getelementptr inbounds [256 x i32], [256 x i32]* %7, i64 0, i64 0
%29 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 0
%30 = getelementptr inbounds [256 x i32], [256 x i32]* %9, i64 0, i64 0
%31 = call i32 @gen_AES_sbox(i32* %27, i32* %28, i32* %29, i32* %30)
%32 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 0
%33 = call i32 @print_8bit_Ctbl(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1024, i32 16, i32* %32)
%34 = getelementptr inbounds [256 x i32], [256 x i32]* %9, i64 0, i64 0
%35 = call i32 @print_8bit_Ctbl(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 1024, i32 16, i32* %34)
%36 = getelementptr inbounds [256 x i32], [256 x i32]* %6, i64 0, i64 0
%37 = getelementptr inbounds [256 x i32], [256 x i32]* %7, i64 0, i64 0
%38 = getelementptr inbounds [256 x i32], [256 x i32]* %10, i64 0, i64 0
%39 = call i32 @gen_GF_mul_table(i32* %36, i32* %37, i32* %38, i32 2)
%40 = getelementptr inbounds [256 x i32], [256 x i32]* %10, i64 0, i64 0
%41 = call i32 @print_8bit_Ctbl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 1024, i32 16, i32* %40)
%42 = getelementptr inbounds [256 x i32], [256 x i32]* %6, i64 0, i64 0
%43 = getelementptr inbounds [256 x i32], [256 x i32]* %7, i64 0, i64 0
%44 = getelementptr inbounds [256 x i32], [256 x i32]* %11, i64 0, i64 0
%45 = call i32 @gen_GF_mul_table(i32* %42, i32* %43, i32* %44, i32 3)
%46 = getelementptr inbounds [256 x i32], [256 x i32]* %11, i64 0, i64 0
%47 = call i32 @print_8bit_Ctbl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 1024, i32 16, i32* %46)
%48 = getelementptr inbounds [256 x i32], [256 x i32]* %6, i64 0, i64 0
%49 = getelementptr inbounds [256 x i32], [256 x i32]* %7, i64 0, i64 0
%50 = getelementptr inbounds [256 x i32], [256 x i32]* %12, i64 0, i64 0
%51 = call i32 @gen_GF_mul_table(i32* %48, i32* %49, i32* %50, i32 9)
%52 = getelementptr inbounds [256 x i32], [256 x i32]* %12, i64 0, i64 0
%53 = call i32 @print_8bit_Ctbl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 1024, i32 16, i32* %52)
%54 = getelementptr inbounds [256 x i32], [256 x i32]* %6, i64 0, i64 0
%55 = getelementptr inbounds [256 x i32], [256 x i32]* %7, i64 0, i64 0
%56 = getelementptr inbounds [256 x i32], [256 x i32]* %13, i64 0, i64 0
%57 = call i32 @gen_GF_mul_table(i32* %54, i32* %55, i32* %56, i32 11)
%58 = getelementptr inbounds [256 x i32], [256 x i32]* %13, i64 0, i64 0
%59 = call i32 @print_8bit_Ctbl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 1024, i32 16, i32* %58)
%60 = getelementptr inbounds [256 x i32], [256 x i32]* %6, i64 0, i64 0
%61 = getelementptr inbounds [256 x i32], [256 x i32]* %7, i64 0, i64 0
%62 = getelementptr inbounds [256 x i32], [256 x i32]* %14, i64 0, i64 0
%63 = call i32 @gen_GF_mul_table(i32* %60, i32* %61, i32* %62, i32 13)
%64 = getelementptr inbounds [256 x i32], [256 x i32]* %14, i64 0, i64 0
%65 = call i32 @print_8bit_Ctbl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i32 1024, i32 16, i32* %64)
%66 = getelementptr inbounds [256 x i32], [256 x i32]* %6, i64 0, i64 0
%67 = getelementptr inbounds [256 x i32], [256 x i32]* %7, i64 0, i64 0
%68 = getelementptr inbounds [256 x i32], [256 x i32]* %15, i64 0, i64 0
%69 = call i32 @gen_GF_mul_table(i32* %66, i32* %67, i32* %68, i32 14)
%70 = getelementptr inbounds [256 x i32], [256 x i32]* %15, i64 0, i64 0
%71 = call i32 @print_8bit_Ctbl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 1024, i32 16, i32* %70)
%72 = getelementptr inbounds [256 x i32], [256 x i32]* %10, i64 0, i64 0
%73 = getelementptr inbounds [256 x i32], [256 x i32]* %11, i64 0, i64 0
%74 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 0
%75 = getelementptr inbounds [256 x i32], [256 x i32]* %16, i64 0, i64 0
%76 = call i32 @gen_AES_mixsbox_table(i32* %72, i32* %73, i32* %74, i32* %75, i32 0)
%77 = getelementptr inbounds [256 x i32], [256 x i32]* %10, i64 0, i64 0
%78 = getelementptr inbounds [256 x i32], [256 x i32]* %11, i64 0, i64 0
%79 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 0
%80 = getelementptr inbounds [256 x i32], [256 x i32]* %17, i64 0, i64 0
%81 = call i32 @gen_AES_mixsbox_table(i32* %77, i32* %78, i32* %79, i32* %80, i32 1)
%82 = getelementptr inbounds [256 x i32], [256 x i32]* %10, i64 0, i64 0
%83 = getelementptr inbounds [256 x i32], [256 x i32]* %11, i64 0, i64 0
%84 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 0
%85 = getelementptr inbounds [256 x i32], [256 x i32]* %18, i64 0, i64 0
%86 = call i32 @gen_AES_mixsbox_table(i32* %82, i32* %83, i32* %84, i32* %85, i32 2)
%87 = getelementptr inbounds [256 x i32], [256 x i32]* %10, i64 0, i64 0
%88 = getelementptr inbounds [256 x i32], [256 x i32]* %11, i64 0, i64 0
%89 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 0
%90 = getelementptr inbounds [256 x i32], [256 x i32]* %19, i64 0, i64 0
%91 = call i32 @gen_AES_mixsbox_table(i32* %87, i32* %88, i32* %89, i32* %90, i32 3)
%92 = getelementptr inbounds [256 x i32], [256 x i32]* %16, i64 0, i64 0
%93 = call i32 @print_32bit_Ctbl(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 256, i32 8, i32* %92)
%94 = getelementptr inbounds [256 x i32], [256 x i32]* %17, i64 0, i64 0
%95 = call i32 @print_32bit_Ctbl(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 256, i32 8, i32* %94)
%96 = getelementptr inbounds [256 x i32], [256 x i32]* %18, i64 0, i64 0
%97 = call i32 @print_32bit_Ctbl(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32 256, i32 8, i32* %96)
%98 = getelementptr inbounds [256 x i32], [256 x i32]* %19, i64 0, i64 0
%99 = call i32 @print_32bit_Ctbl(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i32 256, i32 8, i32* %98)
%100 = getelementptr inbounds [256 x i32], [256 x i32]* %12, i64 0, i64 0
%101 = getelementptr inbounds [256 x i32], [256 x i32]* %13, i64 0, i64 0
%102 = getelementptr inbounds [256 x i32], [256 x i32]* %14, i64 0, i64 0
%103 = getelementptr inbounds [256 x i32], [256 x i32]* %15, i64 0, i64 0
%104 = getelementptr inbounds [256 x i32], [256 x i32]* %9, i64 0, i64 0
%105 = getelementptr inbounds [256 x i32], [256 x i32]* %20, i64 0, i64 0
%106 = call i32 @gen_AES_imixsbox_table(i32* %100, i32* %101, i32* %102, i32* %103, i32* %104, i32* %105, i32 0)
%107 = getelementptr inbounds [256 x i32], [256 x i32]* %12, i64 0, i64 0
%108 = getelementptr inbounds [256 x i32], [256 x i32]* %13, i64 0, i64 0
%109 = getelementptr inbounds [256 x i32], [256 x i32]* %14, i64 0, i64 0
%110 = getelementptr inbounds [256 x i32], [256 x i32]* %15, i64 0, i64 0
%111 = getelementptr inbounds [256 x i32], [256 x i32]* %9, i64 0, i64 0
%112 = getelementptr inbounds [256 x i32], [256 x i32]* %21, i64 0, i64 0
%113 = call i32 @gen_AES_imixsbox_table(i32* %107, i32* %108, i32* %109, i32* %110, i32* %111, i32* %112, i32 1)
%114 = getelementptr inbounds [256 x i32], [256 x i32]* %12, i64 0, i64 0
%115 = getelementptr inbounds [256 x i32], [256 x i32]* %13, i64 0, i64 0
%116 = getelementptr inbounds [256 x i32], [256 x i32]* %14, i64 0, i64 0
%117 = getelementptr inbounds [256 x i32], [256 x i32]* %15, i64 0, i64 0
%118 = getelementptr inbounds [256 x i32], [256 x i32]* %9, i64 0, i64 0
%119 = getelementptr inbounds [256 x i32], [256 x i32]* %22, i64 0, i64 0
%120 = call i32 @gen_AES_imixsbox_table(i32* %114, i32* %115, i32* %116, i32* %117, i32* %118, i32* %119, i32 2)
%121 = getelementptr inbounds [256 x i32], [256 x i32]* %12, i64 0, i64 0
%122 = getelementptr inbounds [256 x i32], [256 x i32]* %13, i64 0, i64 0
%123 = getelementptr inbounds [256 x i32], [256 x i32]* %14, i64 0, i64 0
%124 = getelementptr inbounds [256 x i32], [256 x i32]* %15, i64 0, i64 0
%125 = getelementptr inbounds [256 x i32], [256 x i32]* %9, i64 0, i64 0
%126 = getelementptr inbounds [256 x i32], [256 x i32]* %23, i64 0, i64 0
%127 = call i32 @gen_AES_imixsbox_table(i32* %121, i32* %122, i32* %123, i32* %124, i32* %125, i32* %126, i32 3)
%128 = getelementptr inbounds [256 x i32], [256 x i32]* %20, i64 0, i64 0
%129 = call i32 @print_32bit_Ctbl(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i32 256, i32 8, i32* %128)
%130 = getelementptr inbounds [256 x i32], [256 x i32]* %21, i64 0, i64 0
%131 = call i32 @print_32bit_Ctbl(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i32 256, i32 8, i32* %130)
%132 = getelementptr inbounds [256 x i32], [256 x i32]* %22, i64 0, i64 0
%133 = call i32 @print_32bit_Ctbl(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i32 256, i32 8, i32* %132)
%134 = getelementptr inbounds [256 x i32], [256 x i32]* %23, i64 0, i64 0
%135 = call i32 @print_32bit_Ctbl(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0), i32 256, i32 8, i32* %134)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"sbox\00"
@.str.1 = [6 x i8] c"isbox\00"
@.str.2 = [8 x i8] c"GF_Mul2\00"
@.str.3 = [8 x i8] c"GF_Mul3\00"
@.str.4 = [8 x i8] c"GF_Mul9\00"
@.str.5 = [8 x i8] c"GF_MulB\00"
@.str.6 = [8 x i8] c"GF_MulD\00"
@.str.7 = [8 x i8] c"GF_MulE\00"
@.str.8 = [10 x i8] c"sbox_mix0\00"
@.str.9 = [10 x i8] c"sbox_mix1\00"
@.str.10 = [10 x i8] c"sbox_mix2\00"
@.str.11 = [10 x i8] c"sbox_mix3\00"
@.str.12 = [11 x i8] c"isbox_mix0\00"
@.str.13 = [11 x i8] c"isbox_mix1\00"
@.str.14 = [11 x i8] c"isbox_mix2\00"
@.str.15 = [11 x i8] c"isbox_mix3\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [256 x i32]
%4 = alloca [256 x i32]
%5 = alloca [256 x i32]
%6 = alloca [256 x i32]
%7 = alloca [256 x i32]
%8 = alloca [256 x i32]
%9 = alloca [256 x i32]
%10 = alloca [256 x i32]
%11 = alloca [256 x i32]
%12 = alloca [256 x i32]
%13 = alloca [256 x i32]
%14 = alloca [256 x i32]
%15 = alloca [256 x i32]
%16 = alloca [256 x i32]
%17 = alloca [256 x i32]
%18 = alloca [256 x i32]
%19 = alloca [256 x i32]
%20 = alloca [256 x i32]
%21 = bitcast [256 x i32]* %3 to i8*
%22 = bitcast [256 x i32]* %4 to i8*
%23 = bitcast [256 x i32]* %5 to i8*
%24 = bitcast [256 x i32]* %6 to i8*
%25 = bitcast [256 x i32]* %7 to i8*
%26 = bitcast [256 x i32]* %8 to i8*
%27 = bitcast [256 x i32]* %9 to i8*
%28 = bitcast [256 x i32]* %10 to i8*
%29 = bitcast [256 x i32]* %11 to i8*
%30 = bitcast [256 x i32]* %12 to i8*
%31 = bitcast [256 x i32]* %13 to i8*
%32 = bitcast [256 x i32]* %14 to i8*
%33 = bitcast [256 x i32]* %15 to i8*
%34 = bitcast [256 x i32]* %16 to i8*
%35 = bitcast [256 x i32]* %17 to i8*
%36 = bitcast [256 x i32]* %18 to i8*
%37 = bitcast [256 x i32]* %19 to i8*
%38 = bitcast [256 x i32]* %20 to i8*
%39 = getelementptr inbounds [256 x i32], [256 x i32]* %3, i64 0, i64 0
%40 = getelementptr inbounds [256 x i32], [256 x i32]* %4, i64 0, i64 0
%41 = call i32 @gen_GF_log_ilog(i32* %39, i32* %40)
%42 = getelementptr inbounds [256 x i32], [256 x i32]* %5, i64 0, i64 0
%43 = getelementptr inbounds [256 x i32], [256 x i32]* %6, i64 0, i64 0
%44 = call i32 @gen_AES_sbox(i32* %39, i32* %40, i32* %42, i32* %43)
%45 = call i32 @print_8bit_Ctbl(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1024, i32 16, i32* %42)
%46 = call i32 @print_8bit_Ctbl(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 1024, i32 16, i32* %43)
%47 = getelementptr inbounds [256 x i32], [256 x i32]* %7, i64 0, i64 0
%48 = call i32 @gen_GF_mul_table(i32* %39, i32* %40, i32* %47, i32 2)
%49 = call i32 @print_8bit_Ctbl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 1024, i32 16, i32* %47)
%50 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 0
%51 = call i32 @gen_GF_mul_table(i32* %39, i32* %40, i32* %50, i32 3)
%52 = call i32 @print_8bit_Ctbl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 1024, i32 16, i32* %50)
%53 = getelementptr inbounds [256 x i32], [256 x i32]* %9, i64 0, i64 0
%54 = call i32 @gen_GF_mul_table(i32* %39, i32* %40, i32* %53, i32 9)
%55 = call i32 @print_8bit_Ctbl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 1024, i32 16, i32* %53)
%56 = getelementptr inbounds [256 x i32], [256 x i32]* %10, i64 0, i64 0
%57 = call i32 @gen_GF_mul_table(i32* %39, i32* %40, i32* %56, i32 11)
%58 = call i32 @print_8bit_Ctbl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 1024, i32 16, i32* %56)
%59 = getelementptr inbounds [256 x i32], [256 x i32]* %11, i64 0, i64 0
%60 = call i32 @gen_GF_mul_table(i32* %39, i32* %40, i32* %59, i32 13)
%61 = call i32 @print_8bit_Ctbl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i32 1024, i32 16, i32* %59)
%62 = getelementptr inbounds [256 x i32], [256 x i32]* %12, i64 0, i64 0
%63 = call i32 @gen_GF_mul_table(i32* %39, i32* %40, i32* %62, i32 14)
%64 = call i32 @print_8bit_Ctbl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 1024, i32 16, i32* %62)
%65 = getelementptr inbounds [256 x i32], [256 x i32]* %13, i64 0, i64 0
%66 = call i32 @gen_AES_mixsbox_table(i32* %47, i32* %50, i32* %42, i32* %65, i32 0)
%67 = getelementptr inbounds [256 x i32], [256 x i32]* %14, i64 0, i64 0
%68 = call i32 @gen_AES_mixsbox_table(i32* %47, i32* %50, i32* %42, i32* %67, i32 1)
%69 = getelementptr inbounds [256 x i32], [256 x i32]* %15, i64 0, i64 0
%70 = call i32 @gen_AES_mixsbox_table(i32* %47, i32* %50, i32* %42, i32* %69, i32 2)
%71 = getelementptr inbounds [256 x i32], [256 x i32]* %16, i64 0, i64 0
%72 = call i32 @gen_AES_mixsbox_table(i32* %47, i32* %50, i32* %42, i32* %71, i32 3)
%73 = call i32 @print_32bit_Ctbl(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 256, i32 8, i32* %65)
%74 = call i32 @print_32bit_Ctbl(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 256, i32 8, i32* %67)
%75 = call i32 @print_32bit_Ctbl(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32 256, i32 8, i32* %69)
%76 = call i32 @print_32bit_Ctbl(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i32 256, i32 8, i32* %71)
%77 = getelementptr inbounds [256 x i32], [256 x i32]* %17, i64 0, i64 0
%78 = call i32 @gen_AES_imixsbox_table(i32* %53, i32* %56, i32* %59, i32* %62, i32* %43, i32* %77, i32 0)
%79 = getelementptr inbounds [256 x i32], [256 x i32]* %18, i64 0, i64 0
%80 = call i32 @gen_AES_imixsbox_table(i32* %53, i32* %56, i32* %59, i32* %62, i32* %43, i32* %79, i32 1)
%81 = getelementptr inbounds [256 x i32], [256 x i32]* %19, i64 0, i64 0
%82 = call i32 @gen_AES_imixsbox_table(i32* %53, i32* %56, i32* %59, i32* %62, i32* %43, i32* %81, i32 2)
%83 = getelementptr inbounds [256 x i32], [256 x i32]* %20, i64 0, i64 0
%84 = call i32 @gen_AES_imixsbox_table(i32* %53, i32* %56, i32* %59, i32* %62, i32* %43, i32* %83, i32 3)
%85 = call i32 @print_32bit_Ctbl(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i32 256, i32 8, i32* %77)
%86 = call i32 @print_32bit_Ctbl(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i32 256, i32 8, i32* %79)
%87 = call i32 @print_32bit_Ctbl(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i32 256, i32 8, i32* %81)
%88 = call i32 @print_32bit_Ctbl(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0), i32 256, i32 8, i32* %83)
ret i32 0
}