#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*/ make_tables(int);
int /*<<< orphan*/ printSMIX(int, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ print_core(int, int, int, int);
int /*<<< orphan*/ printf(char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int java;
  java = argc >= 2 && strcmp(argv[1], "java") == 0;
  make_tables(java);
  print_core(2, 2, 30, java);
  print_core(2, 3, 36, java);
  print_core(2, 4, 36, java);
  if (java) {
    printf("\n");
    printf("/* SMIX */\n");
    printSMIX(2, 0, 30, 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x2,-0x8(%rbp)
mov    %al,-0x15(%rbp)
jl     1193 <main+0x43>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe7c(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <make_tables@plt>
mov    -0x14(%rbp),%ecx
mov    $0x2,%esi
mov    $0x1e,%edx
mov    %esi,%edi
call   1050 <print_core@plt>
mov    -0x14(%rbp),%ecx
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x24,%edx
call   1050 <print_core@plt>
mov    -0x14(%rbp),%ecx
mov    $0x2,%edi
mov    $0x4,%esi
mov    $0x24,%edx
call   1050 <print_core@plt>
cmpl   $0x0,-0x14(%rbp)
je     1220 <main+0xd0>
lea    0xe16(%rip),%rdi
call   1040 <printf@plt>
lea    0xe00(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
xor    %esi,%esi
mov    $0x1e,%edx
mov    $0x1,%ecx
call   1070 <printSMIX@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jl     117e <main+0x1e>
mov    0x8(%rsi),%rdi
lea    0xe8f(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
sete   %al
jmp    1180 <main+0x20>
xor    %eax,%eax
movzbl %al,%ebx
mov    %ebx,%edi
call   1040 <make_tables@plt>
mov    $0x2,%edi
mov    $0x2,%esi
mov    $0x1e,%edx
mov    %ebx,%ecx
call   1060 <print_core@plt>
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x24,%edx
mov    %ebx,%ecx
call   1060 <print_core@plt>
mov    $0x2,%edi
mov    $0x4,%esi
mov    $0x24,%edx
mov    %ebx,%ecx
call   1060 <print_core@plt>
test   %bl,%bl
je     11fc <main+0x9c>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe24(%rip),%rdi
call   1050 <puts@plt>
mov    $0x2,%edi
xor    %esi,%esi
mov    $0x1e,%edx
mov    $0x1,%ecx
call   1080 <printSMIX@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"java\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [12 x i8] c"/* SMIX */\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 2
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br label %15
15: ; preds = %9, %2
%16 = phi i1 [ false, %2 ], [ %14, %9 ]
%17 = zext i1 %16 to i32
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = call i32 @make_tables(i32 %18)
%20 = load i32, i32* %6
%21 = call i32 @print_core(i32 2, i32 2, i32 30, i32 %20)
%22 = load i32, i32* %6
%23 = call i32 @print_core(i32 2, i32 3, i32 36, i32 %22)
%24 = load i32, i32* %6
%25 = call i32 @print_core(i32 2, i32 4, i32 36, i32 %24)
%26 = load i32, i32* %6
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %32
28: ; preds = %15
%29 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%30 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%31 = call i32 @printSMIX(i32 2, i32 0, i32 30, i32 1)
br label %32
32: ; preds = %28, %15
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"java\00"
@str = [11 x i8] c"/* SMIX */\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br label %9
9: ; preds = %4, %2
%10 = phi i1 [ false, %2 ], [ %8, %4 ]
%11 = zext i1 %10 to i32
%12 = tail call i32 @make_tables(i32 %11)
%13 = tail call i32 @print_core(i32 2, i32 2, i32 30, i32 %11)
%14 = tail call i32 @print_core(i32 2, i32 3, i32 36, i32 %11)
%15 = tail call i32 @print_core(i32 2, i32 4, i32 36, i32 %11)
br i1 %10, label %16, label %20
16: ; preds = %9
%17 = tail call i32 @putchar(i32 10)
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%19 = tail call i32 @printSMIX(i32 2, i32 0, i32 30, i32 1)
br label %20
20: ; preds = %16, %9
ret i32 0
}