// File: kobanium[P]Ray/src/learn/FactorizationMachines.cpp
// Function: CalculateMoveScore(game_info_t*, int, unsigned int const*, int)
static double
CalculateMoveScore( game_info_t *game, const int pos, const unsigned int tactical_features[], const int distance_index )
{
  const int moves = game->moves;
  const int pm1 = (moves > 1) ? game->record[moves - 1].pos : PASS;
  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;
  int dis = 0;
  std::vector<btfm_t*> active_features;
  pattern_hash_t hash_pat;

  if (pos == PASS) {
    if (moves > 1 && pm1 == PASS) {
      active_features.push_back(&pass[UCT_PASS_AFTER_PASS]);
    } else {
      active_features.push_back(&pass[UCT_PASS_AFTER_MOVE]);
    }
  } else {
    if (pm1 != PASS) {
      dis = DIS(pos, pm1);
      if (dis >= MOVE_DISTANCE_MAX - 1) {
        dis = MOVE_DISTANCE_MAX - 1;
      }
      active_features.push_back(&move_distance_1[dis + distance_index]);
    }
    if (pm2 != PASS) {
      dis = DIS(pos, pm2);
      if (dis >= MOVE_DISTANCE_MAX - 1) {
        dis = MOVE_DISTANCE_MAX - 1;
      }
      active_features.push_back(&move_distance_2[dis + distance_index]);
    }
    if (pm3 != PASS) {
      dis = DIS(pos, pm3);
      if (dis >= MOVE_DISTANCE_MAX - 1) {
        dis = MOVE_DISTANCE_MAX - 1;
      }
      active_features.push_back(&move_distance_3[dis + distance_index]);
    }
    if (pm4 != PASS) {
      dis = DIS(pos, pm4);
      if (dis >= MOVE_DISTANCE_MAX - 1) {
        dis = MOVE_DISTANCE_MAX - 1;
      }
      active_features.push_back(&move_distance_4[dis + distance_index]);
    }

    const unsigned int *features = &tactical_features[pos * UCT_INDEX_MAX];

    if (features[UCT_CAPTURE_INDEX]        > 0) active_features.push_back(&capture[features[UCT_CAPTURE_INDEX]]);
    if (features[UCT_SAVE_EXTENSION_INDEX] > 0) active_features.push_back(&save_extension[features[UCT_SAVE_EXTENSION_INDEX]]);
    if (features[UCT_ATARI_INDEX]          > 0) active_features.push_back(&atari[features[UCT_ATARI_INDEX]]);
    if (features[UCT_EXTENSION_INDEX]      > 0) active_features.push_back(&extension[features[UCT_EXTENSION_INDEX]]);
    if (features[UCT_DAME_INDEX]           > 0) active_features.push_back(&dame[features[UCT_DAME_INDEX]]);
    if (features[UCT_CONNECT_INDEX]        > 0) active_features.push_back(&connect[features[UCT_CONNECT_INDEX]]);
    if (features[UCT_THROW_IN_INDEX]       > 0) active_features.push_back(&throw_in[features[UCT_THROW_IN_INDEX]]);

    active_features.push_back(&pos_id[board_pos_id[pos]]);

    PatternHash(&game->pat[pos], &hash_pat);
    const int pat_3x3 = pat3_index[Pat3(game->pat, pos)];
    const int pat_md2 = md2_index[MD2(game->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]) {
      active_features.push_back(&md5[md5_idx]);
    } else if (md4_idx != -1 && md4_target[md4_idx]) {
      active_features.push_back(&md4[md4_idx]);
    } else if (md3_idx != -1 && md3_target[md3_idx]) {
      active_features.push_back(&md3[md3_idx]);
    } else if (pat_md2 != 0 && md2_target[pat_md2]) {
      active_features.push_back(&md2[pat_md2]);
    } else {
      active_features.push_back(&pat3[pat_3x3]);
    }
  }

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

  const int feature_num = active_features.size();
  const double gamma = CalculateFirstTerm(active_features, feature_num);
  double theta = feature_num > 1 ? 1.0 : 0.0;

  for (int i = 0; i < feature_num - 1; i++) {
    for (int j = i + 1; j < feature_num; j++) {
      theta *= CalculateSecondTerm(active_features, i, j);
    }
  }

  return gamma + theta;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movl 0x43b0(%rax), %eax
movl %eax, -0x20(%rbp)
cmpl $0x1, -0x20(%rbp)
jle 0x5fe8b
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x1a4(%rbp)
jmp 0x5fe95
xorl %eax, %eax
movl %eax, -0x1a4(%rbp)
jmp 0x5fe95
movl -0x1a4(%rbp), %eax
movl %eax, -0x24(%rbp)
cmpl $0x2, -0x20(%rbp)
jle 0x5fec3
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x1a8(%rbp)
jmp 0x5fecd
xorl %eax, %eax
movl %eax, -0x1a8(%rbp)
jmp 0x5fecd
movl -0x1a8(%rbp), %eax
movl %eax, -0x28(%rbp)
cmpl $0x3, -0x20(%rbp)
jle 0x5fefb
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x3, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x1ac(%rbp)
jmp 0x5ff05
xorl %eax, %eax
movl %eax, -0x1ac(%rbp)
jmp 0x5ff05
movl -0x1ac(%rbp), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x4, -0x20(%rbp)
jle 0x5ff33
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x4, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x1b0(%rbp)
jmp 0x5ff3d
xorl %eax, %eax
movl %eax, -0x1b0(%rbp)
jmp 0x5ff3d
movl -0x1b0(%rbp), %eax
movl %eax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x66cb0
cmpl $0x0, -0xc(%rbp)
jne 0x5ffdb
cmpl $0x1, -0x20(%rbp)
jle 0x5ffab
cmpl $0x0, -0x24(%rbp)
jne 0x5ffab
leaq 0x89471(%rip), %rdi     # 0xe93e0
movl $0x1, %esi
callq 0x63540
movq %rax, -0x78(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x671d0
jmp 0x5ff8c
jmp 0x5ffd6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x67010
jmp 0x609bb
leaq 0x8942e(%rip), %rdi     # 0xe93e0
xorl %eax, %eax
movl %eax, %esi
callq 0x63540
movq %rax, -0x90(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x671d0
jmp 0x5ffd4
jmp 0x5ffd6
jmp 0x6084e
cmpl $0x0, -0x24(%rbp)
je 0x60084
movslq -0xc(%rbp), %rcx
leaq 0x1ab1ee10(%rip), %rax  # 0x1ab7ee00
movl (%rax,%rcx,4), %eax
movslq -0x24(%rbp), %rdx
leaq 0x1ab1ee02(%rip), %rcx  # 0x1ab7ee00
subl (%rcx,%rdx,4), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movslq %eax, %rcx
leaq 0x1ab722ae(%rip), %rax  # 0x1abd22c0
imulq $0x4c, %rcx, %rcx
addq %rcx, %rax
movslq -0xc(%rbp), %rdx
leaq 0x1ab1fb0c(%rip), %rcx  # 0x1ab7fb30
movl (%rcx,%rdx,4), %ecx
movslq -0x24(%rbp), %rsi
leaq 0x1ab1fafe(%rip), %rdx  # 0x1ab7fb30
subl (%rdx,%rsi,4), %ecx
movl %ecx, %edx
negl %edx
cmovnsl %edx, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
cmpl $0xf, -0x34(%rbp)
jl 0x60052
movl $0xf, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl -0x1c(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
leaq 0x8931c(%rip), %rdi     # 0xe9380
callq 0x63540
movq %rax, -0x98(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x671d0
jmp 0x60082
jmp 0x60084
cmpl $0x0, -0x28(%rbp)
je 0x6012d
movslq -0xc(%rbp), %rcx
leaq 0x1ab1ed67(%rip), %rax  # 0x1ab7ee00
movl (%rax,%rcx,4), %eax
movslq -0x28(%rbp), %rdx
leaq 0x1ab1ed59(%rip), %rcx  # 0x1ab7ee00
subl (%rcx,%rdx,4), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movslq %eax, %rcx
leaq 0x1ab72205(%rip), %rax  # 0x1abd22c0
imulq $0x4c, %rcx, %rcx
addq %rcx, %rax
movslq -0xc(%rbp), %rdx
leaq 0x1ab1fa63(%rip), %rcx  # 0x1ab7fb30
movl (%rcx,%rdx,4), %ecx
movslq -0x28(%rbp), %rsi
leaq 0x1ab1fa55(%rip), %rdx  # 0x1ab7fb30
subl (%rdx,%rsi,4), %ecx
movl %ecx, %edx
negl %edx
cmovnsl %edx, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
cmpl $0xf, -0x34(%rbp)
jl 0x600fb
movl $0xf, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl -0x1c(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
leaq 0x8928b(%rip), %rdi     # 0xe9398
callq 0x63540
movq %rax, -0xa0(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x671d0
jmp 0x6012b
jmp 0x6012d
cmpl $0x0, -0x2c(%rbp)
je 0x601d6
movslq -0xc(%rbp), %rcx
leaq 0x1ab1ecbe(%rip), %rax  # 0x1ab7ee00
movl (%rax,%rcx,4), %eax
movslq -0x2c(%rbp), %rdx
leaq 0x1ab1ecb0(%rip), %rcx  # 0x1ab7ee00
subl (%rcx,%rdx,4), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movslq %eax, %rcx
leaq 0x1ab7215c(%rip), %rax  # 0x1abd22c0
imulq $0x4c, %rcx, %rcx
addq %rcx, %rax
movslq -0xc(%rbp), %rdx
leaq 0x1ab1f9ba(%rip), %rcx  # 0x1ab7fb30
movl (%rcx,%rdx,4), %ecx
movslq -0x2c(%rbp), %rsi
leaq 0x1ab1f9ac(%rip), %rdx  # 0x1ab7fb30
subl (%rdx,%rsi,4), %ecx
movl %ecx, %edx
negl %edx
cmovnsl %edx, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
cmpl $0xf, -0x34(%rbp)
jl 0x601a4
movl $0xf, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl -0x1c(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
leaq 0x891fa(%rip), %rdi     # 0xe93b0
callq 0x63540
movq %rax, -0xa8(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x671d0
jmp 0x601d4
jmp 0x601d6
cmpl $0x0, -0x30(%rbp)
je 0x6027f
movslq -0xc(%rbp), %rcx
leaq 0x1ab1ec15(%rip), %rax  # 0x1ab7ee00
movl (%rax,%rcx,4), %eax
movslq -0x30(%rbp), %rdx
leaq 0x1ab1ec07(%rip), %rcx  # 0x1ab7ee00
subl (%rcx,%rdx,4), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movslq %eax, %rcx
leaq 0x1ab720b3(%rip), %rax  # 0x1abd22c0
imulq $0x4c, %rcx, %rcx
addq %rcx, %rax
movslq -0xc(%rbp), %rdx
leaq 0x1ab1f911(%rip), %rcx  # 0x1ab7fb30
movl (%rcx,%rdx,4), %ecx
movslq -0x30(%rbp), %rsi
leaq 0x1ab1f903(%rip), %rdx  # 0x1ab7fb30
subl (%rdx,%rsi,4), %ecx
movl %ecx, %edx
negl %edx
cmovnsl %edx, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
cmpl $0xf, -0x34(%rbp)
jl 0x6024d
movl $0xf, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl -0x1c(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
leaq 0x89169(%rip), %rdi     # 0xe93c8
callq 0x63540
movq %rax, -0xb0(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x671d0
jmp 0x6027d
jmp 0x6027f
movq -0x18(%rbp), %rax
imull $0x7, -0xc(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
cmpl $0x0, (%rax)
jbe 0x602d6
movq -0xb8(%rbp), %rax
movl (%rax), %eax
movl %eax, %esi
leaq 0x89022(%rip), %rdi     # 0xe92d8
callq 0x63540
movq %rax, -0xc0(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x671d0
jmp 0x602d4
jmp 0x602d6
movq -0xb8(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jbe 0x60316
movq -0xb8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, %esi
leaq 0x88ffa(%rip), %rdi     # 0xe92f0
callq 0x63540
movq %rax, -0xc8(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x671d0
jmp 0x60314
jmp 0x60316
movq -0xb8(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jbe 0x60356
movq -0xb8(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %esi
leaq 0x88fd2(%rip), %rdi     # 0xe9308
callq 0x63540
movq %rax, -0xd0(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x671d0
jmp 0x60354
jmp 0x60356
movq -0xb8(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jbe 0x60396
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, %esi
leaq 0x88faa(%rip), %rdi     # 0xe9320
callq 0x63540
movq %rax, -0xd8(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x671d0
jmp 0x60394
jmp 0x60396
movq -0xb8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jbe 0x603d6
movq -0xb8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %esi
leaq 0x88f82(%rip), %rdi     # 0xe9338
callq 0x63540
movq %rax, -0xe0(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x671d0
jmp 0x603d4
jmp 0x603d6
movq -0xb8(%rbp), %rax
cmpl $0x0, 0x14(%rax)
jbe 0x60416
movq -0xb8(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, %esi
leaq 0x88f5a(%rip), %rdi     # 0xe9350
callq 0x63540
movq %rax, -0xe8(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x671d0
jmp 0x60414
jmp 0x60416
movq -0xb8(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jbe 0x60456
movq -0xb8(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, %esi
leaq 0x88f32(%rip), %rdi     # 0xe9368
callq 0x63540
movq %rax, -0xf0(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x671d0
jmp 0x60454
jmp 0x60456
movslq -0xc(%rbp), %rcx
leaq 0x1ab1dc6f(%rip), %rax  # 0x1ab7e0d0
movslq (%rax,%rcx,4), %rsi
leaq 0x88e54(%rip), %rdi     # 0xe92c0
callq 0x63540
movq %rax, -0xf8(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x671d0
jmp 0x6048a
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq 0x4748(%rax,%rcx,8), %rdi
leaq -0x70(%rbp), %rsi
callq 0x97cc0
jmp 0x604a9
movq -0x8(%rbp), %rdi
addq $0x4748, %rdi           # imm = 0x4748
movl -0xc(%rbp), %esi
callq 0x93d30
movl %eax, -0x1b4(%rbp)
jmp 0x604c4
movl -0x1b4(%rbp), %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x88cfb(%rip), %rdi     # 0xe91d0
callq 0x63590
movl (%rax), %eax
movl %eax, -0xfc(%rbp)
movq -0x8(%rbp), %rdi
addq $0x4748, %rdi           # imm = 0x4748
movl -0xc(%rbp), %esi
callq 0x93d60
movl %eax, -0x1b8(%rbp)
jmp 0x604fd
movl -0x1b8(%rbp), %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x88cda(%rip), %rdi     # 0xe91e8
callq 0x63590
movl (%rax), %eax
movl %eax, -0x100(%rbp)
leaq 0x88cde(%rip), %rdi     # 0xe9200
callq 0x67340
movq %rax, %rdi
movq -0x68(%rbp), %rsi
callq 0x98220
movl %eax, -0x1bc(%rbp)
jmp 0x6053b
movl -0x1bc(%rbp), %eax
movl %eax, -0x104(%rbp)
leaq 0x88cca(%rip), %rdi     # 0xe9218
callq 0x67340
movq %rax, %rdi
movq -0x60(%rbp), %rsi
callq 0x98220
movl %eax, -0x1c0(%rbp)
jmp 0x60567
movl -0x1c0(%rbp), %eax
movl %eax, -0x108(%rbp)
leaq 0x88cb6(%rip), %rdi     # 0xe9230
callq 0x67340
movq %rax, %rdi
movq -0x58(%rbp), %rsi
callq 0x98220
movl %eax, -0x1c4(%rbp)
jmp 0x60593
movl -0x1c4(%rbp), %eax
movl %eax, -0x10c(%rbp)
xorl %eax, %eax
cmpl $-0x1, -0x10c(%rbp)
movb %al, -0x1c5(%rbp)
je 0x60601
movslq -0x10c(%rbp), %rsi
leaq 0x88f2a(%rip), %rdi     # 0xe94e8
callq 0x67360
movq %rdx, -0x1d8(%rbp)
movq %rax, -0x1d0(%rbp)
jmp 0x605d3
movq -0x1d8(%rbp), %rax
movq -0x1d0(%rbp), %rcx
movq %rcx, -0x120(%rbp)
movq %rax, -0x118(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x673c0
movb %al, -0x1c5(%rbp)
movb -0x1c5(%rbp), %al
testb $0x1, %al
jne 0x6060d
jmp 0x6063e
movslq -0x10c(%rbp), %rsi
leaq 0x88c8d(%rip), %rdi     # 0xe92a8
callq 0x63540
movq %rax, -0x128(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x671d0
jmp 0x60639
jmp 0x6084c
xorl %eax, %eax
cmpl $-0x1, -0x108(%rbp)
movb %al, -0x1d9(%rbp)
je 0x606a0
movslq -0x108(%rbp), %rsi
leaq 0x88e63(%rip), %rdi     # 0xe94c0
callq 0x67360
movq %rdx, -0x1f0(%rbp)
movq %rax, -0x1e8(%rbp)
jmp 0x60672
movq -0x1f0(%rbp), %rax
movq -0x1e8(%rbp), %rcx
movq %rcx, -0x138(%rbp)
movq %rax, -0x130(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x673c0
movb %al, -0x1d9(%rbp)
movb -0x1d9(%rbp), %al
testb $0x1, %al
jne 0x606ac
jmp 0x606dd
movslq -0x108(%rbp), %rsi
leaq 0x88bd6(%rip), %rdi     # 0xe9290
callq 0x63540
movq %rax, -0x140(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x671d0
jmp 0x606d8
jmp 0x6084a
xorl %eax, %eax
cmpl $-0x1, -0x104(%rbp)
movb %al, -0x1f1(%rbp)
je 0x6073f
movslq -0x104(%rbp), %rsi
leaq 0x88d9c(%rip), %rdi     # 0xe9498
callq 0x67360
movq %rdx, -0x208(%rbp)
movq %rax, -0x200(%rbp)
jmp 0x60711
movq -0x208(%rbp), %rax
movq -0x200(%rbp), %rcx
movq %rcx, -0x150(%rbp)
movq %rax, -0x148(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x673c0
movb %al, -0x1f1(%rbp)
movb -0x1f1(%rbp), %al
testb $0x1, %al
jne 0x6074b
jmp 0x6077c
movslq -0x104(%rbp), %rsi
leaq 0x88b1f(%rip), %rdi     # 0xe9278
callq 0x63540
movq %rax, -0x158(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x671d0
jmp 0x60777
jmp 0x60848
xorl %eax, %eax
cmpl $0x0, -0x100(%rbp)
movb %al, -0x209(%rbp)
je 0x607de
movslq -0x100(%rbp), %rsi
leaq 0x88cd5(%rip), %rdi     # 0xe9470
callq 0x67360
movq %rdx, -0x220(%rbp)
movq %rax, -0x218(%rbp)
jmp 0x607b0
movq -0x220(%rbp), %rax
movq -0x218(%rbp), %rcx
movq %rcx, -0x168(%rbp)
movq %rax, -0x160(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x673c0
movb %al, -0x209(%rbp)
movb -0x209(%rbp), %al
testb $0x1, %al
jne 0x607ea
jmp 0x60818
movslq -0x100(%rbp), %rsi
leaq 0x88a68(%rip), %rdi     # 0xe9260
callq 0x63540
movq %rax, -0x170(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x671d0
jmp 0x60816
jmp 0x60846
movslq -0xfc(%rbp), %rsi
leaq 0x88a22(%rip), %rdi     # 0xe9248
callq 0x63540
movq %rax, -0x178(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x671d0
jmp 0x60844
jmp 0x60846
jmp 0x60848
jmp 0x6084a
jmp 0x6084c
jmp 0x6084e
cmpl $0x1, -0x20(%rbp)
jle 0x6089a
movq -0x8(%rbp), %rax
movl 0x43c8(%rax), %eax
movq -0x8(%rbp), %rcx
movl 0x43b0(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x6089a
leaq 0x88b82(%rip), %rdi     # 0xe93f8
xorl %eax, %eax
movl %eax, %esi
callq 0x63540
movq %rax, -0x180(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x671d0
jmp 0x60898
jmp 0x6089a
leaq -0x50(%rbp), %rdi
callq 0x66cf0
movl %eax, -0x184(%rbp)
movl -0x184(%rbp), %esi
leaq -0x50(%rbp), %rdi
callq 0x5eef0
movsd %xmm0, -0x190(%rbp)
movl -0x184(%rbp), %eax
movsd 0x4b73a(%rip), %xmm0    # 0xac008
xorps %xmm1, %xmm1
movsd %xmm1, -0x230(%rbp)
cmpl $0x1, %eax
movsd %xmm0, -0x228(%rbp)
jg 0x608f6
movsd -0x230(%rbp), %xmm0
movsd %xmm0, -0x228(%rbp)
movsd -0x228(%rbp), %xmm0
movsd %xmm0, -0x198(%rbp)
movl $0x0, -0x19c(%rbp)
movl -0x19c(%rbp), %eax
movl -0x184(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x60989
movl -0x19c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a0(%rbp)
movl -0x1a0(%rbp), %eax
cmpl -0x184(%rbp), %eax
jge 0x60976
movl -0x19c(%rbp), %esi
movl -0x1a0(%rbp), %edx
leaq -0x50(%rbp), %rdi
callq 0x5ef50
mulsd -0x198(%rbp), %xmm0
movsd %xmm0, -0x198(%rbp)
movl -0x1a0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a0(%rbp)
jmp 0x60932
jmp 0x60978
movl -0x19c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x19c(%rbp)
jmp 0x60910
movsd -0x190(%rbp), %xmm0
addsd -0x198(%rbp), %xmm0
movsd %xmm0, -0x238(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x67010
movsd -0x238(%rbp), %xmm0
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x79b0
nopw %cs:(%rax,%rax)
nop