#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 KEY_DOWN;
int KEY_LEFT;
int KEY_RIGHT;
int KEY_UP;
int /*<<< orphan*/ beep();
int game_scene_get_flag(int **, char **, int, int /*<<< orphan*/, int *, int *);
int game_scene_open(int **, char **, int, int *, char, int);
int game_scene_print_face(char **, int, int, int, char, int, int /*<<< orphan*/,
                          int);
int getch();
int getyx(int /*<<< orphan*/, char, int);
int move(char, int);
int refresh();
int /*<<< orphan*/ stdscr;
void game_scene_control(int **ans, char **face, int size, int flag, int steps,
                        int running, int cmd, char currentv, int currenth) {
  while (running) {
    while (cmd = getch(), 0) {
    }
    while (getyx(stdscr, currentv, currenth), 0) {
    }
    if (cmd == KEY_LEFT && (currenth > (0 + 6) || (beep(), 0))) {
      while (move(currentv, currenth - 4), 0) {
      }
      while (refresh(), 0) {
      }
    }
    if (cmd == KEY_RIGHT &&
        (currenth < (0 + 6) + 4 * (size - 1) || (beep(), 0))) {
      while (move(currentv, currenth + 4), 0) {
      }
      while (refresh(), 0) {
      }
    }
    if (cmd == KEY_UP && (currentv > (0 + 6 + 3) || (beep(), 0))) {
      while (move(currentv - 2, currenth), 0) {
      }
      while (refresh(), 0) {
      }
    }
    if (cmd == KEY_DOWN &&
        (currentv < (0 + 6 + 3) + 2 * (size - 1) || (beep(), 0))) {
      while (move(currentv + 2, currenth), 0) {
      }
      while (refresh(), 0) {
      }
    }
    if (cmd == ' ' || cmd == 'o' || cmd == 'O') {
      if (face[(currentv - (0 + 6 + 3)) / 2][(currenth - (0 + 6)) / 4] == '`' ||
          (beep(), 0)) {
        while (game_scene_open(ans, face, size, &running,
                               (currentv - (0 + 6 + 3)) / 2,
                               (currenth - (0 + 6)) / 4),
               0) {
        }
        while (steps++, 0) {
        }
        while (getyx(stdscr, currentv, currenth), 0) {
        }
        while (game_scene_get_flag(ans, face, size, 0, &flag, &running), 0) {
        }
        while (game_scene_print_face(face, size, flag, steps, currentv,
                                     currenth, 0, running),
               0) {
        }
      }
    }
    if ((cmd == 'f' || cmd == 'F') &&
        (face[(currentv - (0 + 6 + 3)) / 2][(currenth - (0 + 6)) / 4] == '`' ||
         (beep(), 0))) {
      while (face[(currentv - (0 + 6 + 3)) / 2][(currenth - (0 + 6)) / 4] = 'F',
             0) {
      }
      while (getyx(stdscr, currentv, currenth), 0) {
      }
      while (game_scene_get_flag(ans, face, size, 0, &flag, &running), 0) {
      }
      while (game_scene_print_face(face, size, flag, steps, currentv, currenth,
                                   0, running),
             0) {
      }
    }
    if ((cmd == 'u' || cmd == 'U') &&
        (face[(currentv - (0 + 6 + 3)) / 2][(currenth - (0 + 6)) / 4] == 'F' ||
         (beep(), 0))) {
      while (face[(currentv - (0 + 6 + 3)) / 2][(currenth - (0 + 6)) / 4] = '`',
             0) {
      }
      while (getyx(stdscr, currentv, currenth), 0) {
      }
      while (game_scene_get_flag(ans, face, size, 0, &flag, &running), 0) {
      }
      while (game_scene_print_face(face, size, flag, steps, currentv, currenth,
                                   0, running),
             0) {
      }
    }
    while ((cmd != KEY_UP && cmd != KEY_DOWN && cmd != KEY_LEFT &&
            cmd != KEY_RIGHT && cmd != ' ' && cmd != 'o' && cmd != 'O' &&
            cmd != 'f' && cmd != 'F' && cmd != 'u' && cmd != 'U') &&
               (beep(), 0),
           0) {
    }
  }
  while (!running) {
    while (cmd = getch(), 0) {
    }
    if (cmd == 'q' || cmd == 'Q') {
      while (running = 1, 0) {
      }
    }
  }
}


x86 assembly (clang, -O0):
<game_scene_control>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%al
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     19d5 <game_scene_control+0x855>
jmp    11b9 <game_scene_control+0x39>
mov    $0x0,%al
call   1080 <getch@plt>
mov    %eax,0x10(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    11d2 <game_scene_control+0x52>
jmp    11d7 <game_scene_control+0x57>
jmp    11b9 <game_scene_control+0x39>
jmp    11dc <game_scene_control+0x5c>
mov    0x2df5(%rip),%rax
mov    (%rax),%edi
mov    0x18(%rbp),%al
mov    0x20(%rbp),%edx
movsbl %al,%esi
call   1030 <getyx@plt>
xor    %eax,%eax
test   $0x1,%al
jne    1202 <game_scene_control+0x82>
jmp    1207 <game_scene_control+0x87>
jmp    11dc <game_scene_control+0x5c>
mov    0x10(%rbp),%eax
mov    0x2daf(%rip),%rcx
cmp    (%rcx),%eax
jne    1288 <game_scene_control+0x108>
cmpl   $0x6,0x20(%rbp)
jg     1239 <game_scene_control+0xb9>
mov    $0x0,%al
call   1050 <beep@plt>
xor    %eax,%eax
test   $0x1,%al
jne    1239 <game_scene_control+0xb9>
jmp    1288 <game_scene_control+0x108>
jmp    123e <game_scene_control+0xbe>
mov    0x18(%rbp),%al
mov    0x20(%rbp),%esi
sub    $0x4,%esi
movsbl %al,%edi
call   10a0 <move@plt>
xor    %eax,%eax
test   $0x1,%al
jne    125e <game_scene_control+0xde>
jmp    1263 <game_scene_control+0xe3>
jmp    123e <game_scene_control+0xbe>
jmp    1268 <game_scene_control+0xe8>
mov    $0x0,%al
call   1070 <refresh@plt>
xor    %eax,%eax
test   $0x1,%al
jne    127e <game_scene_control+0xfe>
jmp    1283 <game_scene_control+0x103>
jmp    1268 <game_scene_control+0xe8>
jmp    1288 <game_scene_control+0x108>
mov    0x10(%rbp),%eax
mov    0x2d36(%rip),%rcx
cmp    (%rcx),%eax
jne    1316 <game_scene_control+0x196>
mov    0x20(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x2,%ecx
add    $0x6,%ecx
cmp    %ecx,%eax
jl     12c7 <game_scene_control+0x147>
mov    $0x0,%al
call   1050 <beep@plt>
xor    %eax,%eax
test   $0x1,%al
jne    12c7 <game_scene_control+0x147>
jmp    1316 <game_scene_control+0x196>
jmp    12cc <game_scene_control+0x14c>
mov    0x18(%rbp),%al
mov    0x20(%rbp),%esi
add    $0x4,%esi
movsbl %al,%edi
call   10a0 <move@plt>
xor    %eax,%eax
test   $0x1,%al
jne    12ec <game_scene_control+0x16c>
jmp    12f1 <game_scene_control+0x171>
jmp    12cc <game_scene_control+0x14c>
jmp    12f6 <game_scene_control+0x176>
mov    $0x0,%al
call   1070 <refresh@plt>
xor    %eax,%eax
test   $0x1,%al
jne    130c <game_scene_control+0x18c>
jmp    1311 <game_scene_control+0x191>
jmp    12f6 <game_scene_control+0x176>
jmp    1316 <game_scene_control+0x196>
mov    0x10(%rbp),%eax
mov    0x2cc0(%rip),%rcx
cmp    (%rcx),%eax
jne    139b <game_scene_control+0x21b>
movsbl 0x18(%rbp),%eax
cmp    $0x9,%eax
jg     134b <game_scene_control+0x1cb>
mov    $0x0,%al
call   1050 <beep@plt>
xor    %eax,%eax
test   $0x1,%al
jne    134b <game_scene_control+0x1cb>
jmp    139b <game_scene_control+0x21b>
jmp    1350 <game_scene_control+0x1d0>
movsbl 0x18(%rbp),%eax
sub    $0x2,%eax
mov    0x20(%rbp),%esi
movsbl %al,%edi
call   10a0 <move@plt>
xor    %eax,%eax
test   $0x1,%al
jne    1371 <game_scene_control+0x1f1>
jmp    1376 <game_scene_control+0x1f6>
jmp    1350 <game_scene_control+0x1d0>
jmp    137b <game_scene_control+0x1fb>
mov    $0x0,%al
call   1070 <refresh@plt>
xor    %eax,%eax
test   $0x1,%al
jne    1391 <game_scene_control+0x211>
jmp    1396 <game_scene_control+0x216>
jmp    137b <game_scene_control+0x1fb>
jmp    139b <game_scene_control+0x21b>
mov    0x10(%rbp),%eax
mov    0x2c43(%rip),%rcx
cmp    (%rcx),%eax
jne    142b <game_scene_control+0x2ab>
movsbl 0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x1,%ecx
add    $0x9,%ecx
cmp    %ecx,%eax
jl     13db <game_scene_control+0x25b>
mov    $0x0,%al
call   1050 <beep@plt>
xor    %eax,%eax
test   $0x1,%al
jne    13db <game_scene_control+0x25b>
jmp    142b <game_scene_control+0x2ab>
jmp    13e0 <game_scene_control+0x260>
movsbl 0x18(%rbp),%eax
add    $0x2,%eax
mov    0x20(%rbp),%esi
movsbl %al,%edi
call   10a0 <move@plt>
xor    %eax,%eax
test   $0x1,%al
jne    1401 <game_scene_control+0x281>
jmp    1406 <game_scene_control+0x286>
jmp    13e0 <game_scene_control+0x260>
jmp    140b <game_scene_control+0x28b>
mov    $0x0,%al
call   1070 <refresh@plt>
xor    %eax,%eax
test   $0x1,%al
jne    1421 <game_scene_control+0x2a1>
jmp    1426 <game_scene_control+0x2a6>
jmp    140b <game_scene_control+0x28b>
jmp    142b <game_scene_control+0x2ab>
cmpl   $0x20,0x10(%rbp)
je     1449 <game_scene_control+0x2c9>
cmpl   $0x6f,0x10(%rbp)
je     1449 <game_scene_control+0x2c9>
cmpl   $0x4f,0x10(%rbp)
jne    15df <game_scene_control+0x45f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
movsbl 0x18(%rbp),%eax
sub    $0x9,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
mov    0x20(%rbp),%eax
sub    $0x6,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x60,%eax
je     14ab <game_scene_control+0x32b>
mov    $0x0,%al
call   1050 <beep@plt>
xor    %eax,%eax
test   $0x1,%al
jne    14ab <game_scene_control+0x32b>
jmp    15da <game_scene_control+0x45a>
jmp    14b0 <game_scene_control+0x330>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
mov    %eax,-0x38(%rbp)
movsbl 0x18(%rbp),%eax
sub    $0x9,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %al,-0x31(%rbp)
mov    0x20(%rbp),%eax
sub    $0x6,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0x38(%rbp),%edx
mov    %eax,%r9d
mov    -0x31(%rbp),%al
lea    -0x20(%rbp),%rcx
movsbl %al,%r8d
call   1040 <game_scene_open@plt>
xor    %eax,%eax
test   $0x1,%al
jne    1503 <game_scene_control+0x383>
jmp    1508 <game_scene_control+0x388>
jmp    14b0 <game_scene_control+0x330>
jmp    150d <game_scene_control+0x38d>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1525 <game_scene_control+0x3a5>
jmp    152a <game_scene_control+0x3aa>
jmp    150d <game_scene_control+0x38d>
jmp    152f <game_scene_control+0x3af>
mov    0x2aa2(%rip),%rax
mov    (%rax),%edi
mov    0x18(%rbp),%al
mov    0x20(%rbp),%edx
movsbl %al,%esi
call   1030 <getyx@plt>
xor    %eax,%eax
test   $0x1,%al
jne    1555 <game_scene_control+0x3d5>
jmp    155a <game_scene_control+0x3da>
jmp    152f <game_scene_control+0x3af>
jmp    155f <game_scene_control+0x3df>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
lea    -0x18(%rbp),%r8
lea    -0x20(%rbp),%r9
call   1090 <game_scene_get_flag@plt>
xor    %eax,%eax
test   $0x1,%al
jne    1588 <game_scene_control+0x408>
jmp    158d <game_scene_control+0x40d>
jmp    155f <game_scene_control+0x3df>
jmp    1592 <game_scene_control+0x412>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    0x18(%rbp),%r8b
mov    0x20(%rbp),%r9d
mov    -0x20(%rbp),%eax
xor    %r10d,%r10d
movsbl %r8b,%r8d
movl   $0x0,(%rsp)
mov    %eax,0x8(%rsp)
call   1060 <game_scene_print_face@plt>
xor    %eax,%eax
test   $0x1,%al
jne    15d0 <game_scene_control+0x450>
jmp    15d5 <game_scene_control+0x455>
jmp    1592 <game_scene_control+0x412>
jmp    15da <game_scene_control+0x45a>
jmp    15df <game_scene_control+0x45f>
cmpl   $0x66,0x10(%rbp)
je     15f3 <game_scene_control+0x473>
cmpl   $0x46,0x10(%rbp)
jne    1761 <game_scene_control+0x5e1>
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
movsbl 0x18(%rbp),%eax
sub    $0x9,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x48(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x40(%rbp)
mov    0x20(%rbp),%eax
sub    $0x6,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x40(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x60,%eax
je     1655 <game_scene_control+0x4d5>
mov    $0x0,%al
call   1050 <beep@plt>
xor    %eax,%eax
test   $0x1,%al
jne    1655 <game_scene_control+0x4d5>
jmp    1761 <game_scene_control+0x5e1>
jmp    165a <game_scene_control+0x4da>
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
movsbl 0x18(%rbp),%eax
sub    $0x9,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x50(%rbp)
mov    0x20(%rbp),%eax
sub    $0x6,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
movb   $0x46,(%rax,%rcx,1)
xor    %eax,%eax
test   $0x1,%al
jne    16ac <game_scene_control+0x52c>
jmp    16b1 <game_scene_control+0x531>
jmp    165a <game_scene_control+0x4da>
jmp    16b6 <game_scene_control+0x536>
mov    0x291b(%rip),%rax
mov    (%rax),%edi
mov    0x18(%rbp),%al
mov    0x20(%rbp),%edx
movsbl %al,%esi
call   1030 <getyx@plt>
xor    %eax,%eax
test   $0x1,%al
jne    16dc <game_scene_control+0x55c>
jmp    16e1 <game_scene_control+0x561>
jmp    16b6 <game_scene_control+0x536>
jmp    16e6 <game_scene_control+0x566>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
lea    -0x18(%rbp),%r8
lea    -0x20(%rbp),%r9
call   1090 <game_scene_get_flag@plt>
xor    %eax,%eax
test   $0x1,%al
jne    170f <game_scene_control+0x58f>
jmp    1714 <game_scene_control+0x594>
jmp    16e6 <game_scene_control+0x566>
jmp    1719 <game_scene_control+0x599>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    0x18(%rbp),%r8b
mov    0x20(%rbp),%r9d
mov    -0x20(%rbp),%eax
xor    %r10d,%r10d
movsbl %r8b,%r8d
movl   $0x0,(%rsp)
mov    %eax,0x8(%rsp)
call   1060 <game_scene_print_face@plt>
xor    %eax,%eax
test   $0x1,%al
jne    1757 <game_scene_control+0x5d7>
jmp    175c <game_scene_control+0x5dc>
jmp    1719 <game_scene_control+0x599>
jmp    1761 <game_scene_control+0x5e1>
cmpl   $0x75,0x10(%rbp)
je     1775 <game_scene_control+0x5f5>
cmpl   $0x55,0x10(%rbp)
jne    18e3 <game_scene_control+0x763>
mov    -0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
movsbl 0x18(%rbp),%eax
sub    $0x9,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x68(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x60(%rbp)
mov    0x20(%rbp),%eax
sub    $0x6,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x60(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x46,%eax
je     17d7 <game_scene_control+0x657>
mov    $0x0,%al
call   1050 <beep@plt>
xor    %eax,%eax
test   $0x1,%al
jne    17d7 <game_scene_control+0x657>
jmp    18e3 <game_scene_control+0x763>
jmp    17dc <game_scene_control+0x65c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x78(%rbp)
movsbl 0x18(%rbp),%eax
sub    $0x9,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x78(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x70(%rbp)
mov    0x20(%rbp),%eax
sub    $0x6,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x70(%rbp),%rax
movslq %ecx,%rcx
movb   $0x60,(%rax,%rcx,1)
xor    %eax,%eax
test   $0x1,%al
jne    182e <game_scene_control+0x6ae>
jmp    1833 <game_scene_control+0x6b3>
jmp    17dc <game_scene_control+0x65c>
jmp    1838 <game_scene_control+0x6b8>
mov    0x2799(%rip),%rax
mov    (%rax),%edi
mov    0x18(%rbp),%al
mov    0x20(%rbp),%edx
movsbl %al,%esi
call   1030 <getyx@plt>
xor    %eax,%eax
test   $0x1,%al
jne    185e <game_scene_control+0x6de>
jmp    1863 <game_scene_control+0x6e3>
jmp    1838 <game_scene_control+0x6b8>
jmp    1868 <game_scene_control+0x6e8>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
lea    -0x18(%rbp),%r8
lea    -0x20(%rbp),%r9
call   1090 <game_scene_get_flag@plt>
xor    %eax,%eax
test   $0x1,%al
jne    1891 <game_scene_control+0x711>
jmp    1896 <game_scene_control+0x716>
jmp    1868 <game_scene_control+0x6e8>
jmp    189b <game_scene_control+0x71b>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    0x18(%rbp),%r8b
mov    0x20(%rbp),%r9d
mov    -0x20(%rbp),%eax
xor    %r10d,%r10d
movsbl %r8b,%r8d
movl   $0x0,(%rsp)
mov    %eax,0x8(%rsp)
call   1060 <game_scene_print_face@plt>
xor    %eax,%eax
test   $0x1,%al
jne    18d9 <game_scene_control+0x759>
jmp    18de <game_scene_control+0x75e>
jmp    189b <game_scene_control+0x71b>
jmp    18e3 <game_scene_control+0x763>
jmp    18e8 <game_scene_control+0x768>
mov    0x10(%rbp),%ecx
xor    %eax,%eax
mov    0x26ec(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x79(%rbp)
je     19b9 <game_scene_control+0x839>
mov    0x10(%rbp),%ecx
xor    %eax,%eax
mov    0x26dd(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x79(%rbp)
je     19b9 <game_scene_control+0x839>
mov    0x10(%rbp),%ecx
xor    %eax,%eax
mov    0x269e(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x79(%rbp)
je     19b9 <game_scene_control+0x839>
mov    0x10(%rbp),%ecx
xor    %eax,%eax
mov    0x268f(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x79(%rbp)
je     19b9 <game_scene_control+0x839>
xor    %eax,%eax
cmpl   $0x20,0x10(%rbp)
mov    %al,-0x79(%rbp)
je     19b9 <game_scene_control+0x839>
xor    %eax,%eax
cmpl   $0x6f,0x10(%rbp)
mov    %al,-0x79(%rbp)
je     19b9 <game_scene_control+0x839>
xor    %eax,%eax
cmpl   $0x4f,0x10(%rbp)
mov    %al,-0x79(%rbp)
je     19b9 <game_scene_control+0x839>
xor    %eax,%eax
cmpl   $0x66,0x10(%rbp)
mov    %al,-0x79(%rbp)
je     19b9 <game_scene_control+0x839>
xor    %eax,%eax
cmpl   $0x46,0x10(%rbp)
mov    %al,-0x79(%rbp)
je     19b9 <game_scene_control+0x839>
xor    %eax,%eax
cmpl   $0x75,0x10(%rbp)
mov    %al,-0x79(%rbp)
je     19b9 <game_scene_control+0x839>
xor    %eax,%eax
cmpl   $0x55,0x10(%rbp)
mov    %al,-0x79(%rbp)
je     19b9 <game_scene_control+0x839>
mov    $0x0,%al
call   1050 <beep@plt>
xor    %eax,%eax
mov    %al,-0x79(%rbp)
mov    -0x79(%rbp),%al
xor    %eax,%eax
test   $0x1,%al
jne    19cb <game_scene_control+0x84b>
jmp    19d0 <game_scene_control+0x850>
jmp    18e8 <game_scene_control+0x768>
jmp    11aa <game_scene_control+0x2a>
jmp    19da <game_scene_control+0x85a>
cmpl   $0x0,-0x20(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    19f0 <game_scene_control+0x870>
jmp    1a51 <game_scene_control+0x8d1>
jmp    19f5 <game_scene_control+0x875>
mov    $0x0,%al
call   1080 <getch@plt>
mov    %eax,0x10(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1a0e <game_scene_control+0x88e>
jmp    1a13 <game_scene_control+0x893>
jmp    19f5 <game_scene_control+0x875>
cmpl   $0x71,0x10(%rbp)
je     1a27 <game_scene_control+0x8a7>
cmpl   $0x51,0x10(%rbp)
jne    1a4c <game_scene_control+0x8cc>
jmp    1a2c <game_scene_control+0x8ac>
movl   $0x1,-0x20(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1a42 <game_scene_control+0x8c2>
jmp    1a47 <game_scene_control+0x8c7>
jmp    1a2c <game_scene_control+0x8ac>
jmp    1a4c <game_scene_control+0x8cc>
jmp    19da <game_scene_control+0x85a>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<game_scene_control>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r8d,0x14(%rsp)
mov    %rdx,0x18(%rsp)
mov    %rdi,0x28(%rsp)
mov    %ecx,0x10(%rsp)
mov    %r9d,0xc(%rsp)
test   %r9d,%r9d
je     1567 <game_scene_control+0x3e7>
mov    %rsi,%r14
mov    0xb0(%rsp),%ebp
mov    0xa8(%rsp),%cl
lea    -0x4(%rbp),%eax
mov    %eax,0x40(%rsp)
mov    0x18(%rsp),%rax
lea    0x2(,%rax,4),%edx
mov    %edx,0x4c(%rsp)
lea    0x4(%rbp),%edx
mov    %edx,0x3c(%rsp)
lea    -0x2(%rcx),%edx
mov    %edx,0x38(%rsp)
movsbl %cl,%r12d
lea    0x7(%rax,%rax,1),%eax
mov    %eax,0x48(%rsp)
lea    0x2(%r12),%eax
mov    %eax,0x34(%rsp)
lea    -0x9(%r12),%eax
movzwl %ax,%eax
mov    %eax,%ecx
shr    $0xf,%ecx
add    %eax,%ecx
movswl %cx,%eax
sar    %eax
movslq %eax,%r13
lea    -0x6(%rbp),%eax
lea    -0x3(%rbp),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x2,%ecx
mov    %ecx,0x44(%rsp)
movslq %ecx,%rbx
mov    %rsi,0x60(%rsp)
mov    %r13,0x58(%rsp)
mov    %rbx,0x20(%rsp)
mov    %r12,0x50(%rsp)
jmp    126b <game_scene_control+0xeb>
nopl   0x0(%rax)
movabs $0x820100008201,%rcx
bt     %rax,%rcx
jae    1544 <game_scene_control+0x3c4>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpl   $0x0,0xc(%rsp)
je     1567 <game_scene_control+0x3e7>
xor    %eax,%eax
call   1080 <getch@plt>
mov    %eax,%r15d
mov    0x2d5c(%rip),%rax
mov    (%rax),%edi
mov    %r12d,%esi
mov    %ebp,%edx
call   1030 <getyx@plt>
mov    0x2d31(%rip),%rax
cmp    (%rax),%r15d
jne    12b7 <game_scene_control+0x137>
cmp    $0x6,%ebp
jle    12b0 <game_scene_control+0x130>
mov    %r12d,%edi
mov    0x40(%rsp),%esi
call   10a0 <move@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
jmp    12b7 <game_scene_control+0x137>
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <beep@plt>
mov    0x2d0a(%rip),%rax
cmp    (%rax),%r15d
jne    12e7 <game_scene_control+0x167>
cmp    %ebp,0x4c(%rsp)
jle    12e0 <game_scene_control+0x160>
mov    %r12d,%edi
mov    0x3c(%rsp),%esi
call   10a0 <move@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
jmp    12e7 <game_scene_control+0x167>
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <beep@plt>
mov    0x2cf2(%rip),%rax
cmp    (%rax),%r15d
jne    1327 <game_scene_control+0x1a7>
movzbl 0xa8(%rsp),%eax
cmp    $0x9,%al
jle    1320 <game_scene_control+0x1a0>
movsbl 0x38(%rsp),%edi
mov    %ebp,%esi
call   10a0 <move@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
jmp    1327 <game_scene_control+0x1a7>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <beep@plt>
mov    0x2cba(%rip),%rax
cmp    (%rax),%r15d
jne    134d <game_scene_control+0x1cd>
cmp    %r12d,0x48(%rsp)
jle    1370 <game_scene_control+0x1f0>
movsbl 0x34(%rsp),%edi
mov    %ebp,%esi
call   10a0 <move@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
cmp    $0x20,%r15d
je     1380 <game_scene_control+0x200>
cmp    $0x6f,%r15d
je     1380 <game_scene_control+0x200>
cmp    $0x4f,%r15d
je     1380 <game_scene_control+0x200>
jmp    1437 <game_scene_control+0x2b7>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <beep@plt>
cmp    $0x20,%r15d
jne    1353 <game_scene_control+0x1d3>
nopl   (%rax)
mov    (%r14,%r13,8),%rax
cmpb   $0x60,(%rax,%rbx,1)
jne    1430 <game_scene_control+0x2b0>
movsbl %r13b,%r8d
mov    0x28(%rsp),%r13
mov    %r13,%rdi
mov    %r14,%rsi
mov    0x18(%rsp),%r12
mov    %r12d,%edx
lea    0xc(%rsp),%rcx
mov    0x44(%rsp),%r9d
call   1040 <game_scene_open@plt>
mov    %r14,%rbx
mov    0x14(%rsp),%r14d
add    $0x1,%r14d
mov    0x2c11(%rip),%rax
mov    (%rax),%edi
mov    0x50(%rsp),%rsi
mov    %ebp,%edx
call   1030 <getyx@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %r12d,%edx
xor    %ecx,%ecx
lea    0x10(%rsp),%r8
lea    0xc(%rsp),%r9
call   1090 <game_scene_get_flag@plt>
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%eax
mov    %rbx,%rdi
mov    0x20(%rsp),%rbx
mov    %r12d,%esi
mov    0x50(%rsp),%r12
mov    %r14d,0x14(%rsp)
mov    %r14d,%ecx
mov    %r12d,%r8d
mov    %ebp,%r9d
push   %rax
push   $0x0
call   1060 <game_scene_print_face@plt>
add    $0x10,%rsp
jmp    1437 <game_scene_control+0x2b7>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1050 <beep@plt>
mov    %r15d,%eax
and    $0xffffffdf,%eax
cmp    $0x55,%eax
je     1470 <game_scene_control+0x2f0>
cmp    $0x46,%eax
mov    0x60(%rsp),%r14
mov    0x58(%rsp),%r13
jne    14f7 <game_scene_control+0x377>
mov    (%r14,%r13,8),%rax
cmpb   $0x60,(%rax,%rbx,1)
jne    14f0 <game_scene_control+0x370>
movb   $0x46,(%rax,%rbx,1)
jmp    1488 <game_scene_control+0x308>
nopl   0x0(%rax)
mov    0x60(%rsp),%r14
mov    0x58(%rsp),%r13
mov    (%r14,%r13,8),%rax
cmpb   $0x46,(%rax,%rbx,1)
jne    14f0 <game_scene_control+0x370>
movb   $0x60,(%rax,%rbx,1)
mov    0x2b49(%rip),%rax
mov    (%rax),%edi
mov    %r12d,%esi
mov    %ebp,%edx
call   1030 <getyx@plt>
mov    0x28(%rsp),%rdi
mov    %r14,%rsi
mov    0x18(%rsp),%rbx
mov    %ebx,%edx
xor    %ecx,%ecx
lea    0x10(%rsp),%r8
lea    0xc(%rsp),%r9
call   1090 <game_scene_get_flag@plt>
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%eax
mov    %r14,%rdi
mov    %ebx,%esi
mov    0x20(%rsp),%rbx
mov    0x14(%rsp),%ecx
mov    %r12d,%r8d
mov    %ebp,%r9d
push   %rax
push   $0x0
call   1060 <game_scene_print_face@plt>
add    $0x10,%rsp
jmp    14f7 <game_scene_control+0x377>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1050 <beep@plt>
mov    0x2ae2(%rip),%rax
cmp    (%rax),%r15d
je     1260 <game_scene_control+0xe0>
mov    0x2ada(%rip),%rax
cmp    (%rax),%r15d
je     1260 <game_scene_control+0xe0>
mov    0x2aa2(%rip),%rax
cmp    (%rax),%r15d
je     1260 <game_scene_control+0xe0>
mov    0x2a9a(%rip),%rax
cmp    (%rax),%r15d
je     1260 <game_scene_control+0xe0>
lea    -0x46(%r15),%eax
cmp    $0x2f,%eax
jbe    1240 <game_scene_control+0xc0>
cmp    $0x20,%r15d
je     1260 <game_scene_control+0xe0>
xor    %eax,%eax
call   1050 <beep@plt>
jmp    1260 <game_scene_control+0xe0>
nopw   0x0(%rax,%rax,1)
cmpl   $0x0,0xc(%rsp)
jne    157e <game_scene_control+0x3fe>
xor    %eax,%eax
call   1080 <getch@plt>
and    $0xffffffdf,%eax
cmp    $0x51,%eax
jne    1560 <game_scene_control+0x3e0>
movl   $0x1,0xc(%rsp)
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdscr = global i32 0
@KEY_LEFT = global i32 0
@KEY_RIGHT = global i32 0
@KEY_UP = global i32 0
@KEY_DOWN = global i32 0
define void @game_scene_control(i32** %0, i8** %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i8 signext %7, i32 %8) {
%10 = alloca i32**
%11 = alloca i8**
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i8
%18 = alloca i32
store i32** %0, i32*** %10
store i8** %1, i8*** %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i8 %7, i8* %17
store i32 %8, i32* %18
br label %19
19: ; preds = %384, %9
%20 = load i32, i32* %15
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %385
22: ; preds = %19
br label %23
23: ; preds = %25, %22
%24 = call i32 (...) @getch()
store i32 %24, i32* %16
br i1 false, label %25, label %26
25: ; preds = %23
br label %23
26: ; preds = %23
br label %27
27: ; preds = %32, %26
%28 = load i32, i32* @stdscr
%29 = load i8, i8* %17
%30 = load i32, i32* %18
%31 = call i32 @getyx(i32 %28, i8 signext %29, i32 %30)
br i1 false, label %32, label %33
32: ; preds = %27
br label %27
33: ; preds = %27
%34 = load i32, i32* %16
%35 = load i32, i32* @KEY_LEFT
%36 = icmp eq i32 %34, %35
br i1 %36, label %37, label %54
37: ; preds = %33
%38 = load i32, i32* %18
%39 = icmp sgt i32 %38, 6
br i1 %39, label %42, label %40
40: ; preds = %37
%41 = call i32 (...) @beep()
br i1 false, label %42, label %54
42: ; preds = %40, %37
br label %43
43: ; preds = %48, %42
%44 = load i8, i8* %17
%45 = load i32, i32* %18
%46 = sub nsw i32 %45, 4
%47 = call i32 @move(i8 signext %44, i32 %46)
br i1 false, label %48, label %49
48: ; preds = %43
br label %43
49: ; preds = %43
br label %50
50: ; preds = %52, %49
%51 = call i32 (...) @refresh()
br i1 false, label %52, label %53
52: ; preds = %50
br label %50
53: ; preds = %50
br label %54
54: ; preds = %53, %40, %33
%55 = load i32, i32* %16
%56 = load i32, i32* @KEY_RIGHT
%57 = icmp eq i32 %55, %56
br i1 %57, label %58, label %79
58: ; preds = %54
%59 = load i32, i32* %18
%60 = load i32, i32* %12
%61 = sub nsw i32 %60, 1
%62 = mul nsw i32 4, %61
%63 = add nsw i32 6, %62
%64 = icmp slt i32 %59, %63
br i1 %64, label %67, label %65
65: ; preds = %58
%66 = call i32 (...) @beep()
br i1 false, label %67, label %79
67: ; preds = %65, %58
br label %68
68: ; preds = %73, %67
%69 = load i8, i8* %17
%70 = load i32, i32* %18
%71 = add nsw i32 %70, 4
%72 = call i32 @move(i8 signext %69, i32 %71)
br i1 false, label %73, label %74
73: ; preds = %68
br label %68
74: ; preds = %68
br label %75
75: ; preds = %77, %74
%76 = call i32 (...) @refresh()
br i1 false, label %77, label %78
77: ; preds = %75
br label %75
78: ; preds = %75
br label %79
79: ; preds = %78, %65, %54
%80 = load i32, i32* %16
%81 = load i32, i32* @KEY_UP
%82 = icmp eq i32 %80, %81
br i1 %82, label %83, label %103
83: ; preds = %79
%84 = load i8, i8* %17
%85 = sext i8 %84 to i32
%86 = icmp sgt i32 %85, 9
br i1 %86, label %89, label %87
87: ; preds = %83
%88 = call i32 (...) @beep()
br i1 false, label %89, label %103
89: ; preds = %87, %83
br label %90
90: ; preds = %97, %89
%91 = load i8, i8* %17
%92 = sext i8 %91 to i32
%93 = sub nsw i32 %92, 2
%94 = trunc i32 %93 to i8
%95 = load i32, i32* %18
%96 = call i32 @move(i8 signext %94, i32 %95)
br i1 false, label %97, label %98
97: ; preds = %90
br label %90
98: ; preds = %90
br label %99
99: ; preds = %101, %98
%100 = call i32 (...) @refresh()
br i1 false, label %101, label %102
101: ; preds = %99
br label %99
102: ; preds = %99
br label %103
103: ; preds = %102, %87, %79
%104 = load i32, i32* %16
%105 = load i32, i32* @KEY_DOWN
%106 = icmp eq i32 %104, %105
br i1 %106, label %107, label %131
107: ; preds = %103
%108 = load i8, i8* %17
%109 = sext i8 %108 to i32
%110 = load i32, i32* %12
%111 = sub nsw i32 %110, 1
%112 = mul nsw i32 2, %111
%113 = add nsw i32 9, %112
%114 = icmp slt i32 %109, %113
br i1 %114, label %117, label %115
115: ; preds = %107
%116 = call i32 (...) @beep()
br i1 false, label %117, label %131
117: ; preds = %115, %107
br label %118
118: ; preds = %125, %117
%119 = load i8, i8* %17
%120 = sext i8 %119 to i32
%121 = add nsw i32 %120, 2
%122 = trunc i32 %121 to i8
%123 = load i32, i32* %18
%124 = call i32 @move(i8 signext %122, i32 %123)
br i1 false, label %125, label %126
125: ; preds = %118
br label %118
126: ; preds = %118
br label %127
127: ; preds = %129, %126
%128 = call i32 (...) @refresh()
br i1 false, label %129, label %130
129: ; preds = %127
br label %127
130: ; preds = %127
br label %131
131: ; preds = %130, %115, %103
%132 = load i32, i32* %16
%133 = icmp eq i32 %132, 32
br i1 %133, label %140, label %134
134: ; preds = %131
%135 = load i32, i32* %16
%136 = icmp eq i32 %135, 111
br i1 %136, label %140, label %137
137: ; preds = %134
%138 = load i32, i32* %16
%139 = icmp eq i32 %138, 79
br i1 %139, label %140, label %206
140: ; preds = %137, %134, %131
%141 = load i8**, i8*** %11
%142 = load i8, i8* %17
%143 = sext i8 %142 to i32
%144 = sub nsw i32 %143, 9
%145 = sdiv i32 %144, 2
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds i8*, i8** %141, i64 %146
%148 = load i8*, i8** %147
%149 = load i32, i32* %18
%150 = sub nsw i32 %149, 6
%151 = sdiv i32 %150, 4
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds i8, i8* %148, i64 %152
%154 = load i8, i8* %153
%155 = sext i8 %154 to i32
%156 = icmp eq i32 %155, 96
br i1 %156, label %159, label %157
157: ; preds = %140
%158 = call i32 (...) @beep()
br i1 false, label %159, label %205
159: ; preds = %157, %140
br label %160
160: ; preds = %173, %159
%161 = load i32**, i32*** %10
%162 = load i8**, i8*** %11
%163 = load i32, i32* %12
%164 = load i8, i8* %17
%165 = sext i8 %164 to i32
%166 = sub nsw i32 %165, 9
%167 = sdiv i32 %166, 2
%168 = trunc i32 %167 to i8
%169 = load i32, i32* %18
%170 = sub nsw i32 %169, 6
%171 = sdiv i32 %170, 4
%172 = call i32 @game_scene_open(i32** %161, i8** %162, i32 %163, i32* %15, i8 signext %168, i32 %171)
br i1 false, label %173, label %174
173: ; preds = %160
br label %160
174: ; preds = %160
br label %175
175: ; preds = %178, %174
%176 = load i32, i32* %14
%177 = add nsw i32 %176, 1
store i32 %177, i32* %14
br i1 false, label %178, label %179
178: ; preds = %175
br label %175
179: ; preds = %175
br label %180
180: ; preds = %185, %179
%181 = load i32, i32* @stdscr
%182 = load i8, i8* %17
%183 = load i32, i32* %18
%184 = call i32 @getyx(i32 %181, i8 signext %182, i32 %183)
br i1 false, label %185, label %186
185: ; preds = %180
br label %180
186: ; preds = %180
br label %187
187: ; preds = %192, %186
%188 = load i32**, i32*** %10
%189 = load i8**, i8*** %11
%190 = load i32, i32* %12
%191 = call i32 @game_scene_get_flag(i32** %188, i8** %189, i32 %190, i32 0, i32* %13, i32* %15)
br i1 false, label %192, label %193
192: ; preds = %187
br label %187
193: ; preds = %187
br label %194
194: ; preds = %203, %193
%195 = load i8**, i8*** %11
%196 = load i32, i32* %12
%197 = load i32, i32* %13
%198 = load i32, i32* %14
%199 = load i8, i8* %17
%200 = load i32, i32* %18
%201 = load i32, i32* %15
%202 = call i32 @game_scene_print_face(i8** %195, i32 %196, i32 %197, i32 %198, i8 signext %199, i32 %200, i32 0, i32 %201)
br i1 false, label %203, label %204
203: ; preds = %194
br label %194
204: ; preds = %194
br label %205
205: ; preds = %204, %157
br label %206
206: ; preds = %205, %137
%207 = load i32, i32* %16
%208 = icmp eq i32 %207, 102
br i1 %208, label %212, label %209
209: ; preds = %206
%210 = load i32, i32* %16
%211 = icmp eq i32 %210, 70
br i1 %211, label %212, label %273
212: ; preds = %209, %206
%213 = load i8**, i8*** %11
%214 = load i8, i8* %17
%215 = sext i8 %214 to i32
%216 = sub nsw i32 %215, 9
%217 = sdiv i32 %216, 2
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds i8*, i8** %213, i64 %218
%220 = load i8*, i8** %219
%221 = load i32, i32* %18
%222 = sub nsw i32 %221, 6
%223 = sdiv i32 %222, 4
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds i8, i8* %220, i64 %224
%226 = load i8, i8* %225
%227 = sext i8 %226 to i32
%228 = icmp eq i32 %227, 96
br i1 %228, label %231, label %229
229: ; preds = %212
%230 = call i32 (...) @beep()
br i1 false, label %231, label %273
231: ; preds = %229, %212
br label %232
232: ; preds = %246, %231
%233 = load i8**, i8*** %11
%234 = load i8, i8* %17
%235 = sext i8 %234 to i32
%236 = sub nsw i32 %235, 9
%237 = sdiv i32 %236, 2
%238 = sext i32 %237 to i64
%239 = getelementptr inbounds i8*, i8** %233, i64 %238
%240 = load i8*, i8** %239
%241 = load i32, i32* %18
%242 = sub nsw i32 %241, 6
%243 = sdiv i32 %242, 4
%244 = sext i32 %243 to i64
%245 = getelementptr inbounds i8, i8* %240, i64 %244
store i8 70, i8* %245
br i1 false, label %246, label %247
246: ; preds = %232
br label %232
247: ; preds = %232
br label %248
248: ; preds = %253, %247
%249 = load i32, i32* @stdscr
%250 = load i8, i8* %17
%251 = load i32, i32* %18
%252 = call i32 @getyx(i32 %249, i8 signext %250, i32 %251)
br i1 false, label %253, label %254
253: ; preds = %248
br label %248
254: ; preds = %248
br label %255
255: ; preds = %260, %254
%256 = load i32**, i32*** %10
%257 = load i8**, i8*** %11
%258 = load i32, i32* %12
%259 = call i32 @game_scene_get_flag(i32** %256, i8** %257, i32 %258, i32 0, i32* %13, i32* %15)
br i1 false, label %260, label %261
260: ; preds = %255
br label %255
261: ; preds = %255
br label %262
262: ; preds = %271, %261
%263 = load i8**, i8*** %11
%264 = load i32, i32* %12
%265 = load i32, i32* %13
%266 = load i32, i32* %14
%267 = load i8, i8* %17
%268 = load i32, i32* %18
%269 = load i32, i32* %15
%270 = call i32 @game_scene_print_face(i8** %263, i32 %264, i32 %265, i32 %266, i8 signext %267, i32 %268, i32 0, i32 %269)
br i1 false, label %271, label %272
271: ; preds = %262
br label %262
272: ; preds = %262
br label %273
273: ; preds = %272, %229, %209
%274 = load i32, i32* %16
%275 = icmp eq i32 %274, 117
br i1 %275, label %279, label %276
276: ; preds = %273
%277 = load i32, i32* %16
%278 = icmp eq i32 %277, 85
br i1 %278, label %279, label %340
279: ; preds = %276, %273
%280 = load i8**, i8*** %11
%281 = load i8, i8* %17
%282 = sext i8 %281 to i32
%283 = sub nsw i32 %282, 9
%284 = sdiv i32 %283, 2
%285 = sext i32 %284 to i64
%286 = getelementptr inbounds i8*, i8** %280, i64 %285
%287 = load i8*, i8** %286
%288 = load i32, i32* %18
%289 = sub nsw i32 %288, 6
%290 = sdiv i32 %289, 4
%291 = sext i32 %290 to i64
%292 = getelementptr inbounds i8, i8* %287, i64 %291
%293 = load i8, i8* %292
%294 = sext i8 %293 to i32
%295 = icmp eq i32 %294, 70
br i1 %295, label %298, label %296
296: ; preds = %279
%297 = call i32 (...) @beep()
br i1 false, label %298, label %340
298: ; preds = %296, %279
br label %299
299: ; preds = %313, %298
%300 = load i8**, i8*** %11
%301 = load i8, i8* %17
%302 = sext i8 %301 to i32
%303 = sub nsw i32 %302, 9
%304 = sdiv i32 %303, 2
%305 = sext i32 %304 to i64
%306 = getelementptr inbounds i8*, i8** %300, i64 %305
%307 = load i8*, i8** %306
%308 = load i32, i32* %18
%309 = sub nsw i32 %308, 6
%310 = sdiv i32 %309, 4
%311 = sext i32 %310 to i64
%312 = getelementptr inbounds i8, i8* %307, i64 %311
store i8 96, i8* %312
br i1 false, label %313, label %314
313: ; preds = %299
br label %299
314: ; preds = %299
br label %315
315: ; preds = %320, %314
%316 = load i32, i32* @stdscr
%317 = load i8, i8* %17
%318 = load i32, i32* %18
%319 = call i32 @getyx(i32 %316, i8 signext %317, i32 %318)
br i1 false, label %320, label %321
320: ; preds = %315
br label %315
321: ; preds = %315
br label %322
322: ; preds = %327, %321
%323 = load i32**, i32*** %10
%324 = load i8**, i8*** %11
%325 = load i32, i32* %12
%326 = call i32 @game_scene_get_flag(i32** %323, i8** %324, i32 %325, i32 0, i32* %13, i32* %15)
br i1 false, label %327, label %328
327: ; preds = %322
br label %322
328: ; preds = %322
br label %329
329: ; preds = %338, %328
%330 = load i8**, i8*** %11
%331 = load i32, i32* %12
%332 = load i32, i32* %13
%333 = load i32, i32* %14
%334 = load i8, i8* %17
%335 = load i32, i32* %18
%336 = load i32, i32* %15
%337 = call i32 @game_scene_print_face(i8** %330, i32 %331, i32 %332, i32 %333, i8 signext %334, i32 %335, i32 0, i32 %336)
br i1 false, label %338, label %339
338: ; preds = %329
br label %329
339: ; preds = %329
br label %340
340: ; preds = %339, %296, %276
br label %341
341: ; preds = %383, %340
%342 = load i32, i32* %16
%343 = load i32, i32* @KEY_UP
%344 = icmp ne i32 %342, %343
br i1 %344, label %345, label %380
345: ; preds = %341
%346 = load i32, i32* %16
%347 = load i32, i32* @KEY_DOWN
%348 = icmp ne i32 %346, %347
br i1 %348, label %349, label %380
349: ; preds = %345
%350 = load i32, i32* %16
%351 = load i32, i32* @KEY_LEFT
%352 = icmp ne i32 %350, %351
br i1 %352, label %353, label %380
353: ; preds = %349
%354 = load i32, i32* %16
%355 = load i32, i32* @KEY_RIGHT
%356 = icmp ne i32 %354, %355
br i1 %356, label %357, label %380
357: ; preds = %353
%358 = load i32, i32* %16
%359 = icmp ne i32 %358, 32
br i1 %359, label %360, label %380
360: ; preds = %357
%361 = load i32, i32* %16
%362 = icmp ne i32 %361, 111
br i1 %362, label %363, label %380
363: ; preds = %360
%364 = load i32, i32* %16
%365 = icmp ne i32 %364, 79
br i1 %365, label %366, label %380
366: ; preds = %363
%367 = load i32, i32* %16
%368 = icmp ne i32 %367, 102
br i1 %368, label %369, label %380
369: ; preds = %366
%370 = load i32, i32* %16
%371 = icmp ne i32 %370, 70
br i1 %371, label %372, label %380
372: ; preds = %369
%373 = load i32, i32* %16
%374 = icmp ne i32 %373, 117
br i1 %374, label %375, label %380
375: ; preds = %372
%376 = load i32, i32* %16
%377 = icmp ne i32 %376, 85
br i1 %377, label %378, label %380
378: ; preds = %375
%379 = call i32 (...) @beep()
br label %380
380: ; preds = %378, %375, %372, %369, %366, %363, %360, %357, %353, %349, %345, %341
%381 = phi i1 [ false, %375 ], [ false, %372 ], [ false, %369 ], [ false, %366 ], [ false, %363 ], [ false, %360 ], [ false, %357 ], [ false, %353 ], [ false, %349 ], [ false, %345 ], [ false, %341 ], [ false, %378 ]
%382 = zext i1 %381 to i32
br i1 false, label %383, label %384
383: ; preds = %380
br label %341
384: ; preds = %380
br label %19
385: ; preds = %19
br label %386
386: ; preds = %404, %385
%387 = load i32, i32* %15
%388 = icmp ne i32 %387, 0
%389 = xor i1 %388, true
br i1 %389, label %390, label %405
390: ; preds = %386
br label %391
391: ; preds = %393, %390
%392 = call i32 (...) @getch()
store i32 %392, i32* %16
br i1 false, label %393, label %394
393: ; preds = %391
br label %391
394: ; preds = %391
%395 = load i32, i32* %16
%396 = icmp eq i32 %395, 113
br i1 %396, label %400, label %397
397: ; preds = %394
%398 = load i32, i32* %16
%399 = icmp eq i32 %398, 81
br i1 %399, label %400, label %404
400: ; preds = %397, %394
br label %401
401: ; preds = %402, %400
store i32 1, i32* %15
br i1 false, label %402, label %403
402: ; preds = %401
br label %401
403: ; preds = %401
br label %404
404: ; preds = %403, %397
br label %386
405: ; preds = %386
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@KEY_LEFT = global i32 0
@KEY_RIGHT = global i32 0
@KEY_UP = global i32 0
@KEY_DOWN = global i32 0
define void @game_scene_control(i32** %0, i8** %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i8 signext %7, i32 %8) {
%10 = alloca i32
%11 = alloca i32
store i32 %3, i32* %10
store i32 %5, i32* %11
%12 = icmp eq i32 %5, 0
br i1 %12, label %143, label %13
13: ; preds = %9
%14 = icmp sgt i32 %8, 6
%15 = add nsw i32 %8, -4
%16 = shl i32 %2, 2
%17 = or i32 %16, 2
%18 = icmp sgt i32 %17, %8
%19 = add nsw i32 %8, 4
%20 = icmp sgt i8 %7, 9
%21 = add nsw i8 %7, -2
%22 = sext i8 %7 to i32
%23 = shl i32 %2, 1
%24 = add i32 %23, 7
%25 = icmp sgt i32 %24, %22
%26 = add i8 %7, 2
%27 = sext i8 %7 to i16
%28 = add nsw i16 %27, -9
%29 = sdiv i16 %28, 2
%30 = sext i16 %29 to i64
%31 = getelementptr inbounds i8*, i8** %1, i64 %30
%32 = add nsw i32 %8, -6
%33 = sdiv i32 %32, 4
%34 = sext i32 %33 to i64
%35 = trunc i16 %29 to i8
br label %36
36: ; preds = %13, %140
%37 = phi i32 [ %4, %13 ], [ %94, %140 ]
%38 = call i32 (...) @getch()
%39 = load i32, i32* @stdscr
%40 = call i32 @getyx(i32 %39, i8 signext %7, i32 %8)
%41 = load i32, i32* @KEY_LEFT
%42 = icmp eq i32 %38, %41
br i1 %42, label %43, label %49
43: ; preds = %36
br i1 %14, label %46, label %44
44: ; preds = %43
%45 = call i32 (...) @beep()
br label %49
46: ; preds = %43
%47 = call i32 @move(i8 signext %7, i32 %15)
%48 = call i32 (...) @refresh()
br label %49
49: ; preds = %44, %46, %36
%50 = load i32, i32* @KEY_RIGHT
%51 = icmp eq i32 %38, %50
br i1 %51, label %52, label %58
52: ; preds = %49
br i1 %18, label %55, label %53
53: ; preds = %52
%54 = call i32 (...) @beep()
br label %58
55: ; preds = %52
%56 = call i32 @move(i8 signext %7, i32 %19)
%57 = call i32 (...) @refresh()
br label %58
58: ; preds = %53, %55, %49
%59 = load i32, i32* @KEY_UP
%60 = icmp eq i32 %38, %59
br i1 %60, label %61, label %67
61: ; preds = %58
br i1 %20, label %64, label %62
62: ; preds = %61
%63 = call i32 (...) @beep()
br label %67
64: ; preds = %61
%65 = call i32 @move(i8 signext %21, i32 %8)
%66 = call i32 (...) @refresh()
br label %67
67: ; preds = %62, %64, %58
%68 = load i32, i32* @KEY_DOWN
%69 = icmp eq i32 %38, %68
br i1 %69, label %70, label %76
70: ; preds = %67
br i1 %25, label %73, label %71
71: ; preds = %70
%72 = call i32 (...) @beep()
br label %76
73: ; preds = %70
%74 = call i32 @move(i8 signext %26, i32 %8)
%75 = call i32 (...) @refresh()
br label %76
76: ; preds = %71, %73, %67
switch i32 %38, label %93 [
i32 111, label %77
i32 79, label %77
i32 32, label %77
]
77: ; preds = %76, %76, %76
%78 = load i8*, i8** %31
%79 = getelementptr inbounds i8, i8* %78, i64 %34
%80 = load i8, i8* %79
%81 = icmp eq i8 %80, 96
br i1 %81, label %84, label %82
82: ; preds = %77
%83 = call i32 (...) @beep()
br label %93
84: ; preds = %77
%85 = call i32 @game_scene_open(i32** %0, i8** %1, i32 %2, i32* %11, i8 signext %35, i32 %33)
%86 = add nsw i32 %37, 1
%87 = load i32, i32* @stdscr
%88 = call i32 @getyx(i32 %87, i8 signext %7, i32 %8)
%89 = call i32 @game_scene_get_flag(i32** %0, i8** %1, i32 %2, i32 0, i32* %10, i32* %11)
%90 = load i32, i32* %10
%91 = load i32, i32* %11
%92 = call i32 @game_scene_print_face(i8** %1, i32 %2, i32 %90, i32 %86, i8 signext %7, i32 %8, i32 0, i32 %91)
br label %93
93: ; preds = %76, %84, %82
%94 = phi i32 [ %86, %84 ], [ %37, %82 ], [ %37, %76 ]
%95 = and i32 %38, -33
switch i32 %95, label %124 [
i32 70, label %96
i32 85, label %110
]
96: ; preds = %93
%97 = load i8*, i8** %31
%98 = getelementptr inbounds i8, i8* %97, i64 %34
%99 = load i8, i8* %98
%100 = icmp eq i8 %99, 96
br i1 %100, label %103, label %101
101: ; preds = %96
%102 = call i32 (...) @beep()
br label %124
103: ; preds = %96
store i8 70, i8* %98
%104 = load i32, i32* @stdscr
%105 = call i32 @getyx(i32 %104, i8 signext %7, i32 %8)
%106 = call i32 @game_scene_get_flag(i32** %0, i8** %1, i32 %2, i32 0, i32* %10, i32* %11)
%107 = load i32, i32* %10
%108 = load i32, i32* %11
%109 = call i32 @game_scene_print_face(i8** %1, i32 %2, i32 %107, i32 %94, i8 signext %7, i32 %8, i32 0, i32 %108)
br label %124
110: ; preds = %93
%111 = load i8*, i8** %31
%112 = getelementptr inbounds i8, i8* %111, i64 %34
%113 = load i8, i8* %112
%114 = icmp eq i8 %113, 70
br i1 %114, label %117, label %115
115: ; preds = %110
%116 = call i32 (...) @beep()
br label %124
117: ; preds = %110
store i8 96, i8* %112
%118 = load i32, i32* @stdscr
%119 = call i32 @getyx(i32 %118, i8 signext %7, i32 %8)
%120 = call i32 @game_scene_get_flag(i32** %0, i8** %1, i32 %2, i32 0, i32* %10, i32* %11)
%121 = load i32, i32* %10
%122 = load i32, i32* %11
%123 = call i32 @game_scene_print_face(i8** %1, i32 %2, i32 %121, i32 %94, i8 signext %7, i32 %8, i32 0, i32 %122)
br label %124
124: ; preds = %93, %103, %101, %117, %115
%125 = load i32, i32* @KEY_UP
%126 = icmp eq i32 %38, %125
%127 = load i32, i32* @KEY_DOWN
%128 = icmp eq i32 %38, %127
%129 = select i1 %126, i1 true, i1 %128
%130 = load i32, i32* @KEY_LEFT
%131 = icmp eq i32 %38, %130
%132 = select i1 %129, i1 true, i1 %131
br i1 %132, label %140, label %133
133: ; preds = %124
%134 = load i32, i32* @KEY_RIGHT
%135 = icmp ne i32 %38, %134
%136 = freeze i1 %135
br i1 %136, label %137, label %140
137: ; preds = %133
switch i32 %38, label %138 [
i32 117, label %140
i32 111, label %140
i32 102, label %140
i32 85, label %140
i32 79, label %140
i32 70, label %140
i32 32, label %140
]
138: ; preds = %137
%139 = call i32 (...) @beep()
br label %140
140: ; preds = %137, %137, %137, %137, %137, %137, %137, %133, %138, %124
%141 = load i32, i32* %11
%142 = icmp eq i32 %141, 0
br i1 %142, label %143, label %36
143: ; preds = %140, %9
br label %144
144: ; preds = %143, %149
%145 = call i32 (...) @getch()
%146 = and i32 %145, -33
%147 = icmp eq i32 %146, 81
br i1 %147, label %148, label %149
148: ; preds = %144
store i32 1, i32* %11
br label %152
149: ; preds = %144
%150 = load i32, i32* %11
%151 = icmp eq i32 %150, 0
br i1 %151, label %144, label %152
152: ; preds = %149, %148
ret void
}