#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 rand();
int chooseAppropriateDirection(int new_x, int new_y) {
  int direction;
  if (new_x >= 4600 && new_x <= 5400 && new_y >= 4600 && new_y <= 5400) {
    direction = (int)((rand() % 8) + 1);
    return direction;
  } else if (new_x < 4600 && new_y >= 4600 && new_y <= 5400) {
    direction = (int)(rand() % 3);
    if (direction == 0)
      return 2;
    else if (direction == 1)
      return 3;
    else if (direction == 2)
      return 4;
  } else if (new_x > 5400 && new_y >= 4600 && new_y <= 5400) {
    direction = (int)(rand() % 3);
    if (direction == 0)
      return 6;
    else if (direction == 1)
      return 7;
    else if (direction == 2)
      return 8;
  } else if (new_y < 4600 && new_x >= 4600 && new_x <= 5400) {
    direction = (int)(rand() % 3);
    if (direction == 0)
      return 1;
    else if (direction == 1)
      return 2;
    else if (direction == 2)
      return 8;
  } else if (new_y > 5400 && new_x >= 4600 && new_x <= 5400) {
    direction = (int)(rand() % 3);
    if (direction == 0)
      return 4;
    else if (direction == 1)
      return 5;
    else if (direction == 2)
      return 6;
  } else if (new_x < 4600 && new_y < 4600) {
    return 2;
  } else if (new_x < 4600 && new_y > 5400) {
    return 4;
  } else if (new_x > 5400 && new_y > 5400) {
    return 6;
  } else if (new_x > 5400 && new_y < 4600) {
    return 8;
  }
  return -1;
}


x86 assembly (clang, -O0):
<chooseAppropriateDirection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x11f8,-0x8(%rbp)
jl     1172 <chooseAppropriateDirection+0x62>
cmpl   $0x1518,-0x8(%rbp)
jg     1172 <chooseAppropriateDirection+0x62>
cmpl   $0x11f8,-0xc(%rbp)
jl     1172 <chooseAppropriateDirection+0x62>
cmpl   $0x1518,-0xc(%rbp)
jg     1172 <chooseAppropriateDirection+0x62>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x8,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1461 <chooseAppropriateDirection+0x351>
cmpl   $0x11f8,-0x8(%rbp)
jge    11fc <chooseAppropriateDirection+0xec>
cmpl   $0x11f8,-0xc(%rbp)
jl     11fc <chooseAppropriateDirection+0xec>
cmpl   $0x1518,-0xc(%rbp)
jg     11fc <chooseAppropriateDirection+0xec>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    11c1 <chooseAppropriateDirection+0xb1>
movl   $0x2,-0x4(%rbp)
jmp    1461 <chooseAppropriateDirection+0x351>
cmpl   $0x1,-0x10(%rbp)
jne    11d7 <chooseAppropriateDirection+0xc7>
movl   $0x3,-0x4(%rbp)
jmp    1461 <chooseAppropriateDirection+0x351>
cmpl   $0x2,-0x10(%rbp)
jne    11ed <chooseAppropriateDirection+0xdd>
movl   $0x4,-0x4(%rbp)
jmp    1461 <chooseAppropriateDirection+0x351>
jmp    11f2 <chooseAppropriateDirection+0xe2>
jmp    11f7 <chooseAppropriateDirection+0xe7>
jmp    1455 <chooseAppropriateDirection+0x345>
cmpl   $0x1518,-0x8(%rbp)
jle    1286 <chooseAppropriateDirection+0x176>
cmpl   $0x11f8,-0xc(%rbp)
jl     1286 <chooseAppropriateDirection+0x176>
cmpl   $0x1518,-0xc(%rbp)
jg     1286 <chooseAppropriateDirection+0x176>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    124b <chooseAppropriateDirection+0x13b>
movl   $0x6,-0x4(%rbp)
jmp    1461 <chooseAppropriateDirection+0x351>
cmpl   $0x1,-0x10(%rbp)
jne    1261 <chooseAppropriateDirection+0x151>
movl   $0x7,-0x4(%rbp)
jmp    1461 <chooseAppropriateDirection+0x351>
cmpl   $0x2,-0x10(%rbp)
jne    1277 <chooseAppropriateDirection+0x167>
movl   $0x8,-0x4(%rbp)
jmp    1461 <chooseAppropriateDirection+0x351>
jmp    127c <chooseAppropriateDirection+0x16c>
jmp    1281 <chooseAppropriateDirection+0x171>
jmp    1450 <chooseAppropriateDirection+0x340>
cmpl   $0x11f8,-0xc(%rbp)
jge    1310 <chooseAppropriateDirection+0x200>
cmpl   $0x11f8,-0x8(%rbp)
jl     1310 <chooseAppropriateDirection+0x200>
cmpl   $0x1518,-0x8(%rbp)
jg     1310 <chooseAppropriateDirection+0x200>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    12d5 <chooseAppropriateDirection+0x1c5>
movl   $0x1,-0x4(%rbp)
jmp    1461 <chooseAppropriateDirection+0x351>
cmpl   $0x1,-0x10(%rbp)
jne    12eb <chooseAppropriateDirection+0x1db>
movl   $0x2,-0x4(%rbp)
jmp    1461 <chooseAppropriateDirection+0x351>
cmpl   $0x2,-0x10(%rbp)
jne    1301 <chooseAppropriateDirection+0x1f1>
movl   $0x8,-0x4(%rbp)
jmp    1461 <chooseAppropriateDirection+0x351>
jmp    1306 <chooseAppropriateDirection+0x1f6>
jmp    130b <chooseAppropriateDirection+0x1fb>
jmp    144b <chooseAppropriateDirection+0x33b>
cmpl   $0x1518,-0xc(%rbp)
jle    139a <chooseAppropriateDirection+0x28a>
cmpl   $0x11f8,-0x8(%rbp)
jl     139a <chooseAppropriateDirection+0x28a>
cmpl   $0x1518,-0x8(%rbp)
jg     139a <chooseAppropriateDirection+0x28a>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    135f <chooseAppropriateDirection+0x24f>
movl   $0x4,-0x4(%rbp)
jmp    1461 <chooseAppropriateDirection+0x351>
cmpl   $0x1,-0x10(%rbp)
jne    1375 <chooseAppropriateDirection+0x265>
movl   $0x5,-0x4(%rbp)
jmp    1461 <chooseAppropriateDirection+0x351>
cmpl   $0x2,-0x10(%rbp)
jne    138b <chooseAppropriateDirection+0x27b>
movl   $0x6,-0x4(%rbp)
jmp    1461 <chooseAppropriateDirection+0x351>
jmp    1390 <chooseAppropriateDirection+0x280>
jmp    1395 <chooseAppropriateDirection+0x285>
jmp    1446 <chooseAppropriateDirection+0x336>
cmpl   $0x11f8,-0x8(%rbp)
jge    13c0 <chooseAppropriateDirection+0x2b0>
cmpl   $0x11f8,-0xc(%rbp)
jge    13c0 <chooseAppropriateDirection+0x2b0>
movl   $0x2,-0x4(%rbp)
jmp    1461 <chooseAppropriateDirection+0x351>
cmpl   $0x11f8,-0x8(%rbp)
jge    13e6 <chooseAppropriateDirection+0x2d6>
cmpl   $0x1518,-0xc(%rbp)
jle    13e6 <chooseAppropriateDirection+0x2d6>
movl   $0x4,-0x4(%rbp)
jmp    1461 <chooseAppropriateDirection+0x351>
cmpl   $0x1518,-0x8(%rbp)
jle    140c <chooseAppropriateDirection+0x2fc>
cmpl   $0x1518,-0xc(%rbp)
jle    140c <chooseAppropriateDirection+0x2fc>
movl   $0x6,-0x4(%rbp)
jmp    1461 <chooseAppropriateDirection+0x351>
cmpl   $0x1518,-0x8(%rbp)
jle    1432 <chooseAppropriateDirection+0x322>
cmpl   $0x11f8,-0xc(%rbp)
jge    1432 <chooseAppropriateDirection+0x322>
movl   $0x8,-0x4(%rbp)
jmp    1461 <chooseAppropriateDirection+0x351>
jmp    1437 <chooseAppropriateDirection+0x327>
jmp    143c <chooseAppropriateDirection+0x32c>
jmp    1441 <chooseAppropriateDirection+0x331>
jmp    1446 <chooseAppropriateDirection+0x336>
jmp    144b <chooseAppropriateDirection+0x33b>
jmp    1450 <chooseAppropriateDirection+0x340>
jmp    1455 <chooseAppropriateDirection+0x345>
jmp    145a <chooseAppropriateDirection+0x34a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chooseAppropriateDirection>:
push   %rax
lea    -0x11f8(%rdi),%eax
lea    -0x11f8(%rsi),%ecx
cmp    $0x320,%eax
ja     1147 <chooseAppropriateDirection+0x37>
cmp    $0x320,%ecx
ja     1147 <chooseAppropriateDirection+0x37>
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff8,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret
cmp    $0x11f7,%edi
jg     1187 <chooseAppropriateDirection+0x77>
cmp    $0x320,%ecx
ja     1187 <chooseAppropriateDirection+0x77>
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
cmp    $0x3,%eax
jae    12ae <chooseAppropriateDirection+0x19e>
add    $0x2,%eax
pop    %rcx
ret
cmp    $0x1519,%edi
jl     11c7 <chooseAppropriateDirection+0xb7>
cmp    $0x320,%ecx
ja     11c7 <chooseAppropriateDirection+0xb7>
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
cmp    $0x3,%eax
jae    12ae <chooseAppropriateDirection+0x19e>
add    $0x6,%eax
pop    %rcx
ret
cmp    $0x320,%eax
ja     120f <chooseAppropriateDirection+0xff>
cmp    $0x11f7,%esi
jg     120f <chooseAppropriateDirection+0xff>
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
cmp    $0x3,%eax
jae    12ae <chooseAppropriateDirection+0x19e>
cltq
lea    0xdf6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret
cmp    $0x320,%eax
ja     124a <chooseAppropriateDirection+0x13a>
cmp    $0x1519,%esi
jl     124a <chooseAppropriateDirection+0x13a>
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
cmp    $0x3,%eax
jae    12ae <chooseAppropriateDirection+0x19e>
add    $0x4,%eax
pop    %rcx
ret
cmp    $0x11f7,%edi
jg     1263 <chooseAppropriateDirection+0x153>
mov    $0x2,%eax
cmp    $0x11f8,%esi
jl     1145 <chooseAppropriateDirection+0x35>
cmp    $0x11f7,%edi
jg     127c <chooseAppropriateDirection+0x16c>
mov    $0x4,%eax
cmp    $0x1518,%esi
jg     1145 <chooseAppropriateDirection+0x35>
cmp    $0x1519,%edi
jl     1295 <chooseAppropriateDirection+0x185>
mov    $0x6,%eax
cmp    $0x1518,%esi
jg     1145 <chooseAppropriateDirection+0x35>
cmp    $0x1519,%edi
jl     12ae <chooseAppropriateDirection+0x19e>
mov    $0x8,%eax
cmp    $0x11f8,%esi
jl     1145 <chooseAppropriateDirection+0x35>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @chooseAppropriateDirection(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 4600
br i1 %8, label %9, label %23
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp sle i32 %10, 5400
br i1 %11, label %12, label %23
12: ; preds = %9
%13 = load i32, i32* %5
%14 = icmp sge i32 %13, 4600
br i1 %14, label %15, label %23
15: ; preds = %12
%16 = load i32, i32* %5
%17 = icmp sle i32 %16, 5400
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = call i32 (...) @rand()
%20 = srem i32 %19, 8
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
%22 = load i32, i32* %6
store i32 %22, i32* %3
br label %164
23: ; preds = %15, %12, %9, %2
%24 = load i32, i32* %4
%25 = icmp slt i32 %24, 4600
br i1 %25, label %26, label %49
26: ; preds = %23
%27 = load i32, i32* %5
%28 = icmp sge i32 %27, 4600
br i1 %28, label %29, label %49
29: ; preds = %26
%30 = load i32, i32* %5
%31 = icmp sle i32 %30, 5400
br i1 %31, label %32, label %49
32: ; preds = %29
%33 = call i32 (...) @rand()
%34 = srem i32 %33, 3
store i32 %34, i32* %6
%35 = load i32, i32* %6
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %32
store i32 2, i32* %3
br label %164
38: ; preds = %32
%39 = load i32, i32* %6
%40 = icmp eq i32 %39, 1
br i1 %40, label %41, label %42
41: ; preds = %38
store i32 3, i32* %3
br label %164
42: ; preds = %38
%43 = load i32, i32* %6
%44 = icmp eq i32 %43, 2
br i1 %44, label %45, label %46
45: ; preds = %42
store i32 4, i32* %3
br label %164
46: ; preds = %42
br label %47
47: ; preds = %46
br label %48
48: ; preds = %47
br label %162
49: ; preds = %29, %26, %23
%50 = load i32, i32* %4
%51 = icmp sgt i32 %50, 5400
br i1 %51, label %52, label %75
52: ; preds = %49
%53 = load i32, i32* %5
%54 = icmp sge i32 %53, 4600
br i1 %54, label %55, label %75
55: ; preds = %52
%56 = load i32, i32* %5
%57 = icmp sle i32 %56, 5400
br i1 %57, label %58, label %75
58: ; preds = %55
%59 = call i32 (...) @rand()
%60 = srem i32 %59, 3
store i32 %60, i32* %6
%61 = load i32, i32* %6
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %64
63: ; preds = %58
store i32 6, i32* %3
br label %164
64: ; preds = %58
%65 = load i32, i32* %6
%66 = icmp eq i32 %65, 1
br i1 %66, label %67, label %68
67: ; preds = %64
store i32 7, i32* %3
br label %164
68: ; preds = %64
%69 = load i32, i32* %6
%70 = icmp eq i32 %69, 2
br i1 %70, label %71, label %72
71: ; preds = %68
store i32 8, i32* %3
br label %164
72: ; preds = %68
br label %73
73: ; preds = %72
br label %74
74: ; preds = %73
br label %161
75: ; preds = %55, %52, %49
%76 = load i32, i32* %5
%77 = icmp slt i32 %76, 4600
br i1 %77, label %78, label %101
78: ; preds = %75
%79 = load i32, i32* %4
%80 = icmp sge i32 %79, 4600
br i1 %80, label %81, label %101
81: ; preds = %78
%82 = load i32, i32* %4
%83 = icmp sle i32 %82, 5400
br i1 %83, label %84, label %101
84: ; preds = %81
%85 = call i32 (...) @rand()
%86 = srem i32 %85, 3
store i32 %86, i32* %6
%87 = load i32, i32* %6
%88 = icmp eq i32 %87, 0
br i1 %88, label %89, label %90
89: ; preds = %84
store i32 1, i32* %3
br label %164
90: ; preds = %84
%91 = load i32, i32* %6
%92 = icmp eq i32 %91, 1
br i1 %92, label %93, label %94
93: ; preds = %90
store i32 2, i32* %3
br label %164
94: ; preds = %90
%95 = load i32, i32* %6
%96 = icmp eq i32 %95, 2
br i1 %96, label %97, label %98
97: ; preds = %94
store i32 8, i32* %3
br label %164
98: ; preds = %94
br label %99
99: ; preds = %98
br label %100
100: ; preds = %99
br label %160
101: ; preds = %81, %78, %75
%102 = load i32, i32* %5
%103 = icmp sgt i32 %102, 5400
br i1 %103, label %104, label %127
104: ; preds = %101
%105 = load i32, i32* %4
%106 = icmp sge i32 %105, 4600
br i1 %106, label %107, label %127
107: ; preds = %104
%108 = load i32, i32* %4
%109 = icmp sle i32 %108, 5400
br i1 %109, label %110, label %127
110: ; preds = %107
%111 = call i32 (...) @rand()
%112 = srem i32 %111, 3
store i32 %112, i32* %6
%113 = load i32, i32* %6
%114 = icmp eq i32 %113, 0
br i1 %114, label %115, label %116
115: ; preds = %110
store i32 4, i32* %3
br label %164
116: ; preds = %110
%117 = load i32, i32* %6
%118 = icmp eq i32 %117, 1
br i1 %118, label %119, label %120
119: ; preds = %116
store i32 5, i32* %3
br label %164
120: ; preds = %116
%121 = load i32, i32* %6
%122 = icmp eq i32 %121, 2
br i1 %122, label %123, label %124
123: ; preds = %120
store i32 6, i32* %3
br label %164
124: ; preds = %120
br label %125
125: ; preds = %124
br label %126
126: ; preds = %125
br label %159
127: ; preds = %107, %104, %101
%128 = load i32, i32* %4
%129 = icmp slt i32 %128, 4600
br i1 %129, label %130, label %134
130: ; preds = %127
%131 = load i32, i32* %5
%132 = icmp slt i32 %131, 4600
br i1 %132, label %133, label %134
133: ; preds = %130
store i32 2, i32* %3
br label %164
134: ; preds = %130, %127
%135 = load i32, i32* %4
%136 = icmp slt i32 %135, 4600
br i1 %136, label %137, label %141
137: ; preds = %134
%138 = load i32, i32* %5
%139 = icmp sgt i32 %138, 5400
br i1 %139, label %140, label %141
140: ; preds = %137
store i32 4, i32* %3
br label %164
141: ; preds = %137, %134
%142 = load i32, i32* %4
%143 = icmp sgt i32 %142, 5400
br i1 %143, label %144, label %148
144: ; preds = %141
%145 = load i32, i32* %5
%146 = icmp sgt i32 %145, 5400
br i1 %146, label %147, label %148
147: ; preds = %144
store i32 6, i32* %3
br label %164
148: ; preds = %144, %141
%149 = load i32, i32* %4
%150 = icmp sgt i32 %149, 5400
br i1 %150, label %151, label %155
151: ; preds = %148
%152 = load i32, i32* %5
%153 = icmp slt i32 %152, 4600
br i1 %153, label %154, label %155
154: ; preds = %151
store i32 8, i32* %3
br label %164
155: ; preds = %151, %148
br label %156
156: ; preds = %155
br label %157
157: ; preds = %156
br label %158
158: ; preds = %157
br label %159
159: ; preds = %158, %126
br label %160
160: ; preds = %159, %100
br label %161
161: ; preds = %160, %74
br label %162
162: ; preds = %161, %48
br label %163
163: ; preds = %162
store i32 -1, i32* %3
br label %164
164: ; preds = %163, %154, %147, %140, %133, %123, %119, %115, %97, %93, %89, %71, %67, %63, %45, %41, %37, %18
%165 = load i32, i32* %3
ret i32 %165
}

LLVM IR (-O2):
@switch.table.chooseAppropriateDirection = [3 x i32] [i32 1, i32 2, i32 8]
define i32 @chooseAppropriateDirection(i32 %0, i32 %1) {
%3 = add i32 %0, -4600
%4 = icmp ult i32 %3, 801
%5 = add i32 %1, -4600
%6 = icmp ult i32 %5, 801
%7 = and i1 %4, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, 8
%11 = add nsw i32 %10, 1
br label %59
12: ; preds = %2
%13 = icmp slt i32 %0, 4600
%14 = and i1 %13, %6
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = tail call i32 (...) @rand()
%17 = srem i32 %16, 3
%18 = icmp ult i32 %17, 3
br i1 %18, label %49, label %48
19: ; preds = %12
%20 = icmp sgt i32 %0, 5400
%21 = and i1 %20, %6
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = tail call i32 (...) @rand()
%24 = srem i32 %23, 3
%25 = icmp ult i32 %24, 3
br i1 %25, label %51, label %48
26: ; preds = %19
%27 = icmp slt i32 %1, 4600
%28 = and i1 %4, %27
br i1 %28, label %29, label %33
29: ; preds = %26
%30 = tail call i32 (...) @rand()
%31 = srem i32 %30, 3
%32 = icmp ult i32 %31, 3
br i1 %32, label %53, label %48
33: ; preds = %26
%34 = icmp sgt i32 %1, 5400
%35 = and i1 %4, %34
br i1 %35, label %36, label %40
36: ; preds = %33
%37 = tail call i32 (...) @rand()
%38 = srem i32 %37, 3
%39 = icmp ult i32 %38, 3
br i1 %39, label %57, label %48
40: ; preds = %33
%41 = and i1 %13, %27
br i1 %41, label %59, label %42
42: ; preds = %40
%43 = and i1 %13, %34
br i1 %43, label %59, label %44
44: ; preds = %42
%45 = and i1 %20, %34
br i1 %45, label %59, label %46
46: ; preds = %44
%47 = and i1 %20, %27
br i1 %47, label %59, label %48
48: ; preds = %36, %29, %22, %15, %46
br label %59
49: ; preds = %15
%50 = add nsw i32 %17, 2
br label %59
51: ; preds = %22
%52 = add nsw i32 %24, 6
br label %59
53: ; preds = %29
%54 = sext i32 %31 to i64
%55 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.chooseAppropriateDirection, i64 0, i64 %54
%56 = load i32, i32* %55
br label %59
57: ; preds = %36
%58 = add nsw i32 %38, 4
br label %59
59: ; preds = %57, %53, %51, %49, %46, %44, %42, %40, %48, %8
%60 = phi i32 [ %11, %8 ], [ -1, %48 ], [ 2, %40 ], [ 4, %42 ], [ 6, %44 ], [ 8, %46 ], [ %50, %49 ], [ %52, %51 ], [ %56, %53 ], [ %58, %57 ]
ret i32 %60
}