unsigned char GetRruleMonthNum(unsigned char a, unsigned char b) {
  switch (a) {
  case 0x00:
    switch (b) {
    case 0x00:
      return (1);
    case 0xA3:
      return (5);
    case 0xAE:
      return (11);
    }
    break;
  case 0x60:
    switch (b) {
    case 0xAE:
      return (2);
    case 0x51:
      return (6);
    }
    break;
  case 0xE0:
    switch (b) {
    case 0x4B:
      return (3);
    case 0x56:
      return (9);
    }
    break;
  case 0x40:
    switch (b) {
    case 0xFA:
      return (4);
    }
    break;
  case 0x20:
    if (b == 0xFA) {
      return (7);
    }
    break;
  case 0x80:
    if (b == 0xA8) {
      return (8);
    }
    break;
  case 0xA0:
    if (b == 0xFF) {
      return (10);
    }
    break;
  case 0xC0:
    if (b == 0x56) {
      return (12);
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<GetRruleMonthNum>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     11a3 <GetRruleMonthNum+0xa3>
jmp    1124 <GetRruleMonthNum+0x24>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
je     1297 <GetRruleMonthNum+0x197>
jmp    1135 <GetRruleMonthNum+0x35>
mov    -0x8(%rbp),%eax
sub    $0x40,%eax
je     1279 <GetRruleMonthNum+0x179>
jmp    1146 <GetRruleMonthNum+0x46>
mov    -0x8(%rbp),%eax
sub    $0x60,%eax
je     11fd <GetRruleMonthNum+0xfd>
jmp    1157 <GetRruleMonthNum+0x57>
mov    -0x8(%rbp),%eax
sub    $0x80,%eax
je     12b4 <GetRruleMonthNum+0x1b4>
jmp    116a <GetRruleMonthNum+0x6a>
mov    -0x8(%rbp),%eax
sub    $0xa0,%eax
je     12d1 <GetRruleMonthNum+0x1d1>
jmp    117d <GetRruleMonthNum+0x7d>
mov    -0x8(%rbp),%eax
sub    $0xc0,%eax
je     12ee <GetRruleMonthNum+0x1ee>
jmp    1190 <GetRruleMonthNum+0x90>
mov    -0x8(%rbp),%eax
sub    $0xe0,%eax
je     123c <GetRruleMonthNum+0x13c>
jmp    1309 <GetRruleMonthNum+0x209>
movzbl -0x3(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     11dd <GetRruleMonthNum+0xdd>
jmp    11b7 <GetRruleMonthNum+0xb7>
mov    -0xc(%rbp),%eax
sub    $0xa3,%eax
je     11e6 <GetRruleMonthNum+0xe6>
jmp    11ca <GetRruleMonthNum+0xca>
mov    -0xc(%rbp),%eax
sub    $0xae,%eax
je     11ef <GetRruleMonthNum+0xef>
jmp    11f8 <GetRruleMonthNum+0xf8>
movb   $0x1,-0x1(%rbp)
jmp    130d <GetRruleMonthNum+0x20d>
movb   $0x5,-0x1(%rbp)
jmp    130d <GetRruleMonthNum+0x20d>
movb   $0xb,-0x1(%rbp)
jmp    130d <GetRruleMonthNum+0x20d>
jmp    1309 <GetRruleMonthNum+0x209>
movzbl -0x3(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x51,%eax
je     122e <GetRruleMonthNum+0x12e>
jmp    1212 <GetRruleMonthNum+0x112>
mov    -0x10(%rbp),%eax
sub    $0xae,%eax
jne    1237 <GetRruleMonthNum+0x137>
jmp    1225 <GetRruleMonthNum+0x125>
movb   $0x2,-0x1(%rbp)
jmp    130d <GetRruleMonthNum+0x20d>
movb   $0x6,-0x1(%rbp)
jmp    130d <GetRruleMonthNum+0x20d>
jmp    1309 <GetRruleMonthNum+0x209>
movzbl -0x3(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x4b,%eax
je     1262 <GetRruleMonthNum+0x162>
jmp    1251 <GetRruleMonthNum+0x151>
mov    -0x14(%rbp),%eax
sub    $0x56,%eax
je     126b <GetRruleMonthNum+0x16b>
jmp    1274 <GetRruleMonthNum+0x174>
movb   $0x3,-0x1(%rbp)
jmp    130d <GetRruleMonthNum+0x20d>
movb   $0x9,-0x1(%rbp)
jmp    130d <GetRruleMonthNum+0x20d>
jmp    1309 <GetRruleMonthNum+0x209>
mov    -0x3(%rbp),%al
sub    $0xfa,%al
jne    1292 <GetRruleMonthNum+0x192>
jmp    1289 <GetRruleMonthNum+0x189>
movb   $0x4,-0x1(%rbp)
jmp    130d <GetRruleMonthNum+0x20d>
jmp    1309 <GetRruleMonthNum+0x209>
movzbl -0x3(%rbp),%eax
cmp    $0xfa,%eax
jne    12af <GetRruleMonthNum+0x1af>
movb   $0x7,-0x1(%rbp)
jmp    130d <GetRruleMonthNum+0x20d>
jmp    1309 <GetRruleMonthNum+0x209>
movzbl -0x3(%rbp),%eax
cmp    $0xa8,%eax
jne    12cc <GetRruleMonthNum+0x1cc>
movb   $0x8,-0x1(%rbp)
jmp    130d <GetRruleMonthNum+0x20d>
jmp    1309 <GetRruleMonthNum+0x209>
movzbl -0x3(%rbp),%eax
cmp    $0xff,%eax
jne    12e9 <GetRruleMonthNum+0x1e9>
movb   $0xa,-0x1(%rbp)
jmp    130d <GetRruleMonthNum+0x20d>
jmp    1309 <GetRruleMonthNum+0x209>
movzbl -0x3(%rbp),%eax
cmp    $0x56,%eax
jne    1304 <GetRruleMonthNum+0x204>
movb   $0xc,-0x1(%rbp)
jmp    130d <GetRruleMonthNum+0x20d>
jmp    1309 <GetRruleMonthNum+0x209>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetRruleMonthNum>:
rol    $0x1b,%edi
cmp    $0x7,%edi
ja     1194 <GetRruleMonthNum+0x94>
lea    0xeed(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
test   %sil,%sil
je     1197 <GetRruleMonthNum+0x97>
cmp    $0xae,%sil
je     119a <GetRruleMonthNum+0x9a>
cmp    $0xa3,%sil
jne    1194 <GetRruleMonthNum+0x94>
mov    $0x5,%al
ret
mov    $0x7,%al
cmp    $0xfa,%sil
jne    1194 <GetRruleMonthNum+0x94>
jmp    1193 <GetRruleMonthNum+0x93>
mov    $0x4,%al
cmp    $0xfa,%sil
jne    1194 <GetRruleMonthNum+0x94>
jmp    1193 <GetRruleMonthNum+0x93>
xor    %eax,%eax
cmp    $0x51,%sil
mov    $0x6,%ecx
cmovne %eax,%ecx
cmp    $0xae,%sil
mov    $0x2,%eax
cmovne %ecx,%eax
ret
mov    $0x8,%al
cmp    $0xa8,%sil
je     1193 <GetRruleMonthNum+0x93>
jmp    1194 <GetRruleMonthNum+0x94>
xor    %eax,%eax
cmp    $0x56,%sil
sete   %al
lea    (%rax,%rax,8),%ecx
cmp    $0x4b,%sil
mov    $0x3,%eax
cmovne %ecx,%eax
ret
cmp    $0xff,%sil
jne    1194 <GetRruleMonthNum+0x94>
mov    $0xa,%al
ret
mov    $0xc,%al
cmp    $0x56,%sil
jne    1194 <GetRruleMonthNum+0x94>
ret
xor    %eax,%eax
ret
mov    $0x1,%al
ret
mov    $0xb,%al
ret

LLVM IR (-O0):
define zeroext i8 @GetRruleMonthNum(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
switch i32 %7, label %56 [
i32 0, label %8
i32 96, label %15
i32 224, label %21
i32 64, label %27
i32 32, label %32
i32 128, label %38
i32 160, label %44
i32 192, label %50
]
8: ; preds = %2
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
switch i32 %10, label %14 [
i32 0, label %11
i32 163, label %12
i32 174, label %13
]
11: ; preds = %8
store i8 1, i8* %3
br label %57
12: ; preds = %8
store i8 5, i8* %3
br label %57
13: ; preds = %8
store i8 11, i8* %3
br label %57
14: ; preds = %8
br label %56
15: ; preds = %2
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
switch i32 %17, label %20 [
i32 174, label %18
i32 81, label %19
]
18: ; preds = %15
store i8 2, i8* %3
br label %57
19: ; preds = %15
store i8 6, i8* %3
br label %57
20: ; preds = %15
br label %56
21: ; preds = %2
%22 = load i8, i8* %5
%23 = zext i8 %22 to i32
switch i32 %23, label %26 [
i32 75, label %24
i32 86, label %25
]
24: ; preds = %21
store i8 3, i8* %3
br label %57
25: ; preds = %21
store i8 9, i8* %3
br label %57
26: ; preds = %21
br label %56
27: ; preds = %2
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
switch i32 %29, label %31 [
i32 250, label %30
]
30: ; preds = %27
store i8 4, i8* %3
br label %57
31: ; preds = %27
br label %56
32: ; preds = %2
%33 = load i8, i8* %5
%34 = zext i8 %33 to i32
%35 = icmp eq i32 %34, 250
br i1 %35, label %36, label %37
36: ; preds = %32
store i8 7, i8* %3
br label %57
37: ; preds = %32
br label %56
38: ; preds = %2
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = icmp eq i32 %40, 168
br i1 %41, label %42, label %43
42: ; preds = %38
store i8 8, i8* %3
br label %57
43: ; preds = %38
br label %56
44: ; preds = %2
%45 = load i8, i8* %5
%46 = zext i8 %45 to i32
%47 = icmp eq i32 %46, 255
br i1 %47, label %48, label %49
48: ; preds = %44
store i8 10, i8* %3
br label %57
49: ; preds = %44
br label %56
50: ; preds = %2
%51 = load i8, i8* %5
%52 = zext i8 %51 to i32
%53 = icmp eq i32 %52, 86
br i1 %53, label %54, label %55
54: ; preds = %50
store i8 12, i8* %3
br label %57
55: ; preds = %50
br label %56
56: ; preds = %55, %2, %49, %43, %37, %31, %26, %20, %14
store i8 0, i8* %3
br label %57
57: ; preds = %56, %54, %48, %42, %36, %30, %25, %24, %19, %18, %13, %12, %11
%58 = load i8, i8* %3
ret i8 %58
}

LLVM IR (-O2):
define zeroext i8 @GetRruleMonthNum(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = tail call i32 @llvm.fshl.i32(i32 %3, i32 %3, i32 27)
switch i32 %4, label %28 [
i32 0, label %5
i32 3, label %8
i32 7, label %13
i32 2, label %18
i32 1, label %20
i32 4, label %22
i32 5, label %24
i32 6, label %26
]
5: ; preds = %2
switch i8 %1, label %28 [
i8 0, label %29
i8 -93, label %6
i8 -82, label %7
]
6: ; preds = %5
br label %29
7: ; preds = %5
br label %29
8: ; preds = %2
%9 = icmp eq i8 %1, 81
%10 = select i1 %9, i8 6, i8 0
%11 = icmp eq i8 %1, -82
%12 = select i1 %11, i8 2, i8 %10
br label %29
13: ; preds = %2
%14 = icmp eq i8 %1, 86
%15 = select i1 %14, i8 9, i8 0
%16 = icmp eq i8 %1, 75
%17 = select i1 %16, i8 3, i8 %15
br label %29
18: ; preds = %2
%19 = icmp eq i8 %1, -6
br i1 %19, label %29, label %28
20: ; preds = %2
%21 = icmp eq i8 %1, -6
br i1 %21, label %29, label %28
22: ; preds = %2
%23 = icmp eq i8 %1, -88
br i1 %23, label %29, label %28
24: ; preds = %2
%25 = icmp eq i8 %1, -1
br i1 %25, label %29, label %28
26: ; preds = %2
%27 = icmp eq i8 %1, 86
br i1 %27, label %29, label %28
28: ; preds = %26, %24, %22, %20, %18, %5, %2
br label %29
29: ; preds = %26, %24, %22, %20, %18, %13, %8, %5, %28, %7, %6
%30 = phi i8 [ 0, %28 ], [ 11, %7 ], [ 5, %6 ], [ 1, %5 ], [ %12, %8 ], [ %17, %13 ], [ 4, %18 ], [ 7, %20 ], [ 8, %22 ], [ 10, %24 ], [ 12, %26 ]
ret i8 %30
}