#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*/ bug(char *, int);
char *affect_loc_name(int location) {
  switch (location) {
  case 0:
    return "none";
  case 1:
    return "strength";
  case 2:
    return "dexterity";
  case 3:
    return "intelligence";
  case 4:
    return "wisdom";
  case 5:
    return "constitution";
  case 6:
    return "sex";
  case 7:
    return "class";
  case 8:
    return "level";
  case 9:
    return "age";
  case 12:
    return "mana";
  case 13:
    return "hp";
  case 14:
    return "moves";
  case 15:
    return "gold";
  case 16:
    return "experience";
  case 17:
    return "armor class";
  case 18:
    return "hit roll";
  case 19:
    return "damage roll";
  case 20:
    return "saves";
  case 21:
    return "save vs rod";
  case 22:
    return "save vs petrification";
  case 23:
    return "save vs breath";
  case 24:
    return "save vs spell";
  case 25:
    return "none";
  }
  bug("Affect_location_name: unknown location %d.", location);
  return "(unknown)";
}


x86 assembly (clang, -O0):
<affect_loc_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x19,%rax
ja     12c0 <affect_loc_name+0x1b0>
mov    -0x18(%rbp),%rax
lea    0xec9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf21(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xf16(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xf0f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xf09(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xf06(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xefd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xefa(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xf1c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xede(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xed4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xeb0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xea6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xe9b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xe96(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xe92(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xe8b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xe87(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xe7d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xe79(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xe7f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xe7e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
lea    0xdb1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12da <affect_loc_name+0x1ca>
mov    -0xc(%rbp),%esi
lea    0xe69(%rip),%rdi
call   1030 <bug@plt>
lea    0xe88(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<affect_loc_name>:
push   %rax
mov    %edi,%esi
cmp    $0x1a,%edi
jae    1122 <affect_loc_name+0x12>
mov    $0x3fff3ff,%eax
bt     %esi,%eax
jb     1137 <affect_loc_name+0x27>
lea    0xfa2(%rip),%rdi
call   1030 <bug@plt>
lea    0xfc1(%rip),%rax
pop    %rcx
ret
movslq %esi,%rax
lea    0xfbf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"none\00"
@.str.1 = [9 x i8] c"strength\00"
@.str.2 = [10 x i8] c"dexterity\00"
@.str.3 = [13 x i8] c"intelligence\00"
@.str.4 = [7 x i8] c"wisdom\00"
@.str.5 = [13 x i8] c"constitution\00"
@.str.6 = [4 x i8] c"sex\00"
@.str.7 = [6 x i8] c"class\00"
@.str.8 = [6 x i8] c"level\00"
@.str.9 = [4 x i8] c"age\00"
@.str.10 = [5 x i8] c"mana\00"
@.str.11 = [3 x i8] c"hp\00"
@.str.12 = [6 x i8] c"moves\00"
@.str.13 = [5 x i8] c"gold\00"
@.str.14 = [11 x i8] c"experience\00"
@.str.15 = [12 x i8] c"armor class\00"
@.str.16 = [9 x i8] c"hit roll\00"
@.str.17 = [12 x i8] c"damage roll\00"
@.str.18 = [6 x i8] c"saves\00"
@.str.19 = [12 x i8] c"save vs rod\00"
@.str.20 = [22 x i8] c"save vs petrification\00"
@.str.21 = [15 x i8] c"save vs breath\00"
@.str.22 = [14 x i8] c"save vs spell\00"
@.str.23 = [43 x i8] c"Affect_location_name: unknown location %d.\00"
@.str.24 = [10 x i8] c"(unknown)\00"
define i8* @affect_loc_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %29 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 6, label %11
i32 7, label %12
i32 8, label %13
i32 9, label %14
i32 12, label %15
i32 13, label %16
i32 14, label %17
i32 15, label %18
i32 16, label %19
i32 17, label %20
i32 18, label %21
i32 19, label %22
i32 20, label %23
i32 21, label %24
i32 22, label %25
i32 23, label %26
i32 24, label %27
i32 25, label %28
]
5: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %32
6: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %32
7: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %32
8: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %32
9: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %32
10: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %32
11: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %32
12: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %32
13: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %32
14: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %32
15: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %32
16: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %32
17: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %32
18: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %32
19: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %32
20: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %32
21: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i8** %2
br label %32
22: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0), i8** %2
br label %32
23: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0), i8** %2
br label %32
24: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.19, i64 0, i64 0), i8** %2
br label %32
25: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.20, i64 0, i64 0), i8** %2
br label %32
26: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.21, i64 0, i64 0), i8** %2
br label %32
27: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.22, i64 0, i64 0), i8** %2
br label %32
28: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %32
29: ; preds = %1
%30 = load i32, i32* %3
%31 = call i32 @bug(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.23, i64 0, i64 0), i32 %30)
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.24, i64 0, i64 0), i8** %2
br label %32
32: ; preds = %29, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%33 = load i8*, i8** %2
ret i8* %33
}

LLVM IR (-O2):
@.str = [5 x i8] c"none\00"
@.str.1 = [9 x i8] c"strength\00"
@.str.2 = [10 x i8] c"dexterity\00"
@.str.3 = [13 x i8] c"intelligence\00"
@.str.4 = [7 x i8] c"wisdom\00"
@.str.5 = [13 x i8] c"constitution\00"
@.str.6 = [4 x i8] c"sex\00"
@.str.7 = [6 x i8] c"class\00"
@.str.8 = [6 x i8] c"level\00"
@.str.9 = [4 x i8] c"age\00"
@.str.10 = [5 x i8] c"mana\00"
@.str.11 = [3 x i8] c"hp\00"
@.str.12 = [6 x i8] c"moves\00"
@.str.13 = [5 x i8] c"gold\00"
@.str.14 = [11 x i8] c"experience\00"
@.str.15 = [12 x i8] c"armor class\00"
@.str.16 = [9 x i8] c"hit roll\00"
@.str.17 = [12 x i8] c"damage roll\00"
@.str.18 = [6 x i8] c"saves\00"
@.str.19 = [12 x i8] c"save vs rod\00"
@.str.20 = [22 x i8] c"save vs petrification\00"
@.str.21 = [15 x i8] c"save vs breath\00"
@.str.22 = [14 x i8] c"save vs spell\00"
@.str.23 = [43 x i8] c"Affect_location_name: unknown location %d.\00"
@.str.24 = [10 x i8] c"(unknown)\00"
@reltable.affect_loc_name = [26 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.1 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.2 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.3 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.4 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.5 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.6 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.7 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.8 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.9 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.10 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.11 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.12 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.13 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.14 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.15 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.16 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.17 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.18 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.19 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.20 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.21 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str to i64), i64 ptrtoint ([26 x i32]* @reltable.affect_loc_name to i64)) to i32)]
define i8* @affect_loc_name(i32 %0) {
%2 = icmp ult i32 %0, 26
br i1 %2, label %5, label %3
3: ; preds = %5, %1
%4 = tail call i32 @bug(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.23, i64 0, i64 0), i32 %0)
br label %13
5: ; preds = %1
%6 = lshr i32 67105791, %0
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %3, label %9
9: ; preds = %5
%10 = sext i32 %0 to i64
%11 = shl i64 %10, 2
%12 = call i8* @llvm.load.relative.i64(i8* bitcast ([26 x i32]* @reltable.affect_loc_name to i8*), i64 %11)
br label %13
13: ; preds = %9, %3
%14 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.24, i64 0, i64 0), %3 ], [ %12, %9 ]
ret i8* %14
}