char *yyprintname(n)
int n;
{
  if (n <= 50000)
    switch (n) {
    case 1:
      return "YYSTART";
      break;
    case 6:
      return "root";
      break;
    case 14:
      return "null";
      break;
    case 17:
      return "expression";
      break;
    case 21:
      return "term";
      break;
    case 37:
      return "factor";
      break;
    case 53:
      return "primary";
      break;
    }
  else
    switch (n - 50000) {
    case 256:
      return "NUMBER";
      break;
    }
  return "special_character";
}


x86 assembly (clang, -O0):
<yyprintname>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0xc350,-0xc(%rbp)
jg     11b2 <yyprintname+0xb2>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x34,%eax
ja     11ad <yyprintname+0xad>
mov    -0x18(%rbp),%rax
lea    0xecc(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf90(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e5 <yyprintname+0xe5>
lea    0xf88(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e5 <yyprintname+0xe5>
lea    0xf7d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e5 <yyprintname+0xe5>
lea    0xf72(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e5 <yyprintname+0xe5>
lea    0xf6d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e5 <yyprintname+0xe5>
lea    0xf62(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e5 <yyprintname+0xe5>
lea    0xf59(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e5 <yyprintname+0xe5>
jmp    11da <yyprintname+0xda>
mov    -0xc(%rbp),%eax
sub    $0xc450,%eax
jne    11d5 <yyprintname+0xd5>
jmp    11c5 <yyprintname+0xc5>
lea    0xf39(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e5 <yyprintname+0xe5>
jmp    11da <yyprintname+0xda>
lea    0xf2b(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyprintname>:
cmp    $0xc350,%edi
jg     112f <yyprintname+0x2f>
add    $0xffffffff,%edi
cmp    $0x34,%edi
ja     113f <yyprintname+0x3f>
lea    0xfbd(%rip),%rax
lea    0xee2(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
lea    0xfae(%rip),%rax
ret
cmp    $0xc450,%edi
jne    113f <yyprintname+0x3f>
lea    0xfc7(%rip),%rax
ret
lea    0xfc6(%rip),%rax
ret
lea    0xf93(%rip),%rax
ret
lea    0xf90(%rip),%rax
ret
lea    0xf98(%rip),%rax
ret
lea    0xf97(%rip),%rax
ret
lea    0xf83(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"YYSTART\00"
@.str.1 = [5 x i8] c"root\00"
@.str.2 = [5 x i8] c"null\00"
@.str.3 = [11 x i8] c"expression\00"
@.str.4 = [5 x i8] c"term\00"
@.str.5 = [7 x i8] c"factor\00"
@.str.6 = [8 x i8] c"primary\00"
@.str.7 = [7 x i8] c"NUMBER\00"
@.str.8 = [18 x i8] c"special_character\00"
define i8* @yyprintname(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 50000
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %3
switch i32 %7, label %15 [
i32 1, label %8
i32 6, label %9
i32 14, label %10
i32 17, label %11
i32 21, label %12
i32 37, label %13
i32 53, label %14
]
8: ; preds = %6
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
br label %22
9: ; preds = %6
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %22
10: ; preds = %6
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %22
11: ; preds = %6
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %22
12: ; preds = %6
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %22
13: ; preds = %6
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %22
14: ; preds = %6
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %22
15: ; preds = %6
br label %21
16: ; preds = %1
%17 = load i32, i32* %3
%18 = sub nsw i32 %17, 50000
switch i32 %18, label %20 [
i32 256, label %19
]
19: ; preds = %16
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %22
20: ; preds = %16
br label %21
21: ; preds = %20, %15
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %22
22: ; preds = %21, %19, %14, %13, %12, %11, %10, %9, %8
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
@.str = [8 x i8] c"YYSTART\00"
@.str.1 = [5 x i8] c"root\00"
@.str.2 = [5 x i8] c"null\00"
@.str.3 = [11 x i8] c"expression\00"
@.str.4 = [5 x i8] c"term\00"
@.str.5 = [7 x i8] c"factor\00"
@.str.6 = [8 x i8] c"primary\00"
@.str.7 = [7 x i8] c"NUMBER\00"
@.str.8 = [18 x i8] c"special_character\00"
define i8* @yyprintname(i32 %0) {
%2 = icmp slt i32 %0, 50001
br i1 %2, label %3, label %10
3: ; preds = %1
switch i32 %0, label %12 [
i32 1, label %13
i32 6, label %4
i32 14, label %5
i32 17, label %6
i32 21, label %7
i32 37, label %8
i32 53, label %9
]
4: ; preds = %3
br label %13
5: ; preds = %3
br label %13
6: ; preds = %3
br label %13
7: ; preds = %3
br label %13
8: ; preds = %3
br label %13
9: ; preds = %3
br label %13
10: ; preds = %1
%11 = icmp eq i32 %0, 50256
br i1 %11, label %13, label %12
12: ; preds = %10, %3
br label %13
13: ; preds = %10, %3, %12, %9, %8, %7, %6, %5, %4
%14 = phi i8* [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), %12 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), %9 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), %8 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), %7 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), %6 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %3 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), %10 ]
ret i8* %14
}