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


x86 assembly (clang, -O0):
<IntFloorStyle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    $0xa,%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):
<IntFloorStyle>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
mov    $0xcccccccd,%ecx
imul   %rax,%rcx
shr    $0x23,%rcx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
lea    0xede(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@IntFloorStyle.floorStyles = internal global [10 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 ([8 x i8], [8 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, 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 = [8 x i8] c"biggrid\00"
@.str.9 = [5 x i8] c"grid\00"
define i8* @IntFloorStyle(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, 10
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [10 x i8*], [10 x i8*]* @IntFloorStyle.floorStyles, i64 0, i64 %6
%8 = load i8*, i8** %7
ret i8* %8
}

LLVM IR (-O2):
@reltable.IntFloorStyle = internal unnamed_addr constant [10 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str to i64), i64 ptrtoint ([10 x i32]* @reltable.IntFloorStyle to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([10 x i32]* @reltable.IntFloorStyle to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.2 to i64), i64 ptrtoint ([10 x i32]* @reltable.IntFloorStyle to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.3 to i64), i64 ptrtoint ([10 x i32]* @reltable.IntFloorStyle to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.4 to i64), i64 ptrtoint ([10 x i32]* @reltable.IntFloorStyle to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.5 to i64), i64 ptrtoint ([10 x i32]* @reltable.IntFloorStyle to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.6 to i64), i64 ptrtoint ([10 x i32]* @reltable.IntFloorStyle to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.7 to i64), i64 ptrtoint ([10 x i32]* @reltable.IntFloorStyle to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.8 to i64), i64 ptrtoint ([10 x i32]* @reltable.IntFloorStyle to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.9 to i64), i64 ptrtoint ([10 x i32]* @reltable.IntFloorStyle 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 = [8 x i8] c"biggrid\00"
@.str.9 = [5 x i8] c"grid\00"
define i8* @IntFloorStyle(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = urem i32 %2, 10
%4 = zext i32 %3 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([10 x i32]* @reltable.IntFloorStyle to i8*), i64 %5)
ret i8* %6
}