#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 */
scalar_t__ malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *attribute_to_str(int attr) {
  if (attr == 1)
    return "Unrecognized Symbol";
  else if (attr == 2)
    return "Extra Long ID";
  else if (attr == 3 || attr == 4)
    return "Extra Long Integer";
  else if (attr == 5)
    return "Extra Long Fractional Part";
  else if (attr == 6)
    return "Extra Long Exponent Part";
  else if (attr == 7)
    return "Integer Leading Zero";
  else if (attr == 990)
    return "MOD";
  else if (attr == 991)
    return "DIV";
  else if (attr == 992)
    return "OR";
  else if (attr == 993)
    return "AND";
  else if (attr == 994)
    return "<>";
  else if (attr == 995)
    return "<=";
  else if (attr == 996)
    return ">=";
  else if (attr == 997)
    return "LONGREAL";
  else if (attr == 998)
    return "REAL";
  else if (attr == 999)
    return "INT";
  else if (attr >= 2000) {
    char *str = (char *)malloc(20);
    snprintf(str, 20, "loc%d in SYMTABLE", attr - 2000);
    return str;
  }
  char *str = (char *)malloc(1);
  snprintf(str, 1, "%d", attr);
  return str;
}


x86 assembly (clang, -O0):
<attribute_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1145 <attribute_to_str+0x25>
lea    0xec4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b7 <attribute_to_str+0x297>
cmpl   $0x2,-0xc(%rbp)
jne    115f <attribute_to_str+0x3f>
lea    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b7 <attribute_to_str+0x297>
cmpl   $0x3,-0xc(%rbp)
je     1173 <attribute_to_str+0x53>
cmpl   $0x4,-0xc(%rbp)
jne    1183 <attribute_to_str+0x63>
lea    0xea8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b7 <attribute_to_str+0x297>
cmpl   $0x5,-0xc(%rbp)
jne    119d <attribute_to_str+0x7d>
lea    0xea1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b7 <attribute_to_str+0x297>
cmpl   $0x6,-0xc(%rbp)
jne    11b7 <attribute_to_str+0x97>
lea    0xea2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b7 <attribute_to_str+0x297>
cmpl   $0x7,-0xc(%rbp)
jne    11d1 <attribute_to_str+0xb1>
lea    0xea1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b7 <attribute_to_str+0x297>
cmpl   $0x3de,-0xc(%rbp)
jne    11ee <attribute_to_str+0xce>
lea    0xe99(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b7 <attribute_to_str+0x297>
cmpl   $0x3df,-0xc(%rbp)
jne    120b <attribute_to_str+0xeb>
lea    0xe80(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b7 <attribute_to_str+0x297>
cmpl   $0x3e0,-0xc(%rbp)
jne    1228 <attribute_to_str+0x108>
lea    0xe67(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b7 <attribute_to_str+0x297>
cmpl   $0x3e1,-0xc(%rbp)
jne    1245 <attribute_to_str+0x125>
lea    0xe4d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b7 <attribute_to_str+0x297>
cmpl   $0x3e2,-0xc(%rbp)
jne    1262 <attribute_to_str+0x142>
lea    0xe34(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b7 <attribute_to_str+0x297>
cmpl   $0x3e3,-0xc(%rbp)
jne    127f <attribute_to_str+0x15f>
lea    0xe1a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b7 <attribute_to_str+0x297>
cmpl   $0x3e4,-0xc(%rbp)
jne    129c <attribute_to_str+0x17c>
lea    0xe00(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b7 <attribute_to_str+0x297>
cmpl   $0x3e5,-0xc(%rbp)
jne    12b9 <attribute_to_str+0x199>
lea    0xde6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b7 <attribute_to_str+0x297>
cmpl   $0x3e6,-0xc(%rbp)
jne    12d6 <attribute_to_str+0x1b6>
lea    0xdcd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b7 <attribute_to_str+0x297>
cmpl   $0x3e7,-0xc(%rbp)
jne    12f3 <attribute_to_str+0x1d3>
lea    0xdb5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b7 <attribute_to_str+0x297>
cmpl   $0x7d0,-0xc(%rbp)
jl     1339 <attribute_to_str+0x219>
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%ecx
sub    $0x7d0,%ecx
mov    $0x14,%esi
lea    0xd7c(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    13b7 <attribute_to_str+0x297>
jmp    133e <attribute_to_str+0x21e>
jmp    1343 <attribute_to_str+0x223>
jmp    1348 <attribute_to_str+0x228>
jmp    134d <attribute_to_str+0x22d>
jmp    1352 <attribute_to_str+0x232>
jmp    1357 <attribute_to_str+0x237>
jmp    135c <attribute_to_str+0x23c>
jmp    1361 <attribute_to_str+0x241>
jmp    1366 <attribute_to_str+0x246>
jmp    136b <attribute_to_str+0x24b>
jmp    1370 <attribute_to_str+0x250>
jmp    1375 <attribute_to_str+0x255>
jmp    137a <attribute_to_str+0x25a>
jmp    137f <attribute_to_str+0x25f>
jmp    1384 <attribute_to_str+0x264>
jmp    1389 <attribute_to_str+0x269>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x1,%esi
lea    0xd0b(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<attribute_to_str>:
push   %r14
push   %rbx
push   %rax
cmp    $0x1,%edi
je     1139 <attribute_to_str+0x19>
mov    %edi,%ebx
cmp    $0x2,%edi
jne    1142 <attribute_to_str+0x22>
lea    0xf05(%rip),%r14
jmp    1151 <attribute_to_str+0x31>
lea    0xee8(%rip),%r14
jmp    1151 <attribute_to_str+0x31>
lea    -0x3(%rbx),%eax
cmp    $0x2,%eax
jae    115c <attribute_to_str+0x3c>
lea    0xef9(%rip),%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
cmp    $0x3dd,%ebx
jle    118c <attribute_to_str+0x6c>
lea    -0x3de(%rbx),%eax
cmp    $0x9,%eax
ja     1219 <attribute_to_str+0xf9>
lea    0xe86(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf1c(%rip),%r14
jmp    1151 <attribute_to_str+0x31>
cmp    $0x5,%ebx
je     1201 <attribute_to_str+0xe1>
cmp    $0x6,%ebx
je     120d <attribute_to_str+0xed>
cmp    $0x7,%ebx
jne    1219 <attribute_to_str+0xf9>
lea    0xeef(%rip),%r14
jmp    1151 <attribute_to_str+0x31>
lea    0xeff(%rip),%r14
jmp    1151 <attribute_to_str+0x31>
lea    0xefa(%rip),%r14
jmp    1151 <attribute_to_str+0x31>
lea    0xef4(%rip),%r14
jmp    1151 <attribute_to_str+0x31>
lea    0xeef(%rip),%r14
jmp    1151 <attribute_to_str+0x31>
lea    0xee9(%rip),%r14
jmp    1151 <attribute_to_str+0x31>
lea    0xee3(%rip),%r14
jmp    1151 <attribute_to_str+0x31>
lea    0xeda(%rip),%r14
jmp    1151 <attribute_to_str+0x31>
lea    0xed2(%rip),%r14
jmp    1151 <attribute_to_str+0x31>
lea    0xecb(%rip),%r14
jmp    1151 <attribute_to_str+0x31>
lea    0xe55(%rip),%r14
jmp    1151 <attribute_to_str+0x31>
lea    0xe64(%rip),%r14
jmp    1151 <attribute_to_str+0x31>
cmp    $0x7d0,%ebx
jl     1245 <attribute_to_str+0x125>
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
add    $0xfffff830,%ebx
lea    0xe90(%rip),%rdx
mov    %rax,%rdi
mov    $0x14,%esi
jmp    1261 <attribute_to_str+0x141>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
lea    0xe84(%rip),%rdx
mov    %rax,%rdi
mov    $0x1,%esi
mov    %ebx,%ecx
call   1030 <snprintf@plt>
jmp    1151 <attribute_to_str+0x31>

LLVM IR (-O0):
@.str = [20 x i8] c"Unrecognized Symbol\00"
@.str.1 = [14 x i8] c"Extra Long ID\00"
@.str.2 = [19 x i8] c"Extra Long Integer\00"
@.str.3 = [27 x i8] c"Extra Long Fractional Part\00"
@.str.4 = [25 x i8] c"Extra Long Exponent Part\00"
@.str.5 = [21 x i8] c"Integer Leading Zero\00"
@.str.6 = [4 x i8] c"MOD\00"
@.str.7 = [4 x i8] c"DIV\00"
@.str.8 = [3 x i8] c"OR\00"
@.str.9 = [4 x i8] c"AND\00"
@.str.10 = [3 x i8] c"<>\00"
@.str.11 = [3 x i8] c"<=\00"
@.str.12 = [3 x i8] c">=\00"
@.str.13 = [9 x i8] c"LONGREAL\00"
@.str.14 = [5 x i8] c"REAL\00"
@.str.15 = [4 x i8] c"INT\00"
@.str.16 = [18 x i8] c"loc%d in SYMTABLE\00"
@.str.17 = [3 x i8] c"%d\00"
define i8* @attribute_to_str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %2
br label %106
9: ; preds = %1
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %13
12: ; preds = %9
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %106
13: ; preds = %9
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 3
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 4
br i1 %18, label %19, label %20
19: ; preds = %16, %13
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %106
20: ; preds = %16
%21 = load i32, i32* %3
%22 = icmp eq i32 %21, 5
br i1 %22, label %23, label %24
23: ; preds = %20
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %106
24: ; preds = %20
%25 = load i32, i32* %3
%26 = icmp eq i32 %25, 6
br i1 %26, label %27, label %28
27: ; preds = %24
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %106
28: ; preds = %24
%29 = load i32, i32* %3
%30 = icmp eq i32 %29, 7
br i1 %30, label %31, label %32
31: ; preds = %28
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %106
32: ; preds = %28
%33 = load i32, i32* %3
%34 = icmp eq i32 %33, 990
br i1 %34, label %35, label %36
35: ; preds = %32
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %106
36: ; preds = %32
%37 = load i32, i32* %3
%38 = icmp eq i32 %37, 991
br i1 %38, label %39, label %40
39: ; preds = %36
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %106
40: ; preds = %36
%41 = load i32, i32* %3
%42 = icmp eq i32 %41, 992
br i1 %42, label %43, label %44
43: ; preds = %40
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %106
44: ; preds = %40
%45 = load i32, i32* %3
%46 = icmp eq i32 %45, 993
br i1 %46, label %47, label %48
47: ; preds = %44
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %106
48: ; preds = %44
%49 = load i32, i32* %3
%50 = icmp eq i32 %49, 994
br i1 %50, label %51, label %52
51: ; preds = %48
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %106
52: ; preds = %48
%53 = load i32, i32* %3
%54 = icmp eq i32 %53, 995
br i1 %54, label %55, label %56
55: ; preds = %52
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %106
56: ; preds = %52
%57 = load i32, i32* %3
%58 = icmp eq i32 %57, 996
br i1 %58, label %59, label %60
59: ; preds = %56
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %106
60: ; preds = %56
%61 = load i32, i32* %3
%62 = icmp eq i32 %61, 997
br i1 %62, label %63, label %64
63: ; preds = %60
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %106
64: ; preds = %60
%65 = load i32, i32* %3
%66 = icmp eq i32 %65, 998
br i1 %66, label %67, label %68
67: ; preds = %64
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %106
68: ; preds = %64
%69 = load i32, i32* %3
%70 = icmp eq i32 %69, 999
br i1 %70, label %71, label %72
71: ; preds = %68
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %106
72: ; preds = %68
%73 = load i32, i32* %3
%74 = icmp sge i32 %73, 2000
br i1 %74, label %75, label %83
75: ; preds = %72
%76 = call i64 @malloc(i32 20)
%77 = inttoptr i64 %76 to i8*
store i8* %77, i8** %4
%78 = load i8*, i8** %4
%79 = load i32, i32* %3
%80 = sub nsw i32 %79, 2000
%81 = call i32 @snprintf(i8* %78, i32 20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.16, i64 0, i64 0), i32 %80)
%82 = load i8*, i8** %4
store i8* %82, i8** %2
br label %106
83: ; preds = %72
br label %84
84: ; preds = %83
br label %85
85: ; preds = %84
br label %86
86: ; preds = %85
br label %87
87: ; preds = %86
br label %88
88: ; preds = %87
br label %89
89: ; preds = %88
br label %90
90: ; preds = %89
br label %91
91: ; preds = %90
br label %92
92: ; preds = %91
br label %93
93: ; preds = %92
br label %94
94: ; preds = %93
br label %95
95: ; preds = %94
br label %96
96: ; preds = %95
br label %97
97: ; preds = %96
br label %98
98: ; preds = %97
br label %99
99: ; preds = %98
%100 = call i64 @malloc(i32 1)
%101 = inttoptr i64 %100 to i8*
store i8* %101, i8** %5
%102 = load i8*, i8** %5
%103 = load i32, i32* %3
%104 = call i32 @snprintf(i8* %102, i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0), i32 %103)
%105 = load i8*, i8** %5
store i8* %105, i8** %2
br label %106
106: ; preds = %99, %75, %71, %67, %63, %59, %55, %51, %47, %43, %39, %35, %31, %27, %23, %19, %12, %8
%107 = load i8*, i8** %2
ret i8* %107
}

LLVM IR (-O2):
@.str = [20 x i8] c"Unrecognized Symbol\00"
@.str.1 = [14 x i8] c"Extra Long ID\00"
@.str.2 = [19 x i8] c"Extra Long Integer\00"
@.str.3 = [27 x i8] c"Extra Long Fractional Part\00"
@.str.4 = [25 x i8] c"Extra Long Exponent Part\00"
@.str.5 = [21 x i8] c"Integer Leading Zero\00"
@.str.6 = [4 x i8] c"MOD\00"
@.str.7 = [4 x i8] c"DIV\00"
@.str.8 = [3 x i8] c"OR\00"
@.str.9 = [4 x i8] c"AND\00"
@.str.10 = [3 x i8] c"<>\00"
@.str.11 = [3 x i8] c"<=\00"
@.str.12 = [3 x i8] c">=\00"
@.str.13 = [9 x i8] c"LONGREAL\00"
@.str.14 = [5 x i8] c"REAL\00"
@.str.15 = [4 x i8] c"INT\00"
@.str.16 = [18 x i8] c"loc%d in SYMTABLE\00"
@.str.17 = [3 x i8] c"%d\00"
define i8* @attribute_to_str(i32 %0) {
switch i32 %0, label %3 [
i32 1, label %30
i32 2, label %2
]
2: ; preds = %1
br label %30
3: ; preds = %1
%4 = add i32 %0, -3
%5 = icmp ult i32 %4, 2
br i1 %5, label %30, label %6
6: ; preds = %3
switch i32 %0, label %19 [
i32 5, label %30
i32 6, label %7
i32 7, label %8
i32 990, label %9
i32 991, label %10
i32 992, label %11
i32 993, label %12
i32 994, label %13
i32 995, label %14
i32 996, label %15
i32 997, label %16
i32 998, label %17
i32 999, label %18
]
7: ; preds = %6
br label %30
8: ; preds = %6
br label %30
9: ; preds = %6
br label %30
10: ; preds = %6
br label %30
11: ; preds = %6
br label %30
12: ; preds = %6
br label %30
13: ; preds = %6
br label %30
14: ; preds = %6
br label %30
15: ; preds = %6
br label %30
16: ; preds = %6
br label %30
17: ; preds = %6
br label %30
18: ; preds = %6
br label %30
19: ; preds = %6
%20 = icmp sgt i32 %0, 1999
br i1 %20, label %21, label %26
21: ; preds = %19
%22 = tail call i64 @malloc(i32 20)
%23 = inttoptr i64 %22 to i8*
%24 = add nsw i32 %0, -2000
%25 = tail call i32 @snprintf(i8* %23, i32 20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.16, i64 0, i64 0), i32 %24)
br label %30
26: ; preds = %19
%27 = tail call i64 @malloc(i32 1)
%28 = inttoptr i64 %27 to i8*
%29 = tail call i32 @snprintf(i8* %28, i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0), i32 %0)
br label %30
30: ; preds = %6, %3, %1, %26, %21, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %2
%31 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), %7 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), %8 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), %9 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), %10 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %11 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), %12 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), %13 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), %14 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), %15 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), %16 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), %17 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), %18 ], [ %23, %21 ], [ %28, %26 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), %6 ]
ret i8* %31
}