char s_get_nrc_block_index(char i) {
  char blocks[4][9] = {{10, 11, 12, 19, 20, 21, 28, 29, 30},
                       {14, 15, 16, 23, 24, 25, 32, 33, 34},
                       {46, 47, 48, 55, 56, 57, 64, 65, 66},
                       {50, 51, 52, 59, 60, 61, 68, 69, 70}};
  for (char j = 0; j < 4; j++) {
    for (char k = 0; k < 9; k++) {
      if (i == blocks[j][k]) {
        return j;
      }
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<s_get_nrc_block_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xed7(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
movb   $0x0,-0x31(%rbp)
movsbl -0x31(%rbp),%eax
cmp    $0x4,%eax
jge    11a9 <s_get_nrc_block_index+0x99>
movb   $0x0,-0x32(%rbp)
movsbl -0x32(%rbp),%eax
cmp    $0x9,%eax
jge    1197 <s_get_nrc_block_index+0x87>
movsbl -0x2(%rbp),%eax
movsbq -0x31(%rbp),%rdx
lea    -0x30(%rbp),%rcx
imul   $0x9,%rdx,%rdx
add    %rdx,%rcx
movsbq -0x32(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1185 <s_get_nrc_block_index+0x75>
mov    -0x31(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    11ad <s_get_nrc_block_index+0x9d>
jmp    118a <s_get_nrc_block_index+0x7a>
mov    -0x32(%rbp),%al
add    $0x1,%al
mov    %al,-0x32(%rbp)
jmp    1148 <s_get_nrc_block_index+0x38>
jmp    119c <s_get_nrc_block_index+0x8c>
mov    -0x31(%rbp),%al
add    $0x1,%al
mov    %al,-0x31(%rbp)
jmp    1137 <s_get_nrc_block_index+0x27>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_get_nrc_block_index>:
add    $0xf6,%dil
mov    $0xff,%al
cmp    $0x3c,%dil
ja     112e <s_get_nrc_block_index+0x2e>
movzbl %dil,%ecx
movabs $0x1dcee77001dcee77,%rdx
e7 ce 1d
bt     %rcx,%rdx
jae    112e <s_get_nrc_block_index+0x2e>
movsbq %dil,%rax
lea    0xed5(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@__const.s_get_nrc_block_index.blocks = [4 x [9 x i8]] [[9 x i8] c"\0A\0B\0C\13\14\15\1C\1D\1E", [9 x i8] c"\0E\0F\10\17\18\19 !\22", [9 x i8] c"./0789@AB", [9 x i8] c"234;<=DEF"]
define signext i8 @s_get_nrc_block_index(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca [4 x [9 x i8]]
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %3
%7 = bitcast [4 x [9 x i8]]* %4 to i8*
store i8 0, i8* %5
br label %8
8: ; preds = %36, %1
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = icmp slt i32 %10, 4
br i1 %11, label %12, label %39
12: ; preds = %8
store i8 0, i8* %6
br label %13
13: ; preds = %32, %12
%14 = load i8, i8* %6
%15 = sext i8 %14 to i32
%16 = icmp slt i32 %15, 9
br i1 %16, label %17, label %35
17: ; preds = %13
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = load i8, i8* %5
%21 = sext i8 %20 to i64
%22 = getelementptr inbounds [4 x [9 x i8]], [4 x [9 x i8]]* %4, i64 0, i64 %21
%23 = load i8, i8* %6
%24 = sext i8 %23 to i64
%25 = getelementptr inbounds [9 x i8], [9 x i8]* %22, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %19, %27
br i1 %28, label %29, label %31
29: ; preds = %17
%30 = load i8, i8* %5
store i8 %30, i8* %2
br label %40
31: ; preds = %17
br label %32
32: ; preds = %31
%33 = load i8, i8* %6
%34 = add i8 %33, 1
store i8 %34, i8* %6
br label %13
35: ; preds = %13
br label %36
36: ; preds = %35
%37 = load i8, i8* %5
%38 = add i8 %37, 1
store i8 %38, i8* %5
br label %8
39: ; preds = %8
store i8 -1, i8* %2
br label %40
40: ; preds = %39, %29
%41 = load i8, i8* %2
ret i8 %41
}

LLVM IR (-O2):
@switch.table.s_get_nrc_block_index = [61 x i8] c"\00\00\00\00\01\01\01\00\00\00\00\00\00\01\01\01\00\00\00\00\00\00\01\01\01\00\00\00\00\00\00\00\00\00\00\00\02\02\02\00\03\03\03\00\00\02\02\02\00\03\03\03\00\00\02\02\02\00\03\03\03"
define signext i8 @s_get_nrc_block_index(i8 signext %0) {
%2 = add i8 %0, -10
%3 = icmp ult i8 %2, 61
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = zext i8 %2 to i64
%6 = lshr i64 2147908540555914871, %5
%7 = and i64 %6, 1
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = sext i8 %2 to i64
%11 = getelementptr inbounds [61 x i8], [61 x i8]* @switch.table.s_get_nrc_block_index, i64 0, i64 %10
%12 = load i8, i8* %11
br label %13
13: ; preds = %4, %1, %9
%14 = phi i8 [ %12, %9 ], [ -1, %1 ], [ -1, %4 ]
ret i8 %14
}