// File: kobanium[P]Ray/src/feature/SimulationFeature.cpp
// Function: CheckSelfAtariForSimulation(game_info_t*, int, int)
bool
CheckSelfAtariForSimulation( 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 lib, id, count = 0, libs = 0, size = 0, already_num = 0;
  int already[4] = { 0 }, lib_candidate[10];
  bool flag, 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) {
    CompareSwapFeature(game->tactical_features, pos, CAPTURE, SIM_SELF_ATARI_SMALL);
    flag = true;
  } else if (size < 5) {
    if (IsNakadeSelfAtari(game, pos, color)) {
      CompareSwapFeature(game->tactical_features, pos, CAPTURE, SIM_SELF_ATARI_NAKADE);
      flag = true;
    } else {
      CompareSwapFeature(game->tactical_features, pos, CAPTURE, SIM_SELF_ATARI_SMALL);
      flag = false;
    }
  } else {
    CompareSwapFeature(game->tactical_features, pos, CAPTURE, SIM_SELF_ATARI_LARGE);
    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, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x72b0
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
leaq 0x45198(%rip), %rdx     # 0xe7a4c
subl (%rdx), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0xa28e2
movl -0x18(%rbp), %ecx
leaq 0x45180(%rip), %rax     # 0xe7a4c
subl (%rax), %ecx
movl -0x44(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x44(%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 0xa2912
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movl -0x44(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x44(%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 0xa2942
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movl -0x44(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x44(%rbp)
cltq
movl %ecx, -0x90(%rbp,%rax,4)
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
leaq 0x450fc(%rip), %rdx     # 0xe7a4c
addl (%rdx), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0xa297e
movl -0x18(%rbp), %ecx
leaq 0x450e4(%rip), %rax     # 0xe7a4c
addl (%rax), %ecx
movl -0x44(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x44(%rbp)
cltq
movl %ecx, -0x90(%rbp,%rax,4)
cmpl $0x2, -0x44(%rbp)
jl 0xa298d
movb $0x1, -0x1(%rbp)
jmp 0xa316a
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
leaq 0x450b1(%rip), %rdx     # 0xe7a4c
subl (%rdx), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl -0x14(%rbp), %eax
jne 0xa2afc
movq -0x30(%rbp), %rax
movl -0x18(%rbp), %ecx
leaq 0x45091(%rip), %rdx     # 0xe7a4c
subl (%rdx), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
cmpl $0x2, 0x4(%rax)
jle 0xa29e7
movb $0x1, -0x1(%rbp)
jmp 0xa316a
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movswl 0x8(%rax), %eax
movl %eax, -0x38(%rbp)
movl $0x0, -0x40(%rbp)
cmpl $0x2b7, -0x38(%rbp)     # imm = 0x2B7
je 0xa2ab0
movl -0x38(%rbp), %eax
cmpl -0x18(%rbp), %eax
je 0xa2a8d
movb $0x0, -0x92(%rbp)
movl $0x0, -0x98(%rbp)
movl -0x98(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0xa2a67
movslq -0x98(%rbp), %rax
movl -0x90(%rbp,%rax,4), %eax
cmpl -0x38(%rbp), %eax
jne 0xa2a54
movb $0x1, -0x92(%rbp)
jmp 0xa2a67
jmp 0xa2a56
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0xa2a2d
testb $0x1, -0x92(%rbp)
jne 0xa2a8b
movl -0x38(%rbp), %ecx
movl -0x44(%rbp), %eax
addl -0x40(%rbp), %eax
cltq
movl %ecx, -0x90(%rbp,%rax,4)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xa2a8d
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movslq -0x38(%rbp), %rcx
movswl 0x8(%rax,%rcx,2), %eax
movl %eax, -0x38(%rbp)
jmp 0xa2a07
movl -0x40(%rbp), %eax
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movl 0x7c0(%rax), %eax
addl -0x48(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x3c(%rbp), %ecx
movl -0x4c(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x4c(%rbp)
cltq
movl %ecx, -0x60(%rbp,%rax,4)
cmpl $0x2, -0x44(%rbp)
jl 0xa2afa
movb $0x1, -0x1(%rbp)
jmp 0xa316a
jmp 0xa2b4e
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
leaq 0x44f42(%rip), %rdx     # 0xe7a4c
subl (%rdx), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl -0x34(%rbp), %eax
jne 0xa2b4c
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movl -0x18(%rbp), %edx
leaq 0x44f22(%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 0xa2b4c
movb $0x1, -0x1(%rbp)
jmp 0xa316a
jmp 0xa2b4e
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl -0x14(%rbp), %eax
jne 0xa2cbf
movq -0x30(%rbp), %rax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x3c(%rbp), %eax
je 0xa2cbd
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
cmpl $0x2, 0x4(%rax)
jle 0xa2ba8
movb $0x1, -0x1(%rbp)
jmp 0xa316a
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movswl 0x8(%rax), %eax
movl %eax, -0x38(%rbp)
movl $0x0, -0x40(%rbp)
cmpl $0x2b7, -0x38(%rbp)     # imm = 0x2B7
je 0xa2c71
movl -0x38(%rbp), %eax
cmpl -0x18(%rbp), %eax
je 0xa2c4e
movb $0x0, -0x92(%rbp)
movl $0x0, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0xa2c28
movslq -0x9c(%rbp), %rax
movl -0x90(%rbp,%rax,4), %eax
cmpl -0x38(%rbp), %eax
jne 0xa2c15
movb $0x1, -0x92(%rbp)
jmp 0xa2c28
jmp 0xa2c17
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0xa2bee
testb $0x1, -0x92(%rbp)
jne 0xa2c4c
movl -0x38(%rbp), %ecx
movl -0x44(%rbp), %eax
addl -0x40(%rbp), %eax
cltq
movl %ecx, -0x90(%rbp,%rax,4)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xa2c4e
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movslq -0x38(%rbp), %rcx
movswl 0x8(%rax,%rcx,2), %eax
movl %eax, -0x38(%rbp)
jmp 0xa2bc8
movl -0x40(%rbp), %eax
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movl 0x7c0(%rax), %eax
addl -0x48(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x3c(%rbp), %ecx
movl -0x4c(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x4c(%rbp)
cltq
movl %ecx, -0x60(%rbp,%rax,4)
cmpl $0x2, -0x44(%rbp)
jl 0xa2cbb
movb $0x1, -0x1(%rbp)
jmp 0xa316a
jmp 0xa2cbd
jmp 0xa2d05
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl -0x34(%rbp), %eax
jne 0xa2d03
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 0xa2d03
movb $0x1, -0x1(%rbp)
jmp 0xa316a
jmp 0xa2d05
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl -0x14(%rbp), %eax
jne 0xa2e82
movq -0x30(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x3c(%rbp), %eax
je 0xa2e80
movl -0x5c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
je 0xa2e80
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
cmpl $0x2, 0x4(%rax)
jle 0xa2d6b
movb $0x1, -0x1(%rbp)
jmp 0xa316a
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movswl 0x8(%rax), %eax
movl %eax, -0x38(%rbp)
movl $0x0, -0x40(%rbp)
cmpl $0x2b7, -0x38(%rbp)     # imm = 0x2B7
je 0xa2e34
movl -0x38(%rbp), %eax
cmpl -0x18(%rbp), %eax
je 0xa2e11
movb $0x0, -0x92(%rbp)
movl $0x0, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0xa2deb
movslq -0xa0(%rbp), %rax
movl -0x90(%rbp,%rax,4), %eax
cmpl -0x38(%rbp), %eax
jne 0xa2dd8
movb $0x1, -0x92(%rbp)
jmp 0xa2deb
jmp 0xa2dda
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
jmp 0xa2db1
testb $0x1, -0x92(%rbp)
jne 0xa2e0f
movl -0x38(%rbp), %ecx
movl -0x44(%rbp), %eax
addl -0x40(%rbp), %eax
cltq
movl %ecx, -0x90(%rbp,%rax,4)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xa2e11
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movslq -0x38(%rbp), %rcx
movswl 0x8(%rax,%rcx,2), %eax
movl %eax, -0x38(%rbp)
jmp 0xa2d8b
movl -0x40(%rbp), %eax
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movl 0x7c0(%rax), %eax
addl -0x48(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x3c(%rbp), %ecx
movl -0x4c(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x4c(%rbp)
cltq
movl %ecx, -0x60(%rbp,%rax,4)
cmpl $0x2, -0x44(%rbp)
jl 0xa2e7e
movb $0x1, -0x1(%rbp)
jmp 0xa316a
jmp 0xa2e80
jmp 0xa2ec8
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl -0x34(%rbp), %eax
jne 0xa2ec6
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 0xa2ec6
movb $0x1, -0x1(%rbp)
jmp 0xa316a
jmp 0xa2ec8
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
leaq 0x44b76(%rip), %rdx     # 0xe7a4c
addl (%rdx), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl -0x14(%rbp), %eax
jne 0xa305d
movq -0x30(%rbp), %rax
movl -0x18(%rbp), %ecx
leaq 0x44b56(%rip), %rdx     # 0xe7a4c
addl (%rdx), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x3c(%rbp), %eax
je 0xa305b
movl -0x5c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
je 0xa305b
movl -0x58(%rbp), %eax
cmpl -0x3c(%rbp), %eax
je 0xa305b
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
cmpl $0x2, 0x4(%rax)
jle 0xa2f46
movb $0x1, -0x1(%rbp)
jmp 0xa316a
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movswl 0x8(%rax), %eax
movl %eax, -0x38(%rbp)
movl $0x0, -0x40(%rbp)
cmpl $0x2b7, -0x38(%rbp)     # imm = 0x2B7
je 0xa300f
movl -0x38(%rbp), %eax
cmpl -0x18(%rbp), %eax
je 0xa2fec
movb $0x0, -0x92(%rbp)
movl $0x0, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0xa2fc6
movslq -0xa4(%rbp), %rax
movl -0x90(%rbp,%rax,4), %eax
cmpl -0x38(%rbp), %eax
jne 0xa2fb3
movb $0x1, -0x92(%rbp)
jmp 0xa2fc6
jmp 0xa2fb5
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0xa2f8c
testb $0x1, -0x92(%rbp)
jne 0xa2fea
movl -0x38(%rbp), %ecx
movl -0x44(%rbp), %eax
addl -0x40(%rbp), %eax
cltq
movl %ecx, -0x90(%rbp,%rax,4)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xa2fec
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movslq -0x38(%rbp), %rcx
movswl 0x8(%rax,%rcx,2), %eax
movl %eax, -0x38(%rbp)
jmp 0xa2f66
movl -0x40(%rbp), %eax
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movl 0x7c0(%rax), %eax
addl -0x48(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x3c(%rbp), %ecx
movl -0x4c(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x4c(%rbp)
cltq
movl %ecx, -0x60(%rbp,%rax,4)
cmpl $0x2, -0x44(%rbp)
jl 0xa3059
movb $0x1, -0x1(%rbp)
jmp 0xa316a
jmp 0xa305b
jmp 0xa30af
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
leaq 0x449e1(%rip), %rdx     # 0xe7a4c
addl (%rdx), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl -0x34(%rbp), %eax
jne 0xa30ad
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movl -0x18(%rbp), %edx
leaq 0x449c1(%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 0xa30ad
movb $0x1, -0x1(%rbp)
jmp 0xa316a
jmp 0xa30af
cmpl $0x2, -0x48(%rbp)
jge 0xa30db
movq -0x10(%rbp), %rdi
addq $0x97372, %rdi          # imm = 0x97372
movl -0x18(%rbp), %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0xa35f0
movb $0x1, -0x91(%rbp)
jmp 0xa315f
cmpl $0x5, -0x48(%rbp)
jge 0xa313c
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %esi
movl -0x14(%rbp), %edx
callq 0xa44b0
testb $0x1, %al
jne 0xa30f6
jmp 0xa3119
movq -0x10(%rbp), %rdi
addq $0x97372, %rdi          # imm = 0x97372
movl -0x18(%rbp), %esi
xorl %edx, %edx
movl $0x2, %ecx
callq 0xa35f0
movb $0x1, -0x91(%rbp)
jmp 0xa313a
movq -0x10(%rbp), %rdi
addq $0x97372, %rdi          # imm = 0x97372
movl -0x18(%rbp), %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0xa35f0
movb $0x0, -0x91(%rbp)
jmp 0xa315d
movq -0x10(%rbp), %rdi
addq $0x97372, %rdi          # imm = 0x97372
movl -0x18(%rbp), %esi
xorl %edx, %edx
movl $0x3, %ecx
callq 0xa35f0
movb $0x0, -0x91(%rbp)
jmp 0xa315f
movb -0x91(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax,%rax)