#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 /*<<< orphan*/ ding();
int /*<<< orphan*/ drawgoalscreen();
int /*<<< orphan*/ drawhelpscreen();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ initgamestate();
int input();
int /*<<< orphan*/ movecursor(int);
int /*<<< orphan*/ newmove(int);
int /*<<< orphan*/ partialsave();
int /*<<< orphan*/ redomove();
int /*<<< orphan*/ redostep();
int /*<<< orphan*/ restorestate();
int /*<<< orphan*/ savestate();
int /*<<< orphan*/ shiftfromcurrblock(int);
int /*<<< orphan*/ undomove();
int /*<<< orphan*/ undostep();
int doturn(void) {
  switch (input()) {
  case (1024 + 0):
    if (!movecursor(0))
      ding();
    break;
  case (1024 + 1):
    if (!movecursor(1))
      ding();
    break;
  case (1024 + 2):
    if (!movecursor(2))
      ding();
    break;
  case (1024 + 3):
    if (!movecursor(3))
      ding();
    break;
  case 'k':
    if (!shiftfromcurrblock(0))
      ding();
    break;
  case 'l':
    if (!shiftfromcurrblock(1))
      ding();
    break;
  case 'j':
    if (!shiftfromcurrblock(2))
      ding();
    break;
  case 'h':
    if (!shiftfromcurrblock(3))
      ding();
    break;
  case 'K':
    if (!newmove(0))
      ding();
    break;
  case 'L':
    if (!newmove(1))
      ding();
    break;
  case 'J':
    if (!newmove(2))
      ding();
    break;
  case 'H':
    if (!newmove(3))
      ding();
    break;
  case 'x':
    if (!undomove())
      ding();
    break;
  case 'z':
    if (!redomove())
      ding();
    break;
  case 'X':
    if (!undostep())
      ding();
    break;
  case 'Z':
    if (!redostep())
      ding();
    break;
  case 'R':
    initgamestate();
    break;
  case 's':
    savestate();
    break;
  case 'r':
    if (!restorestate())
      ding();
    break;
  case 'S':
    if (!partialsave())
      ding();
    break;
  case 'g':
    drawgoalscreen();
    break;
  case '?':
    drawhelpscreen();
    break;
  case '\f':
    break;
  case 'P':
    return -1;
  case 'N':
    return +1;
  case 'q':
    exit(0);
  case 'Q':
    exit(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<doturn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1050 <input@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0xc,%eax
je     1627 <doturn+0x427>
jmp    1222 <doturn+0x22>
mov    -0x8(%rbp),%eax
sub    $0x3f,%eax
je     161b <doturn+0x41b>
jmp    1233 <doturn+0x33>
mov    -0x8(%rbp),%eax
sub    $0x48,%eax
je     1530 <doturn+0x330>
jmp    1244 <doturn+0x44>
mov    -0x8(%rbp),%eax
sub    $0x4a,%eax
je     1511 <doturn+0x311>
jmp    1255 <doturn+0x55>
mov    -0x8(%rbp),%eax
sub    $0x4b,%eax
je     14d6 <doturn+0x2d6>
jmp    1266 <doturn+0x66>
mov    -0x8(%rbp),%eax
sub    $0x4c,%eax
je     14f2 <doturn+0x2f2>
jmp    1277 <doturn+0x77>
mov    -0x8(%rbp),%eax
sub    $0x4e,%eax
je     1638 <doturn+0x438>
jmp    1288 <doturn+0x88>
mov    -0x8(%rbp),%eax
sub    $0x50,%eax
je     162c <doturn+0x42c>
jmp    1299 <doturn+0x99>
mov    -0x8(%rbp),%eax
sub    $0x51,%eax
je     164b <doturn+0x44b>
jmp    12aa <doturn+0xaa>
mov    -0x8(%rbp),%eax
sub    $0x52,%eax
je     15bf <doturn+0x3bf>
jmp    12bb <doturn+0xbb>
mov    -0x8(%rbp),%eax
sub    $0x53,%eax
je     15f3 <doturn+0x3f3>
jmp    12cc <doturn+0xcc>
mov    -0x8(%rbp),%eax
sub    $0x58,%eax
je     1587 <doturn+0x387>
jmp    12dd <doturn+0xdd>
mov    -0x8(%rbp),%eax
sub    $0x5a,%eax
je     15a3 <doturn+0x3a3>
jmp    12ee <doturn+0xee>
mov    -0x8(%rbp),%eax
sub    $0x67,%eax
je     160f <doturn+0x40f>
jmp    12ff <doturn+0xff>
mov    -0x8(%rbp),%eax
sub    $0x68,%eax
je     14b7 <doturn+0x2b7>
jmp    1310 <doturn+0x110>
mov    -0x8(%rbp),%eax
sub    $0x6a,%eax
je     1498 <doturn+0x298>
jmp    1321 <doturn+0x121>
mov    -0x8(%rbp),%eax
sub    $0x6b,%eax
je     145d <doturn+0x25d>
jmp    1332 <doturn+0x132>
mov    -0x8(%rbp),%eax
sub    $0x6c,%eax
je     1479 <doturn+0x279>
jmp    1343 <doturn+0x143>
mov    -0x8(%rbp),%eax
sub    $0x71,%eax
je     1644 <doturn+0x444>
jmp    1354 <doturn+0x154>
mov    -0x8(%rbp),%eax
sub    $0x72,%eax
je     15d7 <doturn+0x3d7>
jmp    1365 <doturn+0x165>
mov    -0x8(%rbp),%eax
sub    $0x73,%eax
je     15cb <doturn+0x3cb>
jmp    1376 <doturn+0x176>
mov    -0x8(%rbp),%eax
sub    $0x78,%eax
je     154f <doturn+0x34f>
jmp    1387 <doturn+0x187>
mov    -0x8(%rbp),%eax
sub    $0x7a,%eax
je     156b <doturn+0x36b>
jmp    1398 <doturn+0x198>
mov    -0x8(%rbp),%eax
sub    $0x400,%eax
je     13e4 <doturn+0x1e4>
jmp    13ab <doturn+0x1ab>
mov    -0x8(%rbp),%eax
sub    $0x401,%eax
je     1400 <doturn+0x200>
jmp    13be <doturn+0x1be>
mov    -0x8(%rbp),%eax
sub    $0x402,%eax
je     141f <doturn+0x21f>
jmp    13d1 <doturn+0x1d1>
mov    -0x8(%rbp),%eax
sub    $0x403,%eax
je     143e <doturn+0x23e>
jmp    1652 <doturn+0x452>
xor    %edi,%edi
call   1030 <movecursor@plt>
cmp    $0x0,%eax
jne    13fb <doturn+0x1fb>
mov    $0x0,%al
call   10b0 <ding@plt>
jmp    1652 <doturn+0x452>
mov    $0x1,%edi
call   1030 <movecursor@plt>
cmp    $0x0,%eax
jne    141a <doturn+0x21a>
mov    $0x0,%al
call   10b0 <ding@plt>
jmp    1652 <doturn+0x452>
mov    $0x2,%edi
call   1030 <movecursor@plt>
cmp    $0x0,%eax
jne    1439 <doturn+0x239>
mov    $0x0,%al
call   10b0 <ding@plt>
jmp    1652 <doturn+0x452>
mov    $0x3,%edi
call   1030 <movecursor@plt>
cmp    $0x0,%eax
jne    1458 <doturn+0x258>
mov    $0x0,%al
call   10b0 <ding@plt>
jmp    1652 <doturn+0x452>
xor    %edi,%edi
call   1120 <shiftfromcurrblock@plt>
cmp    $0x0,%eax
jne    1474 <doturn+0x274>
mov    $0x0,%al
call   10b0 <ding@plt>
jmp    1652 <doturn+0x452>
mov    $0x1,%edi
call   1120 <shiftfromcurrblock@plt>
cmp    $0x0,%eax
jne    1493 <doturn+0x293>
mov    $0x0,%al
call   10b0 <ding@plt>
jmp    1652 <doturn+0x452>
mov    $0x2,%edi
call   1120 <shiftfromcurrblock@plt>
cmp    $0x0,%eax
jne    14b2 <doturn+0x2b2>
mov    $0x0,%al
call   10b0 <ding@plt>
jmp    1652 <doturn+0x452>
mov    $0x3,%edi
call   1120 <shiftfromcurrblock@plt>
cmp    $0x0,%eax
jne    14d1 <doturn+0x2d1>
mov    $0x0,%al
call   10b0 <ding@plt>
jmp    1652 <doturn+0x452>
xor    %edi,%edi
call   1040 <newmove@plt>
cmp    $0x0,%eax
jne    14ed <doturn+0x2ed>
mov    $0x0,%al
call   10b0 <ding@plt>
jmp    1652 <doturn+0x452>
mov    $0x1,%edi
call   1040 <newmove@plt>
cmp    $0x0,%eax
jne    150c <doturn+0x30c>
mov    $0x0,%al
call   10b0 <ding@plt>
jmp    1652 <doturn+0x452>
mov    $0x2,%edi
call   1040 <newmove@plt>
cmp    $0x0,%eax
jne    152b <doturn+0x32b>
mov    $0x0,%al
call   10b0 <ding@plt>
jmp    1652 <doturn+0x452>
mov    $0x3,%edi
call   1040 <newmove@plt>
cmp    $0x0,%eax
jne    154a <doturn+0x34a>
mov    $0x0,%al
call   10b0 <ding@plt>
jmp    1652 <doturn+0x452>
mov    $0x0,%al
call   1070 <undomove@plt>
cmp    $0x0,%eax
jne    1566 <doturn+0x366>
mov    $0x0,%al
call   10b0 <ding@plt>
jmp    1652 <doturn+0x452>
mov    $0x0,%al
call   10c0 <redomove@plt>
cmp    $0x0,%eax
jne    1582 <doturn+0x382>
mov    $0x0,%al
call   10b0 <ding@plt>
jmp    1652 <doturn+0x452>
mov    $0x0,%al
call   1060 <undostep@plt>
cmp    $0x0,%eax
jne    159e <doturn+0x39e>
mov    $0x0,%al
call   10b0 <ding@plt>
jmp    1652 <doturn+0x452>
mov    $0x0,%al
call   1110 <redostep@plt>
cmp    $0x0,%eax
jne    15ba <doturn+0x3ba>
mov    $0x0,%al
call   10b0 <ding@plt>
jmp    1652 <doturn+0x452>
mov    $0x0,%al
call   10e0 <initgamestate@plt>
jmp    1652 <doturn+0x452>
mov    $0x0,%al
call   1080 <savestate@plt>
jmp    1652 <doturn+0x452>
mov    $0x0,%al
call   1100 <restorestate@plt>
cmp    $0x0,%eax
jne    15ee <doturn+0x3ee>
mov    $0x0,%al
call   10b0 <ding@plt>
jmp    1652 <doturn+0x452>
mov    $0x0,%al
call   1090 <partialsave@plt>
cmp    $0x0,%eax
jne    160a <doturn+0x40a>
mov    $0x0,%al
call   10b0 <ding@plt>
jmp    1652 <doturn+0x452>
mov    $0x0,%al
call   10a0 <drawgoalscreen@plt>
jmp    1652 <doturn+0x452>
mov    $0x0,%al
call   10d0 <drawhelpscreen@plt>
jmp    1652 <doturn+0x452>
jmp    1652 <doturn+0x452>
movl   $0xffffffff,-0x4(%rbp)
jmp    1659 <doturn+0x459>
movl   $0x1,-0x4(%rbp)
jmp    1659 <doturn+0x459>
xor    %edi,%edi
call   10f0 <exit@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doturn>:
push   %rax
xor    %eax,%eax
call   1050 <input@plt>
lea    -0x3f(%rax),%ecx
cmp    $0x3b,%ecx
ja     1231 <doturn+0x31>
mov    $0xffffffff,%eax
lea    0xde4(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
xor    %eax,%eax
call   10d0 <drawhelpscreen@plt>
jmp    133d <doturn+0x13d>
add    $0xfffffc00,%eax
cmp    $0x3,%eax
ja     133d <doturn+0x13d>
lea    0xeaa(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %edi,%edi
jmp    132d <doturn+0x12d>
mov    $0x3,%edi
call   1040 <newmove@plt>
jmp    1332 <doturn+0x132>
mov    $0x2,%edi
call   1040 <newmove@plt>
jmp    1332 <doturn+0x132>
xor    %edi,%edi
call   1040 <newmove@plt>
jmp    1332 <doturn+0x132>
mov    $0x1,%edi
call   1040 <newmove@plt>
jmp    1332 <doturn+0x132>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
call   10e0 <initgamestate@plt>
jmp    133d <doturn+0x13d>
xor    %eax,%eax
call   1090 <partialsave@plt>
jmp    1332 <doturn+0x132>
xor    %eax,%eax
call   1060 <undostep@plt>
jmp    1332 <doturn+0x132>
xor    %eax,%eax
call   1110 <redostep@plt>
jmp    1332 <doturn+0x132>
xor    %eax,%eax
call   10a0 <drawgoalscreen@plt>
jmp    133d <doturn+0x13d>
mov    $0x3,%edi
call   1120 <shiftfromcurrblock@plt>
jmp    1332 <doturn+0x132>
mov    $0x2,%edi
call   1120 <shiftfromcurrblock@plt>
jmp    1332 <doturn+0x132>
xor    %edi,%edi
call   1120 <shiftfromcurrblock@plt>
jmp    1332 <doturn+0x132>
mov    $0x1,%edi
call   1120 <shiftfromcurrblock@plt>
jmp    1332 <doturn+0x132>
xor    %eax,%eax
call   1100 <restorestate@plt>
jmp    1332 <doturn+0x132>
xor    %eax,%eax
call   1080 <savestate@plt>
jmp    133d <doturn+0x13d>
xor    %eax,%eax
call   1070 <undomove@plt>
jmp    1332 <doturn+0x132>
xor    %eax,%eax
call   10c0 <redomove@plt>
jmp    1332 <doturn+0x132>
mov    $0x1,%edi
jmp    132d <doturn+0x12d>
mov    $0x2,%edi
jmp    132d <doturn+0x12d>
mov    $0x3,%edi
call   1030 <movecursor@plt>
test   %eax,%eax
jne    133d <doturn+0x13d>
xor    %eax,%eax
call   10b0 <ding@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %edi,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
define i32 @doturn() {
%1 = alloca i32
%2 = call i32 (...) @input()
switch i32 %2, label %126 [
i32 1024, label %3
i32 1025, label %9
i32 1026, label %15
i32 1027, label %21
i32 107, label %27
i32 108, label %33
i32 106, label %39
i32 104, label %45
i32 75, label %51
i32 76, label %57
i32 74, label %63
i32 72, label %69
i32 120, label %75
i32 122, label %81
i32 88, label %87
i32 90, label %93
i32 82, label %99
i32 115, label %101
i32 114, label %103
i32 83, label %109
i32 103, label %115
i32 63, label %117
i32 12, label %119
i32 80, label %120
i32 78, label %121
i32 113, label %122
i32 81, label %124
]
3: ; preds = %0
%4 = call i32 @movecursor(i32 0)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = call i32 (...) @ding()
br label %8
8: ; preds = %6, %3
br label %126
9: ; preds = %0
%10 = call i32 @movecursor(i32 1)
%11 = icmp ne i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = call i32 (...) @ding()
br label %14
14: ; preds = %12, %9
br label %126
15: ; preds = %0
%16 = call i32 @movecursor(i32 2)
%17 = icmp ne i32 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = call i32 (...) @ding()
br label %20
20: ; preds = %18, %15
br label %126
21: ; preds = %0
%22 = call i32 @movecursor(i32 3)
%23 = icmp ne i32 %22, 0
br i1 %23, label %26, label %24
24: ; preds = %21
%25 = call i32 (...) @ding()
br label %26
26: ; preds = %24, %21
br label %126
27: ; preds = %0
%28 = call i32 @shiftfromcurrblock(i32 0)
%29 = icmp ne i32 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %27
%31 = call i32 (...) @ding()
br label %32
32: ; preds = %30, %27
br label %126
33: ; preds = %0
%34 = call i32 @shiftfromcurrblock(i32 1)
%35 = icmp ne i32 %34, 0
br i1 %35, label %38, label %36
36: ; preds = %33
%37 = call i32 (...) @ding()
br label %38
38: ; preds = %36, %33
br label %126
39: ; preds = %0
%40 = call i32 @shiftfromcurrblock(i32 2)
%41 = icmp ne i32 %40, 0
br i1 %41, label %44, label %42
42: ; preds = %39
%43 = call i32 (...) @ding()
br label %44
44: ; preds = %42, %39
br label %126
45: ; preds = %0
%46 = call i32 @shiftfromcurrblock(i32 3)
%47 = icmp ne i32 %46, 0
br i1 %47, label %50, label %48
48: ; preds = %45
%49 = call i32 (...) @ding()
br label %50
50: ; preds = %48, %45
br label %126
51: ; preds = %0
%52 = call i32 @newmove(i32 0)
%53 = icmp ne i32 %52, 0
br i1 %53, label %56, label %54
54: ; preds = %51
%55 = call i32 (...) @ding()
br label %56
56: ; preds = %54, %51
br label %126
57: ; preds = %0
%58 = call i32 @newmove(i32 1)
%59 = icmp ne i32 %58, 0
br i1 %59, label %62, label %60
60: ; preds = %57
%61 = call i32 (...) @ding()
br label %62
62: ; preds = %60, %57
br label %126
63: ; preds = %0
%64 = call i32 @newmove(i32 2)
%65 = icmp ne i32 %64, 0
br i1 %65, label %68, label %66
66: ; preds = %63
%67 = call i32 (...) @ding()
br label %68
68: ; preds = %66, %63
br label %126
69: ; preds = %0
%70 = call i32 @newmove(i32 3)
%71 = icmp ne i32 %70, 0
br i1 %71, label %74, label %72
72: ; preds = %69
%73 = call i32 (...) @ding()
br label %74
74: ; preds = %72, %69
br label %126
75: ; preds = %0
%76 = call i32 (...) @undomove()
%77 = icmp ne i32 %76, 0
br i1 %77, label %80, label %78
78: ; preds = %75
%79 = call i32 (...) @ding()
br label %80
80: ; preds = %78, %75
br label %126
81: ; preds = %0
%82 = call i32 (...) @redomove()
%83 = icmp ne i32 %82, 0
br i1 %83, label %86, label %84
84: ; preds = %81
%85 = call i32 (...) @ding()
br label %86
86: ; preds = %84, %81
br label %126
87: ; preds = %0
%88 = call i32 (...) @undostep()
%89 = icmp ne i32 %88, 0
br i1 %89, label %92, label %90
90: ; preds = %87
%91 = call i32 (...) @ding()
br label %92
92: ; preds = %90, %87
br label %126
93: ; preds = %0
%94 = call i32 (...) @redostep()
%95 = icmp ne i32 %94, 0
br i1 %95, label %98, label %96
96: ; preds = %93
%97 = call i32 (...) @ding()
br label %98
98: ; preds = %96, %93
br label %126
99: ; preds = %0
%100 = call i32 (...) @initgamestate()
br label %126
101: ; preds = %0
%102 = call i32 (...) @savestate()
br label %126
103: ; preds = %0
%104 = call i32 (...) @restorestate()
%105 = icmp ne i32 %104, 0
br i1 %105, label %108, label %106
106: ; preds = %103
%107 = call i32 (...) @ding()
br label %108
108: ; preds = %106, %103
br label %126
109: ; preds = %0
%110 = call i32 (...) @partialsave()
%111 = icmp ne i32 %110, 0
br i1 %111, label %114, label %112
112: ; preds = %109
%113 = call i32 (...) @ding()
br label %114
114: ; preds = %112, %109
br label %126
115: ; preds = %0
%116 = call i32 (...) @drawgoalscreen()
br label %126
117: ; preds = %0
%118 = call i32 (...) @drawhelpscreen()
br label %126
119: ; preds = %0
br label %126
120: ; preds = %0
store i32 -1, i32* %1
br label %127
121: ; preds = %0
store i32 1, i32* %1
br label %127
122: ; preds = %0
%123 = call i32 @exit(i32 0)
unreachable
124: ; preds = %0
%125 = call i32 @exit(i32 0)
unreachable
126: ; preds = %0, %119, %117, %115, %114, %108, %101, %99, %98, %92, %86, %80, %74, %68, %62, %56, %50, %44, %38, %32, %26, %20, %14, %8
store i32 0, i32* %1
br label %127
127: ; preds = %126, %121, %120
%128 = load i32, i32* %1
ret i32 %128
}

LLVM IR (-O2):
define i32 @doturn() {
%1 = tail call i32 (...) @input()
switch i32 %1, label %105 [
i32 1024, label %2
i32 1025, label %7
i32 1026, label %12
i32 1027, label %17
i32 107, label %22
i32 108, label %27
i32 106, label %32
i32 104, label %37
i32 75, label %42
i32 76, label %47
i32 74, label %52
i32 72, label %57
i32 120, label %62
i32 122, label %67
i32 88, label %72
i32 90, label %77
i32 82, label %82
i32 115, label %84
i32 114, label %86
i32 83, label %91
i32 103, label %96
i32 63, label %98
i32 81, label %103
i32 80, label %106
i32 78, label %100
i32 113, label %101
]
2: ; preds = %0
%3 = tail call i32 @movecursor(i32 0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %105
5: ; preds = %2
%6 = tail call i32 (...) @ding()
br label %105
7: ; preds = %0
%8 = tail call i32 @movecursor(i32 1)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %105
10: ; preds = %7
%11 = tail call i32 (...) @ding()
br label %105
12: ; preds = %0
%13 = tail call i32 @movecursor(i32 2)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %105
15: ; preds = %12
%16 = tail call i32 (...) @ding()
br label %105
17: ; preds = %0
%18 = tail call i32 @movecursor(i32 3)
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %105
20: ; preds = %17
%21 = tail call i32 (...) @ding()
br label %105
22: ; preds = %0
%23 = tail call i32 @shiftfromcurrblock(i32 0)
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %105
25: ; preds = %22
%26 = tail call i32 (...) @ding()
br label %105
27: ; preds = %0
%28 = tail call i32 @shiftfromcurrblock(i32 1)
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %105
30: ; preds = %27
%31 = tail call i32 (...) @ding()
br label %105
32: ; preds = %0
%33 = tail call i32 @shiftfromcurrblock(i32 2)
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %105
35: ; preds = %32
%36 = tail call i32 (...) @ding()
br label %105
37: ; preds = %0
%38 = tail call i32 @shiftfromcurrblock(i32 3)
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %105
40: ; preds = %37
%41 = tail call i32 (...) @ding()
br label %105
42: ; preds = %0
%43 = tail call i32 @newmove(i32 0)
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %105
45: ; preds = %42
%46 = tail call i32 (...) @ding()
br label %105
47: ; preds = %0
%48 = tail call i32 @newmove(i32 1)
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %105
50: ; preds = %47
%51 = tail call i32 (...) @ding()
br label %105
52: ; preds = %0
%53 = tail call i32 @newmove(i32 2)
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %105
55: ; preds = %52
%56 = tail call i32 (...) @ding()
br label %105
57: ; preds = %0
%58 = tail call i32 @newmove(i32 3)
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %105
60: ; preds = %57
%61 = tail call i32 (...) @ding()
br label %105
62: ; preds = %0
%63 = tail call i32 (...) @undomove()
%64 = icmp eq i32 %63, 0
br i1 %64, label %65, label %105
65: ; preds = %62
%66 = tail call i32 (...) @ding()
br label %105
67: ; preds = %0
%68 = tail call i32 (...) @redomove()
%69 = icmp eq i32 %68, 0
br i1 %69, label %70, label %105
70: ; preds = %67
%71 = tail call i32 (...) @ding()
br label %105
72: ; preds = %0
%73 = tail call i32 (...) @undostep()
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %105
75: ; preds = %72
%76 = tail call i32 (...) @ding()
br label %105
77: ; preds = %0
%78 = tail call i32 (...) @redostep()
%79 = icmp eq i32 %78, 0
br i1 %79, label %80, label %105
80: ; preds = %77
%81 = tail call i32 (...) @ding()
br label %105
82: ; preds = %0
%83 = tail call i32 (...) @initgamestate()
br label %105
84: ; preds = %0
%85 = tail call i32 (...) @savestate()
br label %105
86: ; preds = %0
%87 = tail call i32 (...) @restorestate()
%88 = icmp eq i32 %87, 0
br i1 %88, label %89, label %105
89: ; preds = %86
%90 = tail call i32 (...) @ding()
br label %105
91: ; preds = %0
%92 = tail call i32 (...) @partialsave()
%93 = icmp eq i32 %92, 0
br i1 %93, label %94, label %105
94: ; preds = %91
%95 = tail call i32 (...) @ding()
br label %105
96: ; preds = %0
%97 = tail call i32 (...) @drawgoalscreen()
br label %105
98: ; preds = %0
%99 = tail call i32 (...) @drawhelpscreen()
br label %105
100: ; preds = %0
br label %106
101: ; preds = %0
%102 = tail call i32 @exit(i32 0)
unreachable
103: ; preds = %0
%104 = tail call i32 @exit(i32 0)
unreachable
105: ; preds = %91, %94, %86, %89, %77, %80, %72, %75, %67, %70, %62, %65, %57, %60, %52, %55, %47, %50, %42, %45, %37, %40, %32, %35, %27, %30, %22, %25, %17, %20, %12, %15, %7, %10, %2, %5, %0, %98, %96, %84, %82
br label %106
106: ; preds = %0, %105, %100
%107 = phi i32 [ 0, %105 ], [ 1, %100 ], [ -1, %0 ]
ret i32 %107
}