#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*/ printf(char *, ...);
void print_token(int token) {
  static char *token_strs[] = {
      "T_Le",         "T_Ge",    "T_Eq",          "T_Ne",
      "T_And",        "T_Or",    "T_IntConstant", "T_StringConstant",
      "T_Identifier", "T_Void",  "T_Int",         "T_While",
      "T_If",         "T_Else",  "T_Return",      "T_Break",
      "T_Continue",   "T_Print", "T_ReadInt"};
  if (token < 256) {
    printf("%-20c", token);
  } else {
    printf("%-20s", token_strs[token - 256]);
  }
}


x86 assembly (clang, -O0):
<print_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    113e <print_token+0x2e>
mov    -0x4(%rbp),%esi
lea    0xf68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1162 <print_token+0x52>
mov    -0x4(%rbp),%eax
sub    $0x100,%eax
movslq %eax,%rcx
lea    0x2ee0(%rip),%rax
mov    (%rax,%rcx,8),%rsi
lea    0xf45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_token>:
mov    %edi,%esi
cmp    $0xff,%edi
jg     1128 <print_token+0x18>
lea    0xfc5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
add    $0xffffff00,%esi
lea    0xecb(%rip),%rax
movslq (%rax,%rsi,4),%rsi
add    %rax,%rsi
lea    0xfa9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@print_token.token_strs = internal global [19 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i32 0, i32 0)]
@.str = [5 x i8] c"T_Le\00"
@.str.1 = [5 x i8] c"T_Ge\00"
@.str.2 = [5 x i8] c"T_Eq\00"
@.str.3 = [5 x i8] c"T_Ne\00"
@.str.4 = [6 x i8] c"T_And\00"
@.str.5 = [5 x i8] c"T_Or\00"
@.str.6 = [14 x i8] c"T_IntConstant\00"
@.str.7 = [17 x i8] c"T_StringConstant\00"
@.str.8 = [13 x i8] c"T_Identifier\00"
@.str.9 = [7 x i8] c"T_Void\00"
@.str.10 = [6 x i8] c"T_Int\00"
@.str.11 = [8 x i8] c"T_While\00"
@.str.12 = [5 x i8] c"T_If\00"
@.str.13 = [7 x i8] c"T_Else\00"
@.str.14 = [9 x i8] c"T_Return\00"
@.str.15 = [8 x i8] c"T_Break\00"
@.str.16 = [11 x i8] c"T_Continue\00"
@.str.17 = [8 x i8] c"T_Print\00"
@.str.18 = [10 x i8] c"T_ReadInt\00"
@.str.19 = [6 x i8] c"%-20c\00"
@.str.20 = [6 x i8] c"%-20s\00"
define void @print_token(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 256
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i32 %6)
br label %15
8: ; preds = %1
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 256
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [19 x i8*], [19 x i8*]* @print_token.token_strs, i64 0, i64 %11
%13 = load i8*, i8** %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@reltable.print_token = internal unnamed_addr constant [19 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str to i64), i64 ptrtoint ([19 x i32]* @reltable.print_token to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([19 x i32]* @reltable.print_token to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.2 to i64), i64 ptrtoint ([19 x i32]* @reltable.print_token to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.3 to i64), i64 ptrtoint ([19 x i32]* @reltable.print_token to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.4 to i64), i64 ptrtoint ([19 x i32]* @reltable.print_token to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.5 to i64), i64 ptrtoint ([19 x i32]* @reltable.print_token to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.6 to i64), i64 ptrtoint ([19 x i32]* @reltable.print_token to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.7 to i64), i64 ptrtoint ([19 x i32]* @reltable.print_token to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.8 to i64), i64 ptrtoint ([19 x i32]* @reltable.print_token to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.9 to i64), i64 ptrtoint ([19 x i32]* @reltable.print_token to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.10 to i64), i64 ptrtoint ([19 x i32]* @reltable.print_token to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.11 to i64), i64 ptrtoint ([19 x i32]* @reltable.print_token to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.12 to i64), i64 ptrtoint ([19 x i32]* @reltable.print_token to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.13 to i64), i64 ptrtoint ([19 x i32]* @reltable.print_token to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.14 to i64), i64 ptrtoint ([19 x i32]* @reltable.print_token to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.15 to i64), i64 ptrtoint ([19 x i32]* @reltable.print_token to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.16 to i64), i64 ptrtoint ([19 x i32]* @reltable.print_token to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.17 to i64), i64 ptrtoint ([19 x i32]* @reltable.print_token to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.18 to i64), i64 ptrtoint ([19 x i32]* @reltable.print_token to i64)) to i32)]
@.str = [5 x i8] c"T_Le\00"
@.str.1 = [5 x i8] c"T_Ge\00"
@.str.2 = [5 x i8] c"T_Eq\00"
@.str.3 = [5 x i8] c"T_Ne\00"
@.str.4 = [6 x i8] c"T_And\00"
@.str.5 = [5 x i8] c"T_Or\00"
@.str.6 = [14 x i8] c"T_IntConstant\00"
@.str.7 = [17 x i8] c"T_StringConstant\00"
@.str.8 = [13 x i8] c"T_Identifier\00"
@.str.9 = [7 x i8] c"T_Void\00"
@.str.10 = [6 x i8] c"T_Int\00"
@.str.11 = [8 x i8] c"T_While\00"
@.str.12 = [5 x i8] c"T_If\00"
@.str.13 = [7 x i8] c"T_Else\00"
@.str.14 = [9 x i8] c"T_Return\00"
@.str.15 = [8 x i8] c"T_Break\00"
@.str.16 = [11 x i8] c"T_Continue\00"
@.str.17 = [8 x i8] c"T_Print\00"
@.str.18 = [10 x i8] c"T_ReadInt\00"
@.str.19 = [6 x i8] c"%-20c\00"
@.str.20 = [6 x i8] c"%-20s\00"
define void @print_token(i32 %0) {
%2 = icmp slt i32 %0, 256
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i32 %0)
br label %11
5: ; preds = %1
%6 = add nsw i32 %0, -256
%7 = zext i32 %6 to i64
%8 = shl i64 %7, 2
%9 = call i8* @llvm.load.relative.i64(i8* bitcast ([19 x i32]* @reltable.print_token to i8*), i64 %8)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %5, %3
ret void
}