// File: kobanium[P]Ray/src/learn/FactorizationMachines.cpp
// Function: CorrectAllFeatures(game_info_t*, int, std::vector<btfm_t*, std::allocator<btfm_t*>>*, std::map<int, btfm_t*, std::less<int>, std::allocator<std::pair<int const, btfm_t*>>>&)
static void
CorrectAllFeatures( game_info_t *game, int color, std::vector<btfm_t*> featureList[], std::map<int, btfm_t*> &featureMap )
{
  const int moves = game->moves;
  const int pm1 = game->record[moves - 1].pos;
  const int pm2 = (moves > 2) ? game->record[moves - 2].pos : PASS;
  const int pm3 = (moves > 3) ? game->record[moves - 3].pos : PASS;
  const int pm4 = (moves > 4) ? game->record[moves - 4].pos : PASS;
  unsigned int tactical_features[BOARD_MAX * UCT_INDEX_MAX] = {0};
  int id = 0;
  pattern_t *pat = game->pat;
  pattern_hash_t hash_pat;

  const int distance_index = CheckFeaturesForTree( game, color, tactical_features );
  CheckRemove2StonesForTree(game, color, tactical_features);

  if (moves > 2 && game->ko_move == moves - 2) {
    CheckCaptureAfterKoForTree(game, color, tactical_features);
    CheckKoConnectionForTree(game, tactical_features);
  } else if (moves > 3 && game->ko_move == moves - 3) {
    CheckKoRecaptureForTree(game, color, tactical_features);
  }

  // パス
  if (moves > 1 && pm1 == PASS) {
    featureList[PASS].push_back(&pass[UCT_PASS_AFTER_PASS]);
    id = pass[UCT_PASS_AFTER_PASS].id;
    featureMap[id] = &pass[UCT_PASS_AFTER_PASS];
  } else {
    featureList[PASS].push_back(&pass[UCT_PASS_AFTER_MOVE]);
    id = pass[UCT_PASS_AFTER_MOVE].id;
    featureMap[id] = &pass[UCT_PASS_AFTER_MOVE];
  }

  if (moves > 1 && game->ko_move == moves - 1) {
    featureList[PASS].push_back(&ko_exist[0]);
    id = ko_exist[0].id;
    featureMap[id] = &ko_exist[0];
  }

  for (int i = 0; i < pure_board_max; i++) {
    const int pos = onboard_pos[i];
    if (IsLegal(game, pos, color)) {
      CheckSelfAtariForTree(game, color, pos, tactical_features);
      CheckCaptureForTree(game, color, pos, tactical_features);
      CheckAtariForTree(game, color, pos, tactical_features);

      if (moves > 1 && game->ko_move == moves - 1) {
        featureList[pos].push_back(&ko_exist[0]);
      }

      CorrectTacticalFeature(featureList, featureMap, capture,        tactical_features, UCT_CAPTURE_INDEX,        pos);
      CorrectTacticalFeature(featureList, featureMap, save_extension, tactical_features, UCT_SAVE_EXTENSION_INDEX, pos);
      CorrectTacticalFeature(featureList, featureMap, atari,          tactical_features, UCT_ATARI_INDEX,          pos);
      CorrectTacticalFeature(featureList, featureMap, extension,      tactical_features, UCT_EXTENSION_INDEX,      pos);
      CorrectTacticalFeature(featureList, featureMap, dame,           tactical_features, UCT_DAME_INDEX,           pos);
      CorrectTacticalFeature(featureList, featureMap, connect,        tactical_features, UCT_CONNECT_INDEX,        pos);
      CorrectTacticalFeature(featureList, featureMap, throw_in,       tactical_features, UCT_THROW_IN_INDEX,       pos);

      CorrectMoveDistanceFeature(featureList, featureMap, move_distance_1, pos, pm1, distance_index);
      CorrectMoveDistanceFeature(featureList, featureMap, move_distance_2, pos, pm2, distance_index);
      CorrectMoveDistanceFeature(featureList, featureMap, move_distance_3, pos, pm3, distance_index);
      CorrectMoveDistanceFeature(featureList, featureMap, move_distance_4, pos, pm4, distance_index);

      featureList[pos].push_back(&pos_id[board_pos_id[pos]]);
      id = pos_id[board_pos_id[pos]].id;
      if (!featureMap.count(id)) {
        featureMap[id] = &pos_id[board_pos_id[pos]];
      }

      PatternHash(&game->pat[pos], &hash_pat);
      const int pat_3x3 = pat3_index[Pat3(pat, pos)];
      const int pat_md2 = md2_index[MD2(pat, pos)];
      const int md3_idx = SearchIndex(md3_index.data(), hash_pat.list[MD_3]);
      const int md4_idx = SearchIndex(md4_index.data(), hash_pat.list[MD_4]);
      const int md5_idx = SearchIndex(md5_index.data(), hash_pat.list[MD_5 + MD_MAX]);

      if (md5_idx != -1 && md5_target[md5_idx]) {
        featureList[pos].push_back(&md5[md5_idx]);
        id = md5[md5_idx].id;
        if (!featureMap.count(id)) {
          featureMap[id] = &md5[md5_idx];
        }
      } else if (md4_idx != -1 && md4_target[md4_idx]) {
        featureList[pos].push_back(&md4[md4_idx]);
        id = md4[md4_idx].id;
        if (!featureMap.count(id)) {
          featureMap[id] = &md4[md4_idx];
        }
      } else if (md3_idx != -1 && md3_target[md3_idx]) {
        featureList[pos].push_back(&md3[md3_idx]);
        id = md3[md3_idx].id;
        if (!featureMap.count(id)) {
          featureMap[id] = &md3[md3_idx];
        }
      } else if (pat_md2 != 0 && md2_target[pat_md2]) {
        featureList[pos].push_back(&md2[pat_md2]);
        id = md2[pat_md2].id;
        if (!featureMap.count(id)) {
          featureMap[id] = &md2[pat_md2];
        }
      } else {
        featureList[pos].push_back(&pat3[pat_3x3]);
        id = pat3[pat_3x3].id;
        if (!featureMap.count(id)) {
          featureMap[id] = &pat3[pat_3x3];
        }
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x5de0, %rsp           # imm = 0x5DE0
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl 0x43b0(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x28(%rbp)
cmpl $0x2, -0x24(%rbp)
jle 0x5e296
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x5d1c(%rbp)
jmp 0x5e2a0
xorl %eax, %eax
movl %eax, -0x5d1c(%rbp)
jmp 0x5e2a0
movl -0x5d1c(%rbp), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x3, -0x24(%rbp)
jle 0x5e2ce
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
subl $0x3, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x5d20(%rbp)
jmp 0x5e2d8
xorl %eax, %eax
movl %eax, -0x5d20(%rbp)
jmp 0x5e2d8
movl -0x5d20(%rbp), %eax
movl %eax, -0x30(%rbp)
cmpl $0x4, -0x24(%rbp)
jle 0x5e306
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
subl $0x4, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x5d24(%rbp)
jmp 0x5e310
xorl %eax, %eax
movl %eax, -0x5d24(%rbp)
jmp 0x5e310
movl -0x5d24(%rbp), %eax
movl %eax, -0x34(%rbp)
leaq -0x5c30(%rbp), %rdi
xorl %esi, %esi
movl $0x5bfc, %edx           # imm = 0x5BFC
callq 0x72b0
movl $0x0, -0x5c34(%rbp)
movq -0x8(%rbp), %rax
addq $0x4748, %rax           # imm = 0x4748
movq %rax, -0x5c40(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x5c30(%rbp), %rdx
callq 0xa5cf0
movl %eax, -0x5c64(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x5c30(%rbp), %rdx
callq 0xa7be0
cmpl $0x2, -0x24(%rbp)
jle 0x5e3b2
movq -0x8(%rbp), %rax
movl 0x43c8(%rax), %eax
movl -0x24(%rbp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jne 0x5e3b2
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x5c30(%rbp), %rdx
callq 0xa7320
movq -0x8(%rbp), %rdi
leaq -0x5c30(%rbp), %rsi
callq 0xa7ab0
jmp 0x5e3e1
cmpl $0x3, -0x24(%rbp)
jle 0x5e3df
movq -0x8(%rbp), %rax
movl 0x43c8(%rax), %eax
movl -0x24(%rbp), %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jne 0x5e3df
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x5c30(%rbp), %rdx
callq 0xa7b00
jmp 0x5e3e1
cmpl $0x1, -0x24(%rbp)
jle 0x5e47f
cmpl $0x0, -0x28(%rbp)
jne 0x5e47f
movq -0x18(%rbp), %rax
movq %rax, -0x5d38(%rbp)
leaq 0x8afd9(%rip), %rdi     # 0xe93e0
movl $0x1, %esi
callq 0x63540
movq -0x5d38(%rbp), %rdi
movq %rax, -0x5c70(%rbp)
leaq -0x5c70(%rbp), %rsi
callq 0x671d0
leaq 0x8afae(%rip), %rdi     # 0xe93e0
movl $0x1, %esi
callq 0x63540
movl 0x210(%rax), %eax
movl %eax, -0x5c34(%rbp)
leaq 0x8af91(%rip), %rdi     # 0xe93e0
movl $0x1, %esi
callq 0x63540
movq %rax, -0x5d30(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x5c34(%rbp), %rsi
callq 0x67200
movq -0x5d30(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x5e501
movq -0x18(%rbp), %rax
movq %rax, -0x5d48(%rbp)
leaq 0x8af4f(%rip), %rdi     # 0xe93e0
xorl %eax, %eax
movl %eax, %esi
callq 0x63540
movq -0x5d48(%rbp), %rdi
movq %rax, -0x5c78(%rbp)
leaq -0x5c78(%rbp), %rsi
callq 0x671d0
leaq 0x8af25(%rip), %rdi     # 0xe93e0
xorl %eax, %eax
movl %eax, %esi
callq 0x63540
movl 0x210(%rax), %eax
movl %eax, -0x5c34(%rbp)
leaq 0x8af09(%rip), %rdi     # 0xe93e0
xorl %eax, %eax
movl %eax, %esi
callq 0x63540
movq %rax, -0x5d40(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x5c34(%rbp), %rsi
callq 0x67200
movq -0x5d40(%rbp), %rcx
movq %rcx, (%rax)
cmpl $0x1, -0x24(%rbp)
jle 0x5e5a5
movq -0x8(%rbp), %rax
movl 0x43c8(%rax), %eax
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x5e5a5
movq -0x18(%rbp), %rax
movq %rax, -0x5d58(%rbp)
leaq 0x8aec3(%rip), %rdi     # 0xe93f8
xorl %eax, %eax
movl %eax, %esi
callq 0x63540
movq -0x5d58(%rbp), %rdi
movq %rax, -0x5c80(%rbp)
leaq -0x5c80(%rbp), %rsi
callq 0x671d0
leaq 0x8ae99(%rip), %rdi     # 0xe93f8
xorl %eax, %eax
movl %eax, %esi
callq 0x63540
movl 0x210(%rax), %eax
movl %eax, -0x5c34(%rbp)
leaq 0x8ae7d(%rip), %rdi     # 0xe93f8
xorl %eax, %eax
movl %eax, %esi
callq 0x63540
movq %rax, -0x5d50(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x5c34(%rbp), %rsi
callq 0x67200
movq -0x5d50(%rbp), %rcx
movq %rcx, (%rax)
movl $0x0, -0x5c84(%rbp)
movl -0x5c84(%rbp), %eax
leaq 0x89484(%rip), %rcx     # 0xe7a40
cmpl (%rcx), %eax
jge 0x5eede
movslq -0x5c84(%rbp), %rcx
leaq 0x1ab7429e(%rip), %rax  # 0x1abd2870
movl (%rax,%rcx,4), %eax
movl %eax, -0x5c88(%rbp)
movq -0x8(%rbp), %rdi
movl -0x5c88(%rbp), %esi
movl -0xc(%rbp), %edx
callq 0x9d0b0
testb $0x1, %al
jne 0x5e5f6
jmp 0x5eec8
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x5c88(%rbp), %edx
leaq -0x5c30(%rbp), %rcx
callq 0xa7480
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x5c88(%rbp), %edx
leaq -0x5c30(%rbp), %rcx
callq 0xa7870
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x5c88(%rbp), %edx
leaq -0x5c30(%rbp), %rcx
callq 0xa79e0
cmpl $0x1, -0x24(%rbp)
jle 0x5e69e
movq -0x8(%rbp), %rax
movl 0x43c8(%rax), %eax
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x5e69e
movq -0x18(%rbp), %rax
movslq -0x5c88(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x5d60(%rbp)
leaq 0x8ad7d(%rip), %rdi     # 0xe93f8
xorl %eax, %eax
movl %eax, %esi
callq 0x63540
movq -0x5d60(%rbp), %rdi
movq %rax, -0x5c90(%rbp)
leaq -0x5c90(%rbp), %rsi
callq 0x671d0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x5c30(%rbp), %rcx
movl -0x5c88(%rbp), %r9d
leaq 0x8ac1d(%rip), %rdx     # 0xe92d8
xorl %r8d, %r8d
callq 0x5f470
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x5c30(%rbp), %rcx
movl -0x5c88(%rbp), %r9d
leaq 0x8ac10(%rip), %rdx     # 0xe92f0
movl $0x1, %r8d
callq 0x5f470
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x5c30(%rbp), %rcx
movl -0x5c88(%rbp), %r9d
leaq 0x8ac00(%rip), %rdx     # 0xe9308
movl $0x2, %r8d
callq 0x5f470
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x5c30(%rbp), %rcx
movl -0x5c88(%rbp), %r9d
leaq 0x8abf0(%rip), %rdx     # 0xe9320
movl $0x3, %r8d
callq 0x5f470
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x5c30(%rbp), %rcx
movl -0x5c88(%rbp), %r9d
leaq 0x8abe0(%rip), %rdx     # 0xe9338
movl $0x4, %r8d
callq 0x5f470
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x5c30(%rbp), %rcx
movl -0x5c88(%rbp), %r9d
leaq 0x8abd0(%rip), %rdx     # 0xe9350
movl $0x5, %r8d
callq 0x5f470
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x5c30(%rbp), %rcx
movl -0x5c88(%rbp), %r9d
leaq 0x8abc0(%rip), %rdx     # 0xe9368
movl $0x6, %r8d
callq 0x5f470
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x5c88(%rbp), %ecx
movl -0x28(%rbp), %r8d
movl -0x5c64(%rbp), %r9d
leaq 0x8abad(%rip), %rdx     # 0xe9380
callq 0x5f5c0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x5c88(%rbp), %ecx
movl -0x2c(%rbp), %r8d
movl -0x5c64(%rbp), %r9d
leaq 0x8aba0(%rip), %rdx     # 0xe9398
callq 0x5f5c0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x5c88(%rbp), %ecx
movl -0x30(%rbp), %r8d
movl -0x5c64(%rbp), %r9d
leaq 0x8ab93(%rip), %rdx     # 0xe93b0
callq 0x5f5c0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x5c88(%rbp), %ecx
movl -0x34(%rbp), %r8d
movl -0x5c64(%rbp), %r9d
leaq 0x8ab86(%rip), %rdx     # 0xe93c8
callq 0x5f5c0
movq -0x18(%rbp), %rax
movslq -0x5c88(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x5d68(%rbp)
movslq -0x5c88(%rbp), %rcx
leaq 0x1ab1f862(%rip), %rax  # 0x1ab7e0d0
movslq (%rax,%rcx,4), %rsi
leaq 0x8aa47(%rip), %rdi     # 0xe92c0
callq 0x63540
movq -0x5d68(%rbp), %rdi
movq %rax, -0x5c98(%rbp)
leaq -0x5c98(%rbp), %rsi
callq 0x671d0
movslq -0x5c88(%rbp), %rcx
leaq 0x1ab1f82a(%rip), %rax  # 0x1ab7e0d0
movslq (%rax,%rcx,4), %rsi
leaq 0x8aa0f(%rip), %rdi     # 0xe92c0
callq 0x63540
movl 0x210(%rax), %eax
movl %eax, -0x5c34(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x5c34(%rbp), %rsi
callq 0x672e0
cmpq $0x0, %rax
jne 0x5e917
movslq -0x5c88(%rbp), %rcx
leaq 0x1ab1f7ea(%rip), %rax  # 0x1ab7e0d0
movslq (%rax,%rcx,4), %rsi
leaq 0x8a9cf(%rip), %rdi     # 0xe92c0
callq 0x63540
movq %rax, -0x5d70(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x5c34(%rbp), %rsi
callq 0x67200
movq -0x5d70(%rbp), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
addq $0x4748, %rdi           # imm = 0x4748
movslq -0x5c88(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
leaq -0x5c60(%rbp), %rsi
callq 0x97cc0
movq -0x5c40(%rbp), %rdi
movl -0x5c88(%rbp), %esi
callq 0x93d30
movl %eax, %eax
movl %eax, %esi
leaq 0x8a877(%rip), %rdi     # 0xe91d0
callq 0x63590
movl (%rax), %eax
movl %eax, -0x5c9c(%rbp)
movq -0x5c40(%rbp), %rdi
movl -0x5c88(%rbp), %esi
callq 0x93d60
movl %eax, %eax
movl %eax, %esi
leaq 0x8a865(%rip), %rdi     # 0xe91e8
callq 0x63590
movl (%rax), %eax
movl %eax, -0x5ca0(%rbp)
leaq 0x8a869(%rip), %rdi     # 0xe9200
callq 0x67340
movq %rax, %rdi
movq -0x5c58(%rbp), %rsi
callq 0x98220
movl %eax, -0x5ca4(%rbp)
leaq 0x8a860(%rip), %rdi     # 0xe9218
callq 0x67340
movq %rax, %rdi
movq -0x5c50(%rbp), %rsi
callq 0x98220
movl %eax, -0x5ca8(%rbp)
leaq 0x8a857(%rip), %rdi     # 0xe9230
callq 0x67340
movq %rax, %rdi
movq -0x5c48(%rbp), %rsi
callq 0x98220
movl %eax, -0x5cac(%rbp)
xorl %eax, %eax
cmpl $-0x1, -0x5cac(%rbp)
movb %al, -0x5d71(%rbp)
je 0x5ea37
movslq -0x5cac(%rbp), %rsi
leaq 0x8aad6(%rip), %rdi     # 0xe94e8
callq 0x67360
movq %rax, -0x5cc0(%rbp)
movq %rdx, -0x5cb8(%rbp)
leaq -0x5cc0(%rbp), %rdi
callq 0x673c0
movb %al, -0x5d71(%rbp)
movb -0x5d71(%rbp), %al
testb $0x1, %al
jne 0x5ea46
jmp 0x5eafa
movq -0x18(%rbp), %rax
movslq -0x5c88(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x5d80(%rbp)
movslq -0x5cac(%rbp), %rsi
leaq 0x8a83b(%rip), %rdi     # 0xe92a8
callq 0x63540
movq -0x5d80(%rbp), %rdi
movq %rax, -0x5cc8(%rbp)
leaq -0x5cc8(%rbp), %rsi
callq 0x671d0
movslq -0x5cac(%rbp), %rsi
leaq 0x8a80e(%rip), %rdi     # 0xe92a8
callq 0x63540
movl 0x210(%rax), %eax
movl %eax, -0x5c34(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x5c34(%rbp), %rsi
callq 0x672e0
cmpq $0x0, %rax
jne 0x5eaf5
movslq -0x5cac(%rbp), %rsi
leaq 0x8a7d9(%rip), %rdi     # 0xe92a8
callq 0x63540
movq %rax, -0x5d88(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x5c34(%rbp), %rsi
callq 0x67200
movq -0x5d88(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x5eec6
xorl %eax, %eax
cmpl $-0x1, -0x5ca8(%rbp)
movb %al, -0x5d89(%rbp)
je 0x5eb3e
movslq -0x5ca8(%rbp), %rsi
leaq 0x8a9a7(%rip), %rdi     # 0xe94c0
callq 0x67360
movq %rax, -0x5cd8(%rbp)
movq %rdx, -0x5cd0(%rbp)
leaq -0x5cd8(%rbp), %rdi
callq 0x673c0
movb %al, -0x5d89(%rbp)
movb -0x5d89(%rbp), %al
testb $0x1, %al
jne 0x5eb4d
jmp 0x5ec01
movq -0x18(%rbp), %rax
movslq -0x5c88(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x5d98(%rbp)
movslq -0x5ca8(%rbp), %rsi
leaq 0x8a71c(%rip), %rdi     # 0xe9290
callq 0x63540
movq -0x5d98(%rbp), %rdi
movq %rax, -0x5ce0(%rbp)
leaq -0x5ce0(%rbp), %rsi
callq 0x671d0
movslq -0x5ca8(%rbp), %rsi
leaq 0x8a6ef(%rip), %rdi     # 0xe9290
callq 0x63540
movl 0x210(%rax), %eax
movl %eax, -0x5c34(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x5c34(%rbp), %rsi
callq 0x672e0
cmpq $0x0, %rax
jne 0x5ebfc
movslq -0x5ca8(%rbp), %rsi
leaq 0x8a6ba(%rip), %rdi     # 0xe9290
callq 0x63540
movq %rax, -0x5da0(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x5c34(%rbp), %rsi
callq 0x67200
movq -0x5da0(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x5eec4
xorl %eax, %eax
cmpl $-0x1, -0x5ca4(%rbp)
movb %al, -0x5da1(%rbp)
je 0x5ec45
movslq -0x5ca4(%rbp), %rsi
leaq 0x8a878(%rip), %rdi     # 0xe9498
callq 0x67360
movq %rax, -0x5cf0(%rbp)
movq %rdx, -0x5ce8(%rbp)
leaq -0x5cf0(%rbp), %rdi
callq 0x673c0
movb %al, -0x5da1(%rbp)
movb -0x5da1(%rbp), %al
testb $0x1, %al
jne 0x5ec54
jmp 0x5ed08
movq -0x18(%rbp), %rax
movslq -0x5c88(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x5db0(%rbp)
movslq -0x5ca4(%rbp), %rsi
leaq 0x8a5fd(%rip), %rdi     # 0xe9278
callq 0x63540
movq -0x5db0(%rbp), %rdi
movq %rax, -0x5cf8(%rbp)
leaq -0x5cf8(%rbp), %rsi
callq 0x671d0
movslq -0x5ca4(%rbp), %rsi
leaq 0x8a5d0(%rip), %rdi     # 0xe9278
callq 0x63540
movl 0x210(%rax), %eax
movl %eax, -0x5c34(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x5c34(%rbp), %rsi
callq 0x672e0
cmpq $0x0, %rax
jne 0x5ed03
movslq -0x5ca4(%rbp), %rsi
leaq 0x8a59b(%rip), %rdi     # 0xe9278
callq 0x63540
movq %rax, -0x5db8(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x5c34(%rbp), %rsi
callq 0x67200
movq -0x5db8(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x5eec2
xorl %eax, %eax
cmpl $0x0, -0x5ca0(%rbp)
movb %al, -0x5db9(%rbp)
je 0x5ed4c
movslq -0x5ca0(%rbp), %rsi
leaq 0x8a749(%rip), %rdi     # 0xe9470
callq 0x67360
movq %rax, -0x5d08(%rbp)
movq %rdx, -0x5d00(%rbp)
leaq -0x5d08(%rbp), %rdi
callq 0x673c0
movb %al, -0x5db9(%rbp)
movb -0x5db9(%rbp), %al
testb $0x1, %al
jne 0x5ed5b
jmp 0x5ee0f
movq -0x18(%rbp), %rax
movslq -0x5c88(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x5dc8(%rbp)
movslq -0x5ca0(%rbp), %rsi
leaq 0x8a4de(%rip), %rdi     # 0xe9260
callq 0x63540
movq -0x5dc8(%rbp), %rdi
movq %rax, -0x5d10(%rbp)
leaq -0x5d10(%rbp), %rsi
callq 0x671d0
movslq -0x5ca0(%rbp), %rsi
leaq 0x8a4b1(%rip), %rdi     # 0xe9260
callq 0x63540
movl 0x210(%rax), %eax
movl %eax, -0x5c34(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x5c34(%rbp), %rsi
callq 0x672e0
cmpq $0x0, %rax
jne 0x5ee0a
movslq -0x5ca0(%rbp), %rsi
leaq 0x8a47c(%rip), %rdi     # 0xe9260
callq 0x63540
movq %rax, -0x5dd0(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x5c34(%rbp), %rsi
callq 0x67200
movq -0x5dd0(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x5eec0
movq -0x18(%rbp), %rax
movslq -0x5c88(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x5dd8(%rbp)
movslq -0x5c9c(%rbp), %rsi
leaq 0x8a412(%rip), %rdi     # 0xe9248
callq 0x63540
movq -0x5dd8(%rbp), %rdi
movq %rax, -0x5d18(%rbp)
leaq -0x5d18(%rbp), %rsi
callq 0x671d0
movslq -0x5c9c(%rbp), %rsi
leaq 0x8a3e5(%rip), %rdi     # 0xe9248
callq 0x63540
movl 0x210(%rax), %eax
movl %eax, -0x5c34(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x5c34(%rbp), %rsi
callq 0x672e0
cmpq $0x0, %rax
jne 0x5eebe
movslq -0x5c9c(%rbp), %rsi
leaq 0x8a3b0(%rip), %rdi     # 0xe9248
callq 0x63540
movq %rax, -0x5de0(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x5c34(%rbp), %rsi
callq 0x67200
movq -0x5de0(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x5eec0
jmp 0x5eec2
jmp 0x5eec4
jmp 0x5eec6
jmp 0x5eec8
jmp 0x5eeca
movl -0x5c84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c84(%rbp)
jmp 0x5e5af
addq $0x5de0, %rsp           # imm = 0x5DE0
popq %rbp
retq
nopw (%rax,%rax)