int ready_for_check(int facet_from, int facet_to) {
  switch (facet_from) {
  case 0:
    return 0;
  case 1:
    if (facet_to == 0)
      return 1;
    else
      return 0;
  case 2:
    return 1;
  case 3:
    switch (facet_to) {
    case 6:
    case 10:
    case 9:
    case 12:
    case 2:
      return 0;
    default:
      return 1;
    }
  case 4:
    switch (facet_to) {
    case 0:
    case 1:
    case 13:
      return 1;
    default:
      return 0;
    }
  case 5:
    switch (facet_to) {
    case 3:
    case 6:
    case 10:
    case 9:
    case 12:
    case 2:
      return 0;
    default:
      return 1;
    }
  case 6:
    switch (facet_to) {
    case 10:
    case 9:
    case 12:
    case 2:
      return 0;
    default:
      return 1;
    }
  case 7:
    switch (facet_to) {
    case 0:
    case 1:
    case 13:
    case 4:
    case 8:
      return 1;
    default:
      return 0;
    }
  case 8:
    switch (facet_to) {
    case 0:
    case 1:
    case 13:
    case 4:
      return 1;
    default:
      return 0;
    }
  case 9:
    switch (facet_to) {
    case 12:
    case 2:
      return 0;
    default:
      return 1;
    }
  case 10:
    switch (facet_to) {
    case 9:
    case 12:
    case 2:
      return 0;
    default:
      return 1;
    }
  case 11:
    switch (facet_to) {
    case 0:
    case 1:
    case 13:
    case 4:
    case 8:
    case 7:
      return 1;
    default:
      return 0;
    }
  case 12:
    if (facet_to == 2)
      return 0;
    else
      return 1;
  case 13:
    if (facet_to < 2)
      return 1;
    else
      return 0;
  }
}


x86 assembly (clang, -O0):
<ready_for_check>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0xd,%rax
ja     1497 <ready_for_check+0x397>
mov    -0x18(%rbp),%rax
lea    0xeda(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
cmpl   $0x0,-0xc(%rbp)
jne    1151 <ready_for_check+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
movl   $0x0,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
movl   $0x1,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x2,%eax
je     11b3 <ready_for_check+0xb3>
jmp    117d <ready_for_check+0x7d>
mov    -0x1c(%rbp),%eax
sub    $0x6,%eax
je     11b3 <ready_for_check+0xb3>
jmp    118e <ready_for_check+0x8e>
mov    -0x1c(%rbp),%eax
add    $0xfffffff7,%eax
sub    $0x2,%eax
jb     11b3 <ready_for_check+0xb3>
jmp    11a2 <ready_for_check+0xa2>
mov    -0x1c(%rbp),%eax
sub    $0xc,%eax
jne    11bf <ready_for_check+0xbf>
jmp    11b3 <ready_for_check+0xb3>
movl   $0x0,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
movl   $0x1,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
sub    $0x2,%eax
jb     11f0 <ready_for_check+0xf0>
jmp    11df <ready_for_check+0xdf>
mov    -0x20(%rbp),%eax
sub    $0xd,%eax
jne    11fc <ready_for_check+0xfc>
jmp    11f0 <ready_for_check+0xf0>
movl   $0x1,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
movl   $0x0,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
add    $0xfffffffe,%eax
sub    $0x2,%eax
jb     1255 <ready_for_check+0x155>
jmp    121f <ready_for_check+0x11f>
mov    -0x24(%rbp),%eax
sub    $0x6,%eax
je     1255 <ready_for_check+0x155>
jmp    1230 <ready_for_check+0x130>
mov    -0x24(%rbp),%eax
add    $0xfffffff7,%eax
sub    $0x2,%eax
jb     1255 <ready_for_check+0x155>
jmp    1244 <ready_for_check+0x144>
mov    -0x24(%rbp),%eax
sub    $0xc,%eax
jne    1261 <ready_for_check+0x161>
jmp    1255 <ready_for_check+0x155>
movl   $0x0,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
movl   $0x1,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
mov    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
sub    $0x2,%eax
je     12a6 <ready_for_check+0x1a6>
jmp    1281 <ready_for_check+0x181>
mov    -0x28(%rbp),%eax
add    $0xfffffff7,%eax
sub    $0x2,%eax
jb     12a6 <ready_for_check+0x1a6>
jmp    1295 <ready_for_check+0x195>
mov    -0x28(%rbp),%eax
sub    $0xc,%eax
jne    12b2 <ready_for_check+0x1b2>
jmp    12a6 <ready_for_check+0x1a6>
movl   $0x0,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
movl   $0x1,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x2,%eax
jb     1305 <ready_for_check+0x205>
jmp    12d2 <ready_for_check+0x1d2>
mov    -0x2c(%rbp),%eax
sub    $0x4,%eax
je     1305 <ready_for_check+0x205>
jmp    12e3 <ready_for_check+0x1e3>
mov    -0x2c(%rbp),%eax
sub    $0x8,%eax
je     1305 <ready_for_check+0x205>
jmp    12f4 <ready_for_check+0x1f4>
mov    -0x2c(%rbp),%eax
sub    $0xd,%eax
jne    1311 <ready_for_check+0x211>
jmp    1305 <ready_for_check+0x205>
movl   $0x1,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
movl   $0x0,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
mov    -0xc(%rbp),%eax
mov    %eax,-0x30(%rbp)
sub    $0x2,%eax
jb     1353 <ready_for_check+0x253>
jmp    1331 <ready_for_check+0x231>
mov    -0x30(%rbp),%eax
sub    $0x4,%eax
je     1353 <ready_for_check+0x253>
jmp    1342 <ready_for_check+0x242>
mov    -0x30(%rbp),%eax
sub    $0xd,%eax
jne    135f <ready_for_check+0x25f>
jmp    1353 <ready_for_check+0x253>
movl   $0x1,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
movl   $0x0,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
mov    -0xc(%rbp),%eax
mov    %eax,-0x34(%rbp)
sub    $0x2,%eax
je     1390 <ready_for_check+0x290>
jmp    137f <ready_for_check+0x27f>
mov    -0x34(%rbp),%eax
sub    $0xc,%eax
jne    139c <ready_for_check+0x29c>
jmp    1390 <ready_for_check+0x290>
movl   $0x0,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
movl   $0x1,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
mov    -0xc(%rbp),%eax
mov    %eax,-0x38(%rbp)
sub    $0x2,%eax
je     13de <ready_for_check+0x2de>
jmp    13bc <ready_for_check+0x2bc>
mov    -0x38(%rbp),%eax
sub    $0x9,%eax
je     13de <ready_for_check+0x2de>
jmp    13cd <ready_for_check+0x2cd>
mov    -0x38(%rbp),%eax
sub    $0xc,%eax
jne    13ea <ready_for_check+0x2ea>
jmp    13de <ready_for_check+0x2de>
movl   $0x0,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
movl   $0x1,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
mov    -0xc(%rbp),%eax
mov    %eax,-0x3c(%rbp)
sub    $0x2,%eax
jb     1440 <ready_for_check+0x340>
jmp    140a <ready_for_check+0x30a>
mov    -0x3c(%rbp),%eax
sub    $0x4,%eax
je     1440 <ready_for_check+0x340>
jmp    141b <ready_for_check+0x31b>
mov    -0x3c(%rbp),%eax
add    $0xfffffff9,%eax
sub    $0x2,%eax
jb     1440 <ready_for_check+0x340>
jmp    142f <ready_for_check+0x32f>
mov    -0x3c(%rbp),%eax
sub    $0xd,%eax
jne    144c <ready_for_check+0x34c>
jmp    1440 <ready_for_check+0x340>
movl   $0x1,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
movl   $0x0,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
cmpl   $0x2,-0xc(%rbp)
jne    146e <ready_for_check+0x36e>
movl   $0x0,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
movl   $0x1,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
cmpl   $0x2,-0xc(%rbp)
jge    1490 <ready_for_check+0x390>
movl   $0x1,-0x4(%rbp)
jmp    1497 <ready_for_check+0x397>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ready_for_check>:
add    $0xffffffff,%edi
cmp    $0xc,%edi
ja     11a7 <ready_for_check+0xa7>
lea    0xeed(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
test   %esi,%esi
sete   %al
movzbl %al,%eax
ret
mov    $0x1,%al
movzbl %al,%eax
ret
add    $0xfffffffe,%esi
mov    $0x1,%al
cmp    $0xb,%esi
jae    11a3 <ready_for_check+0xa3>
mov    $0x26e,%eax
jmp    119d <ready_for_check+0x9d>
cmp    $0xe,%esi
jae    11a7 <ready_for_check+0xa7>
mov    $0x2003,%eax
jmp    119d <ready_for_check+0x9d>
add    $0xfffffffe,%esi
mov    $0x1,%al
cmp    $0xb,%esi
jae    11a3 <ready_for_check+0xa3>
mov    $0x26c,%eax
jmp    119d <ready_for_check+0x9d>
add    $0xfffffffe,%esi
mov    $0x1,%al
cmp    $0xb,%esi
jae    11a3 <ready_for_check+0xa3>
mov    $0x27e,%eax
jmp    119d <ready_for_check+0x9d>
cmp    $0xe,%esi
jae    11a7 <ready_for_check+0xa7>
mov    $0x2113,%eax
jmp    119d <ready_for_check+0x9d>
cmp    $0xe,%esi
jae    11a7 <ready_for_check+0xa7>
mov    $0x2013,%eax
jmp    119d <ready_for_check+0x9d>
add    $0xfffffffe,%esi
mov    $0x1,%al
cmp    $0xb,%esi
jae    11a3 <ready_for_check+0xa3>
mov    $0x37e,%eax
jmp    119d <ready_for_check+0x9d>
cmp    $0xe,%esi
jae    11a7 <ready_for_check+0xa7>
mov    $0x2193,%eax
bt     %esi,%eax
setb   %al
movzbl %al,%eax
ret
xor    %eax,%eax
movzbl %al,%eax
ret
cmp    $0x2,%esi
setne  %al
movzbl %al,%eax
ret
cmp    $0x2,%esi
setl   %al
movzbl %al,%eax
ret
cmp    $0xc,%esi
setne  %cl
cmp    $0x2,%esi
setne  %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @ready_for_check(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
switch i32 %6, label %60 [
i32 0, label %7
i32 1, label %8
i32 2, label %13
i32 3, label %14
i32 4, label %18
i32 5, label %22
i32 6, label %26
i32 7, label %30
i32 8, label %34
i32 9, label %38
i32 10, label %42
i32 11, label %46
i32 12, label %50
i32 13, label %55
]
7: ; preds = %2
store i32 0, i32* %3
br label %60
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 1, i32* %3
br label %60
12: ; preds = %8
store i32 0, i32* %3
br label %60
13: ; preds = %2
store i32 1, i32* %3
br label %60
14: ; preds = %2
%15 = load i32, i32* %5
switch i32 %15, label %17 [
i32 6, label %16
i32 10, label %16
i32 9, label %16
i32 12, label %16
i32 2, label %16
]
16: ; preds = %14, %14, %14, %14, %14
store i32 0, i32* %3
br label %60
17: ; preds = %14
store i32 1, i32* %3
br label %60
18: ; preds = %2
%19 = load i32, i32* %5
switch i32 %19, label %21 [
i32 0, label %20
i32 1, label %20
i32 13, label %20
]
20: ; preds = %18, %18, %18
store i32 1, i32* %3
br label %60
21: ; preds = %18
store i32 0, i32* %3
br label %60
22: ; preds = %2
%23 = load i32, i32* %5
switch i32 %23, label %25 [
i32 3, label %24
i32 6, label %24
i32 10, label %24
i32 9, label %24
i32 12, label %24
i32 2, label %24
]
24: ; preds = %22, %22, %22, %22, %22, %22
store i32 0, i32* %3
br label %60
25: ; preds = %22
store i32 1, i32* %3
br label %60
26: ; preds = %2
%27 = load i32, i32* %5
switch i32 %27, label %29 [
i32 10, label %28
i32 9, label %28
i32 12, label %28
i32 2, label %28
]
28: ; preds = %26, %26, %26, %26
store i32 0, i32* %3
br label %60
29: ; preds = %26
store i32 1, i32* %3
br label %60
30: ; preds = %2
%31 = load i32, i32* %5
switch i32 %31, label %33 [
i32 0, label %32
i32 1, label %32
i32 13, label %32
i32 4, label %32
i32 8, label %32
]
32: ; preds = %30, %30, %30, %30, %30
store i32 1, i32* %3
br label %60
33: ; preds = %30
store i32 0, i32* %3
br label %60
34: ; preds = %2
%35 = load i32, i32* %5
switch i32 %35, label %37 [
i32 0, label %36
i32 1, label %36
i32 13, label %36
i32 4, label %36
]
36: ; preds = %34, %34, %34, %34
store i32 1, i32* %3
br label %60
37: ; preds = %34
store i32 0, i32* %3
br label %60
38: ; preds = %2
%39 = load i32, i32* %5
switch i32 %39, label %41 [
i32 12, label %40
i32 2, label %40
]
40: ; preds = %38, %38
store i32 0, i32* %3
br label %60
41: ; preds = %38
store i32 1, i32* %3
br label %60
42: ; preds = %2
%43 = load i32, i32* %5
switch i32 %43, label %45 [
i32 9, label %44
i32 12, label %44
i32 2, label %44
]
44: ; preds = %42, %42, %42
store i32 0, i32* %3
br label %60
45: ; preds = %42
store i32 1, i32* %3
br label %60
46: ; preds = %2
%47 = load i32, i32* %5
switch i32 %47, label %49 [
i32 0, label %48
i32 1, label %48
i32 13, label %48
i32 4, label %48
i32 8, label %48
i32 7, label %48
]
48: ; preds = %46, %46, %46, %46, %46, %46
store i32 1, i32* %3
br label %60
49: ; preds = %46
store i32 0, i32* %3
br label %60
50: ; preds = %2
%51 = load i32, i32* %5
%52 = icmp eq i32 %51, 2
br i1 %52, label %53, label %54
53: ; preds = %50
store i32 0, i32* %3
br label %60
54: ; preds = %50
store i32 1, i32* %3
br label %60
55: ; preds = %2
%56 = load i32, i32* %5
%57 = icmp slt i32 %56, 2
br i1 %57, label %58, label %59
58: ; preds = %55
store i32 1, i32* %3
br label %60
59: ; preds = %55
store i32 0, i32* %3
br label %60
60: ; preds = %7, %11, %12, %13, %16, %17, %20, %21, %24, %25, %28, %29, %32, %33, %36, %37, %40, %41, %44, %45, %48, %49, %53, %54, %58, %59, %2
%61 = load i32, i32* %3
ret i32 %61
}

LLVM IR (-O2):
define i32 @ready_for_check(i32 %0, i32 %1) {
switch i32 %0, label %74 [
i32 13, label %32
i32 1, label %3
i32 2, label %5
i32 3, label %6
i32 4, label %9
i32 5, label %11
i32 6, label %14
i32 7, label %17
i32 8, label %19
i32 9, label %21
i32 10, label %25
i32 11, label %28
i32 12, label %30
]
3: ; preds = %2
%4 = icmp eq i32 %1, 0
br label %74
5: ; preds = %2
br label %74
6: ; preds = %2
%7 = add i32 %1, -2
%8 = icmp ult i32 %7, 11
br i1 %8, label %34, label %74
9: ; preds = %2
%10 = icmp ult i32 %1, 14
br i1 %10, label %39, label %74
11: ; preds = %2
%12 = add i32 %1, -2
%13 = icmp ult i32 %12, 11
br i1 %13, label %44, label %74
14: ; preds = %2
%15 = add i32 %1, -2
%16 = icmp ult i32 %15, 11
br i1 %16, label %49, label %74
17: ; preds = %2
%18 = icmp ult i32 %1, 14
br i1 %18, label %54, label %74
19: ; preds = %2
%20 = icmp ult i32 %1, 14
br i1 %20, label %59, label %74
21: ; preds = %2
%22 = icmp ne i32 %1, 12
%23 = icmp ne i32 %1, 2
%24 = and i1 %22, %23
br label %74
25: ; preds = %2
%26 = add i32 %1, -2
%27 = icmp ult i32 %26, 11
br i1 %27, label %64, label %74
28: ; preds = %2
%29 = icmp ult i32 %1, 14
br i1 %29, label %69, label %74
30: ; preds = %2
%31 = icmp ne i32 %1, 2
br label %74
32: ; preds = %2
%33 = icmp slt i32 %1, 2
br label %74
34: ; preds = %6
%35 = trunc i32 %7 to i11
%36 = lshr i11 622, %35
%37 = and i11 %36, 1
%38 = icmp ne i11 %37, 0
br label %74
39: ; preds = %9
%40 = trunc i32 %1 to i14
%41 = lshr i14 -8189, %40
%42 = and i14 %41, 1
%43 = icmp ne i14 %42, 0
br label %74
44: ; preds = %11
%45 = trunc i32 %12 to i11
%46 = lshr i11 620, %45
%47 = and i11 %46, 1
%48 = icmp ne i11 %47, 0
br label %74
49: ; preds = %14
%50 = trunc i32 %15 to i11
%51 = lshr i11 638, %50
%52 = and i11 %51, 1
%53 = icmp ne i11 %52, 0
br label %74
54: ; preds = %17
%55 = trunc i32 %1 to i14
%56 = lshr i14 -7917, %55
%57 = and i14 %56, 1
%58 = icmp ne i14 %57, 0
br label %74
59: ; preds = %19
%60 = trunc i32 %1 to i14
%61 = lshr i14 -8173, %60
%62 = and i14 %61, 1
%63 = icmp ne i14 %62, 0
br label %74
64: ; preds = %25
%65 = trunc i32 %26 to i11
%66 = lshr i11 894, %65
%67 = and i11 %66, 1
%68 = icmp ne i11 %67, 0
br label %74
69: ; preds = %28
%70 = trunc i32 %1 to i14
%71 = lshr i14 -7789, %70
%72 = and i14 %71, 1
%73 = icmp ne i14 %72, 0
br label %74
74: ; preds = %28, %69, %25, %64, %19, %59, %17, %54, %14, %49, %11, %44, %9, %39, %6, %34, %32, %30, %21, %3, %5, %2
%75 = phi i1 [ true, %5 ], [ false, %2 ], [ %4, %3 ], [ %24, %21 ], [ %31, %30 ], [ %33, %32 ], [ %38, %34 ], [ true, %6 ], [ %43, %39 ], [ false, %9 ], [ %48, %44 ], [ true, %11 ], [ %53, %49 ], [ true, %14 ], [ %58, %54 ], [ false, %17 ], [ %63, %59 ], [ false, %19 ], [ %68, %64 ], [ true, %25 ], [ %73, %69 ], [ false, %28 ]
%76 = zext i1 %75 to i32
ret i32 %76
}