const char *IntWallType(const int i) {
  static const char *wallTypes[] = {"o",  "w",  "e",  "n",  "s",  "nw",
                                    "ne", "sw", "se", "wt", "et", "nt",
                                    "st", "v",  "h",  "x"};
  return wallTypes[i];
}


x86 assembly (clang, -O0):
<IntWallType>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
lea    0x2f1e(%rip),%rax
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntWallType>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@IntWallType.wallTypes = internal global [16 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i32 0, i32 0)]
@.str = [2 x i8] c"o\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [2 x i8] c"e\00"
@.str.3 = [2 x i8] c"n\00"
@.str.4 = [2 x i8] c"s\00"
@.str.5 = [3 x i8] c"nw\00"
@.str.6 = [3 x i8] c"ne\00"
@.str.7 = [3 x i8] c"sw\00"
@.str.8 = [3 x i8] c"se\00"
@.str.9 = [3 x i8] c"wt\00"
@.str.10 = [3 x i8] c"et\00"
@.str.11 = [3 x i8] c"nt\00"
@.str.12 = [3 x i8] c"st\00"
@.str.13 = [2 x i8] c"v\00"
@.str.14 = [2 x i8] c"h\00"
@.str.15 = [2 x i8] c"x\00"
define i8* @IntWallType(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [16 x i8*], [16 x i8*]* @IntWallType.wallTypes, i64 0, i64 %4
%6 = load i8*, i8** %5
ret i8* %6
}

LLVM IR (-O2):
@reltable.IntWallType = internal unnamed_addr constant [16 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str to i64), i64 ptrtoint ([16 x i32]* @reltable.IntWallType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.1 to i64), i64 ptrtoint ([16 x i32]* @reltable.IntWallType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.2 to i64), i64 ptrtoint ([16 x i32]* @reltable.IntWallType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.3 to i64), i64 ptrtoint ([16 x i32]* @reltable.IntWallType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.4 to i64), i64 ptrtoint ([16 x i32]* @reltable.IntWallType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.5 to i64), i64 ptrtoint ([16 x i32]* @reltable.IntWallType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.6 to i64), i64 ptrtoint ([16 x i32]* @reltable.IntWallType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.7 to i64), i64 ptrtoint ([16 x i32]* @reltable.IntWallType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.8 to i64), i64 ptrtoint ([16 x i32]* @reltable.IntWallType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.9 to i64), i64 ptrtoint ([16 x i32]* @reltable.IntWallType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.10 to i64), i64 ptrtoint ([16 x i32]* @reltable.IntWallType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.11 to i64), i64 ptrtoint ([16 x i32]* @reltable.IntWallType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.12 to i64), i64 ptrtoint ([16 x i32]* @reltable.IntWallType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.13 to i64), i64 ptrtoint ([16 x i32]* @reltable.IntWallType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.14 to i64), i64 ptrtoint ([16 x i32]* @reltable.IntWallType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.15 to i64), i64 ptrtoint ([16 x i32]* @reltable.IntWallType to i64)) to i32)]
@.str = [2 x i8] c"o\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [2 x i8] c"e\00"
@.str.3 = [2 x i8] c"n\00"
@.str.4 = [2 x i8] c"s\00"
@.str.5 = [3 x i8] c"nw\00"
@.str.6 = [3 x i8] c"ne\00"
@.str.7 = [3 x i8] c"sw\00"
@.str.8 = [3 x i8] c"se\00"
@.str.9 = [3 x i8] c"wt\00"
@.str.10 = [3 x i8] c"et\00"
@.str.11 = [3 x i8] c"nt\00"
@.str.12 = [3 x i8] c"st\00"
@.str.13 = [2 x i8] c"v\00"
@.str.14 = [2 x i8] c"h\00"
@.str.15 = [2 x i8] c"x\00"
define i8* @IntWallType(i32 %0) {
%2 = sext i32 %0 to i64
%3 = shl i64 %2, 2
%4 = call i8* @llvm.load.relative.i64(i8* bitcast ([16 x i32]* @reltable.IntWallType to i8*), i64 %3)
ret i8* %4
}