unsigned char max_tns_sfb(const unsigned char sr_index,
                          const unsigned char object_type,
                          const unsigned char is_short) {
  static const unsigned char tns_sbf_max[][4] = {
      {31, 9, 28, 7},  {31, 9, 28, 7},  {34, 10, 27, 7}, {40, 14, 26, 6},
      {42, 14, 26, 6}, {51, 14, 26, 6}, {46, 14, 29, 7}, {46, 14, 29, 7},
      {42, 14, 23, 8}, {42, 14, 23, 8}, {42, 14, 23, 8}, {39, 14, 19, 7},
      {39, 14, 19, 7}, {0, 0, 0, 0},    {0, 0, 0, 0},    {0, 0, 0, 0}};
  unsigned char i = 0;
  if (is_short)
    i++;
  if (object_type == 3)
    i += 2;
  return tns_sbf_max[sr_index][i];
}


x86 assembly (clang, -O0):
<max_tns_sfb>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movb   $0x0,-0x4(%rbp)
cmpb   $0x0,-0x3(%rbp)
je     112b <max_tns_sfb+0x2b>
mov    -0x4(%rbp),%al
add    $0x1,%al
mov    %al,-0x4(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x3,%eax
jne    1142 <max_tns_sfb+0x42>
movzbl -0x4(%rbp),%eax
add    $0x2,%eax
mov    %al,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,%ecx
lea    0xeb1(%rip),%rax
shl    $0x2,%rcx
add    %rcx,%rax
movzbl -0x4(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_tns_sfb>:
xor    %eax,%eax
test   %edx,%edx
setne  %al
lea    0x2(%rax),%ecx
cmp    $0x3,%sil
movzbl %cl,%ecx
cmovne %eax,%ecx
mov    %edi,%eax
movzbl %cl,%ecx
lea    0xee0(%rip),%rdx
lea    (%rdx,%rax,4),%rax
mov    (%rcx,%rax,1),%al
ret

LLVM IR (-O0):
@max_tns_sfb.tns_sbf_max = internal constant [16 x [4 x i8]] [[4 x i8] c"\1F\09\1C\07", [4 x i8] c"\1F\09\1C\07", [4 x i8] c"\22\0A\1B\07", [4 x i8] c"(\0E\1A\06", [4 x i8] c"*\0E\1A\06", [4 x i8] c"3\0E\1A\06", [4 x i8] c".\0E\1D\07", [4 x i8] c".\0E\1D\07", [4 x i8] c"*\0E\17\08", [4 x i8] c"*\0E\17\08", [4 x i8] c"*\0E\17\08", [4 x i8] c"'\0E\13\07", [4 x i8] c"'\0E\13\07", [4 x i8] zeroinitializer, [4 x i8] zeroinitializer, [4 x i8] zeroinitializer]
define zeroext i8 @max_tns_sfb(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
store i8 0, i8* %7
%8 = load i8, i8* %6
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i8, i8* %7
%12 = add i8 %11, 1
store i8 %12, i8* %7
br label %13
13: ; preds = %10, %3
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = icmp eq i32 %15, 3
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load i8, i8* %7
%19 = zext i8 %18 to i32
%20 = add nsw i32 %19, 2
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
br label %22
22: ; preds = %17, %13
%23 = load i8, i8* %4
%24 = zext i8 %23 to i64
%25 = getelementptr inbounds [16 x [4 x i8]], [16 x [4 x i8]]* @max_tns_sfb.tns_sbf_max, i64 0, i64 %24
%26 = load i8, i8* %7
%27 = zext i8 %26 to i64
%28 = getelementptr inbounds [4 x i8], [4 x i8]* %25, i64 0, i64 %27
%29 = load i8, i8* %28
ret i8 %29
}

LLVM IR (-O2):
@max_tns_sfb.tns_sbf_max = internal unnamed_addr constant [16 x [4 x i8]] [[4 x i8] c"\1F\09\1C\07", [4 x i8] c"\1F\09\1C\07", [4 x i8] c"\22\0A\1B\07", [4 x i8] c"(\0E\1A\06", [4 x i8] c"*\0E\1A\06", [4 x i8] c"3\0E\1A\06", [4 x i8] c".\0E\1D\07", [4 x i8] c".\0E\1D\07", [4 x i8] c"*\0E\17\08", [4 x i8] c"*\0E\17\08", [4 x i8] c"*\0E\17\08", [4 x i8] c"'\0E\13\07", [4 x i8] c"'\0E\13\07", [4 x i8] zeroinitializer, [4 x i8] zeroinitializer, [4 x i8] zeroinitializer]
define zeroext i8 @max_tns_sfb(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = icmp ne i8 %2, 0
%5 = zext i1 %4 to i8
%6 = icmp eq i8 %1, 3
%7 = or i8 %5, 2
%8 = select i1 %6, i8 %7, i8 %5
%9 = zext i8 %0 to i64
%10 = zext i8 %8 to i64
%11 = getelementptr inbounds [16 x [4 x i8]], [16 x [4 x i8]]* @max_tns_sfb.tns_sbf_max, i64 0, i64 %9, i64 %10
%12 = load i8, i8* %11
ret i8 %12
}