#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 abs(int const);
const char *IntRoomStyle(const int i) {
  static const char *roomStyles[] = {
      "recessed", "tile", "dirt", "flat",    "striped", "smallsquare",
      "stone",    "wood", "grid", "biggrid", "checker"};
  return roomStyles[abs(i) % 11];
}


x86 assembly (clang, -O0):
<IntRoomStyle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    $0xb,%ecx
cltd
idiv   %ecx
movslq %edx,%rcx
lea    0x2efb(%rip),%rax
mov    (%rax,%rcx,8),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntRoomStyle>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
mov    $0xba2e8ba3,%ecx
imul   %rax,%rcx
shr    $0x23,%rcx
lea    (%rcx,%rcx,4),%edx
lea    (%rcx,%rdx,2),%ecx
sub    %ecx,%eax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@IntRoomStyle.roomStyles = internal global [11 x i8*] [i8* getelementptr inbounds ([9 x i8], [9 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 ([8 x i8], [8 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i32 0, i32 0)]
@.str = [9 x i8] c"recessed\00"
@.str.1 = [5 x i8] c"tile\00"
@.str.2 = [5 x i8] c"dirt\00"
@.str.3 = [5 x i8] c"flat\00"
@.str.4 = [8 x i8] c"striped\00"
@.str.5 = [12 x i8] c"smallsquare\00"
@.str.6 = [6 x i8] c"stone\00"
@.str.7 = [5 x i8] c"wood\00"
@.str.8 = [5 x i8] c"grid\00"
@.str.9 = [8 x i8] c"biggrid\00"
@.str.10 = [8 x i8] c"checker\00"
define i8* @IntRoomStyle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @abs(i32 %3)
%5 = srem i32 %4, 11
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [11 x i8*], [11 x i8*]* @IntRoomStyle.roomStyles, i64 0, i64 %6
%8 = load i8*, i8** %7
ret i8* %8
}

LLVM IR (-O2):
@reltable.IntRoomStyle = internal unnamed_addr constant [11 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str to i64), i64 ptrtoint ([11 x i32]* @reltable.IntRoomStyle to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([11 x i32]* @reltable.IntRoomStyle to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.2 to i64), i64 ptrtoint ([11 x i32]* @reltable.IntRoomStyle to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.3 to i64), i64 ptrtoint ([11 x i32]* @reltable.IntRoomStyle to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.4 to i64), i64 ptrtoint ([11 x i32]* @reltable.IntRoomStyle to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.5 to i64), i64 ptrtoint ([11 x i32]* @reltable.IntRoomStyle to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.6 to i64), i64 ptrtoint ([11 x i32]* @reltable.IntRoomStyle to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.7 to i64), i64 ptrtoint ([11 x i32]* @reltable.IntRoomStyle to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.8 to i64), i64 ptrtoint ([11 x i32]* @reltable.IntRoomStyle to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.9 to i64), i64 ptrtoint ([11 x i32]* @reltable.IntRoomStyle to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.10 to i64), i64 ptrtoint ([11 x i32]* @reltable.IntRoomStyle to i64)) to i32)]
@.str = [9 x i8] c"recessed\00"
@.str.1 = [5 x i8] c"tile\00"
@.str.2 = [5 x i8] c"dirt\00"
@.str.3 = [5 x i8] c"flat\00"
@.str.4 = [8 x i8] c"striped\00"
@.str.5 = [12 x i8] c"smallsquare\00"
@.str.6 = [6 x i8] c"stone\00"
@.str.7 = [5 x i8] c"wood\00"
@.str.8 = [5 x i8] c"grid\00"
@.str.9 = [8 x i8] c"biggrid\00"
@.str.10 = [8 x i8] c"checker\00"
define i8* @IntRoomStyle(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = urem i32 %2, 11
%4 = zext i32 %3 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([11 x i32]* @reltable.IntRoomStyle to i8*), i64 %5)
ret i8* %6
}