// File: kobanium[P]Ray/src/feature/Semeai.cpp
// Function: IsMeaningfulSelfAtari(game_info_t const*, int, int)
bool
IsMeaningfulSelfAtari( const game_info_t *game, const int color, const int pos )
{
  const char *board = game->board;
  const string_t *string = game->string;
  const int *string_id = game->string_id;
  const int other = GetOppositeColor(color);
  int size = 0;
  int already[4] = { 0 };
  int already_num = 0;
  int lib, count = 0, libs = 0;
  int lib_candidate[10];
  int id;
  bool flag;
  bool checked;

  // 上下左右が空点なら呼吸点の候補に入れる
  if (board[NORTH(pos)] == S_EMPTY) lib_candidate[libs++] = NORTH(pos);
  if (board[ WEST(pos)] == S_EMPTY) lib_candidate[libs++] =  WEST(pos);
  if (board[ EAST(pos)] == S_EMPTY) lib_candidate[libs++] =  EAST(pos);
  if (board[SOUTH(pos)] == S_EMPTY) lib_candidate[libs++] = SOUTH(pos);

  //  空点
  if (libs >= 2) return true;

  // 上を調べる
  if (board[NORTH(pos)] == color) {
    id = string_id[NORTH(pos)];
    if (string[id].libs > 2) return true;
    lib = string[id].lib[0];
    count = 0;
    while (lib != LIBERTY_END) {
      if (lib != pos) {
        checked = false;
        for (int i = 0; i < libs; i++) {
          if (lib_candidate[i] == lib) {
            checked = true;
            break;
          }
        }
        if (!checked) {
          lib_candidate[libs + count] = lib;
          count++;
        }
      }
      lib = string[id].lib[lib];
    }
    libs += count;
    size += string[id].size;
    already[already_num++] = id;
    if (libs >= 2) return true;
  } else if (board[NORTH(pos)] == other &&
             string[string_id[NORTH(pos)]].libs == 1) {
    return true;
  }

  // 左を調べる
  if (board[WEST(pos)] == color) {
    id = string_id[WEST(pos)];
    if (already[0] != id) {
      if (string[id].libs > 2) return true;
      lib = string[id].lib[0];
      count = 0;
      while (lib != LIBERTY_END) {
        if (lib != pos) {
          checked = false;
          for (int i = 0; i < libs; i++) {
            if (lib_candidate[i] == lib) {
              checked = true;
              break;
            }
          }
          if (!checked) {
            lib_candidate[libs + count] = lib;
            count++;
          }
        }
        lib = string[id].lib[lib];
      }
      libs += count;
      size += string[id].size;
      already[already_num++] = id;
      if (libs >= 2) return true;
    }
  } else if (board[WEST(pos)] == other &&
             string[string_id[WEST(pos)]].libs == 1) {
    return true;
  }

  // 右を調べる
  if (board[EAST(pos)] == color) {
    id = string_id[EAST(pos)];
    if (already[0] != id && already[1] != id) {
      if (string[id].libs > 2) return true;
      lib = string[id].lib[0];
      count = 0;
      while (lib != LIBERTY_END) {
        if (lib != pos) {
          checked = false;
          for (int i = 0; i < libs; i++) {
            if (lib_candidate[i] == lib) {
              checked = true;
              break;
            }
          }
          if (!checked) {
            lib_candidate[libs + count] = lib;
            count++;
          }
        }
        lib = string[id].lib[lib];
      }
      libs += count;
      size += string[id].size;
      already[already_num++] = id;
      if (libs >= 2) return true;
    }
  } else if (board[EAST(pos)] == other &&
             string[string_id[EAST(pos)]].libs == 1) {
    return true;
  }
  // 下を調べる
  if (board[SOUTH(pos)] == color) {
    id = string_id[SOUTH(pos)];
    if (already[0] != id && already[1] != id && already[2] != id) {
      if (string[id].libs > 2) return true;
      lib = string[id].lib[0];
      count = 0;
      while (lib != LIBERTY_END) {
        if (lib != pos) {
          checked = false;
          for (int i = 0; i < libs; i++) {
            if (lib_candidate[i] == lib) {
              checked = true;
              break;
            }
          }
          if (!checked) {
            lib_candidate[libs + count] = lib;
            count++;
          }
        }
        lib = string[id].lib[lib];
      }
      libs += count;
      size += string[id].size;
      already[already_num++] = id;
      if (libs >= 2) return true;
    }
  } else if (board[SOUTH(pos)] == other &&
             string[string_id[SOUTH(pos)]].libs == 1) {
    return true;
  }


  // 自己アタリになる連の大きさが2以下,
  // または大きさが5以下でナカデの形になる場合は
  // 打っても良いものとする
  if (size < 2) {
    flag = true;
  } else if (size < 6) {
    if (IsNakadeSelfAtari(game, pos, color)) {
      if (already_num == 1 && libs == 1 &&
          eye_condition[Pat3(game->pat, lib_candidate[0])] == E_COMPLETE_ONE_EYE) {
        flag = false;
      } else {
        flag = true;
      }
    } else {
      flag = false;
    }
  } else {
    flag = false;
  }

  return flag;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0x43f8, %rax           # imm = 0x43F8
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq $0x9620, %rax           # imm = 0x9620
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
addq $0x95720, %rax          # imm = 0x95720
movq %rax, -0x30(%rbp)
movl -0x14(%rbp), %edi
callq 0x25810
movl %eax, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x72b0
movl $0x0, -0x54(%rbp)
movl $0x0, -0x5c(%rbp)
movl $0x0, -0x60(%rbp)
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
leaq 0x3e0f8(%rip), %rdx     # 0xe7a4c
subl (%rdx), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0xa9982
movl -0x18(%rbp), %ecx
leaq 0x3e0e0(%rip), %rax     # 0xe7a4c
subl (%rax), %ecx
movl -0x60(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x60(%rbp)
cltq
movl %ecx, -0x90(%rbp,%rax,4)
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0xa99b2
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movl -0x60(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x60(%rbp)
cltq
movl %ecx, -0x90(%rbp,%rax,4)
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0xa99e2
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movl -0x60(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x60(%rbp)
cltq
movl %ecx, -0x90(%rbp,%rax,4)
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
leaq 0x3e05c(%rip), %rdx     # 0xe7a4c
addl (%rdx), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0xa9a1e
movl -0x18(%rbp), %ecx
leaq 0x3e044(%rip), %rax     # 0xe7a4c
addl (%rax), %ecx
movl -0x60(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x60(%rbp)
cltq
movl %ecx, -0x90(%rbp,%rax,4)
cmpl $0x2, -0x60(%rbp)
jl 0xa9a2d
movb $0x1, -0x1(%rbp)
jmp 0xaa238
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
leaq 0x3e011(%rip), %rdx     # 0xe7a4c
subl (%rdx), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl -0x14(%rbp), %eax
jne 0xa9bae
movq -0x30(%rbp), %rax
movl -0x18(%rbp), %ecx
leaq 0x3dff1(%rip), %rdx     # 0xe7a4c
subl (%rdx), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x94(%rbp)
movq -0x28(%rbp), %rax
movslq -0x94(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
cmpl $0x2, 0x4(%rax)
jle 0xa9a8d
movb $0x1, -0x1(%rbp)
jmp 0xaa238
movq -0x28(%rbp), %rax
movslq -0x94(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movswl 0x8(%rax), %eax
movl %eax, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
cmpl $0x2b7, -0x58(%rbp)     # imm = 0x2B7
je 0xa9b5c
movl -0x58(%rbp), %eax
cmpl -0x18(%rbp), %eax
je 0xa9b36
movb $0x0, -0x96(%rbp)
movl $0x0, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
cmpl -0x60(%rbp), %eax
jge 0xa9b10
movslq -0x9c(%rbp), %rax
movl -0x90(%rbp,%rax,4), %eax
cmpl -0x58(%rbp), %eax
jne 0xa9afd
movb $0x1, -0x96(%rbp)
jmp 0xa9b10
jmp 0xa9aff
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0xa9ad6
testb $0x1, -0x96(%rbp)
jne 0xa9b34
movl -0x58(%rbp), %ecx
movl -0x60(%rbp), %eax
addl -0x5c(%rbp), %eax
cltq
movl %ecx, -0x90(%rbp,%rax,4)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0xa9b36
movq -0x28(%rbp), %rax
movslq -0x94(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movslq -0x58(%rbp), %rcx
movswl 0x8(%rax,%rcx,2), %eax
movl %eax, -0x58(%rbp)
jmp 0xa9ab0
movl -0x5c(%rbp), %eax
addl -0x60(%rbp), %eax
movl %eax, -0x60(%rbp)
movq -0x28(%rbp), %rax
movslq -0x94(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movl 0x7c0(%rax), %eax
addl -0x38(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x94(%rbp), %ecx
movl -0x54(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x54(%rbp)
cltq
movl %ecx, -0x50(%rbp,%rax,4)
cmpl $0x2, -0x60(%rbp)
jl 0xa9bac
movb $0x1, -0x1(%rbp)
jmp 0xaa238
jmp 0xa9c00
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
leaq 0x3de90(%rip), %rdx     # 0xe7a4c
subl (%rdx), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl -0x34(%rbp), %eax
jne 0xa9bfe
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movl -0x18(%rbp), %edx
leaq 0x3de70(%rip), %rsi     # 0xe7a4c
subl (%rsi), %edx
movslq %edx, %rdx
movslq (%rcx,%rdx,4), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
cmpl $0x1, 0x4(%rax)
jne 0xa9bfe
movb $0x1, -0x1(%rbp)
jmp 0xaa238
jmp 0xa9c00
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl -0x14(%rbp), %eax
jne 0xa9d86
movq -0x30(%rbp), %rax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x94(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x94(%rbp), %eax
je 0xa9d84
movq -0x28(%rbp), %rax
movslq -0x94(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
cmpl $0x2, 0x4(%rax)
jle 0xa9c63
movb $0x1, -0x1(%rbp)
jmp 0xaa238
movq -0x28(%rbp), %rax
movslq -0x94(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movswl 0x8(%rax), %eax
movl %eax, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
cmpl $0x2b7, -0x58(%rbp)     # imm = 0x2B7
je 0xa9d32
movl -0x58(%rbp), %eax
cmpl -0x18(%rbp), %eax
je 0xa9d0c
movb $0x0, -0x96(%rbp)
movl $0x0, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
cmpl -0x60(%rbp), %eax
jge 0xa9ce6
movslq -0xa0(%rbp), %rax
movl -0x90(%rbp,%rax,4), %eax
cmpl -0x58(%rbp), %eax
jne 0xa9cd3
movb $0x1, -0x96(%rbp)
jmp 0xa9ce6
jmp 0xa9cd5
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
jmp 0xa9cac
testb $0x1, -0x96(%rbp)
jne 0xa9d0a
movl -0x58(%rbp), %ecx
movl -0x60(%rbp), %eax
addl -0x5c(%rbp), %eax
cltq
movl %ecx, -0x90(%rbp,%rax,4)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0xa9d0c
movq -0x28(%rbp), %rax
movslq -0x94(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movslq -0x58(%rbp), %rcx
movswl 0x8(%rax,%rcx,2), %eax
movl %eax, -0x58(%rbp)
jmp 0xa9c86
movl -0x5c(%rbp), %eax
addl -0x60(%rbp), %eax
movl %eax, -0x60(%rbp)
movq -0x28(%rbp), %rax
movslq -0x94(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movl 0x7c0(%rax), %eax
addl -0x38(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x94(%rbp), %ecx
movl -0x54(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x54(%rbp)
cltq
movl %ecx, -0x50(%rbp,%rax,4)
cmpl $0x2, -0x60(%rbp)
jl 0xa9d82
movb $0x1, -0x1(%rbp)
jmp 0xaa238
jmp 0xa9d84
jmp 0xa9dcc
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl -0x34(%rbp), %eax
jne 0xa9dca
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movl -0x18(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movslq (%rcx,%rdx,4), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
cmpl $0x1, 0x4(%rax)
jne 0xa9dca
movb $0x1, -0x1(%rbp)
jmp 0xaa238
jmp 0xa9dcc
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl -0x14(%rbp), %eax
jne 0xa9f61
movq -0x30(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x94(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x94(%rbp), %eax
je 0xa9f5f
movl -0x4c(%rbp), %eax
cmpl -0x94(%rbp), %eax
je 0xa9f5f
movq -0x28(%rbp), %rax
movslq -0x94(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
cmpl $0x2, 0x4(%rax)
jle 0xa9e3e
movb $0x1, -0x1(%rbp)
jmp 0xaa238
movq -0x28(%rbp), %rax
movslq -0x94(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movswl 0x8(%rax), %eax
movl %eax, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
cmpl $0x2b7, -0x58(%rbp)     # imm = 0x2B7
je 0xa9f0d
movl -0x58(%rbp), %eax
cmpl -0x18(%rbp), %eax
je 0xa9ee7
movb $0x0, -0x96(%rbp)
movl $0x0, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
cmpl -0x60(%rbp), %eax
jge 0xa9ec1
movslq -0xa4(%rbp), %rax
movl -0x90(%rbp,%rax,4), %eax
cmpl -0x58(%rbp), %eax
jne 0xa9eae
movb $0x1, -0x96(%rbp)
jmp 0xa9ec1
jmp 0xa9eb0
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0xa9e87
testb $0x1, -0x96(%rbp)
jne 0xa9ee5
movl -0x58(%rbp), %ecx
movl -0x60(%rbp), %eax
addl -0x5c(%rbp), %eax
cltq
movl %ecx, -0x90(%rbp,%rax,4)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0xa9ee7
movq -0x28(%rbp), %rax
movslq -0x94(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movslq -0x58(%rbp), %rcx
movswl 0x8(%rax,%rcx,2), %eax
movl %eax, -0x58(%rbp)
jmp 0xa9e61
movl -0x5c(%rbp), %eax
addl -0x60(%rbp), %eax
movl %eax, -0x60(%rbp)
movq -0x28(%rbp), %rax
movslq -0x94(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movl 0x7c0(%rax), %eax
addl -0x38(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x94(%rbp), %ecx
movl -0x54(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x54(%rbp)
cltq
movl %ecx, -0x50(%rbp,%rax,4)
cmpl $0x2, -0x60(%rbp)
jl 0xa9f5d
movb $0x1, -0x1(%rbp)
jmp 0xaa238
jmp 0xa9f5f
jmp 0xa9fa7
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl -0x34(%rbp), %eax
jne 0xa9fa5
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movl -0x18(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movslq (%rcx,%rdx,4), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
cmpl $0x1, 0x4(%rax)
jne 0xa9fa5
movb $0x1, -0x1(%rbp)
jmp 0xaa238
jmp 0xa9fa7
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
leaq 0x3da97(%rip), %rdx     # 0xe7a4c
addl (%rdx), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl -0x14(%rbp), %eax
jne 0xaa157
movq -0x30(%rbp), %rax
movl -0x18(%rbp), %ecx
leaq 0x3da77(%rip), %rdx     # 0xe7a4c
addl (%rdx), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x94(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x94(%rbp), %eax
je 0xaa155
movl -0x4c(%rbp), %eax
cmpl -0x94(%rbp), %eax
je 0xaa155
movl -0x48(%rbp), %eax
cmpl -0x94(%rbp), %eax
je 0xaa155
movq -0x28(%rbp), %rax
movslq -0x94(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
cmpl $0x2, 0x4(%rax)
jle 0xaa034
movb $0x1, -0x1(%rbp)
jmp 0xaa238
movq -0x28(%rbp), %rax
movslq -0x94(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movswl 0x8(%rax), %eax
movl %eax, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
cmpl $0x2b7, -0x58(%rbp)     # imm = 0x2B7
je 0xaa103
movl -0x58(%rbp), %eax
cmpl -0x18(%rbp), %eax
je 0xaa0dd
movb $0x0, -0x96(%rbp)
movl $0x0, -0xa8(%rbp)
movl -0xa8(%rbp), %eax
cmpl -0x60(%rbp), %eax
jge 0xaa0b7
movslq -0xa8(%rbp), %rax
movl -0x90(%rbp,%rax,4), %eax
cmpl -0x58(%rbp), %eax
jne 0xaa0a4
movb $0x1, -0x96(%rbp)
jmp 0xaa0b7
jmp 0xaa0a6
movl -0xa8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa8(%rbp)
jmp 0xaa07d
testb $0x1, -0x96(%rbp)
jne 0xaa0db
movl -0x58(%rbp), %ecx
movl -0x60(%rbp), %eax
addl -0x5c(%rbp), %eax
cltq
movl %ecx, -0x90(%rbp,%rax,4)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0xaa0dd
movq -0x28(%rbp), %rax
movslq -0x94(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movslq -0x58(%rbp), %rcx
movswl 0x8(%rax,%rcx,2), %eax
movl %eax, -0x58(%rbp)
jmp 0xaa057
movl -0x5c(%rbp), %eax
addl -0x60(%rbp), %eax
movl %eax, -0x60(%rbp)
movq -0x28(%rbp), %rax
movslq -0x94(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movl 0x7c0(%rax), %eax
addl -0x38(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x94(%rbp), %ecx
movl -0x54(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x54(%rbp)
cltq
movl %ecx, -0x50(%rbp,%rax,4)
cmpl $0x2, -0x60(%rbp)
jl 0xaa153
movb $0x1, -0x1(%rbp)
jmp 0xaa238
jmp 0xaa155
jmp 0xaa1a9
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
leaq 0x3d8e7(%rip), %rdx     # 0xe7a4c
addl (%rdx), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl -0x34(%rbp), %eax
jne 0xaa1a7
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movl -0x18(%rbp), %edx
leaq 0x3d8c7(%rip), %rsi     # 0xe7a4c
addl (%rsi), %edx
movslq %edx, %rdx
movslq (%rcx,%rdx,4), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
cmpl $0x1, 0x4(%rax)
jne 0xaa1a7
movb $0x1, -0x1(%rbp)
jmp 0xaa238
jmp 0xaa1a9
cmpl $0x2, -0x38(%rbp)
jge 0xaa1b8
movb $0x1, -0x95(%rbp)
jmp 0xaa22d
cmpl $0x6, -0x38(%rbp)
jge 0xaa224
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %esi
movl -0x14(%rbp), %edx
callq 0xa44b0
testb $0x1, %al
jne 0xaa1d3
jmp 0xaa21b
cmpl $0x1, -0x54(%rbp)
jne 0xaa212
cmpl $0x1, -0x60(%rbp)
jne 0xaa212
movq -0x10(%rbp), %rdi
addq $0x4748, %rdi           # imm = 0x4748
movl -0x90(%rbp), %esi
callq 0x93d30
movl %eax, %eax
movl %eax, %ecx
leaq 0x1ab16660(%rip), %rax  # 0x1abc0860
movzbl (%rax,%rcx), %eax
cmpl $0x5, %eax
jne 0xaa212
movb $0x0, -0x95(%rbp)
jmp 0xaa219
movb $0x1, -0x95(%rbp)
jmp 0xaa222
movb $0x0, -0x95(%rbp)
jmp 0xaa22b
movb $0x0, -0x95(%rbp)
jmp 0xaa22d
movb -0x95(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)