// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/mcts/Rating.cpp
// Function: OtherUpdate(game_info_t*, int, long long*, long long*, long long*, int, int*, bool*)
static void
OtherUpdate( game_info_t *game, int color, long long *sum_rate, long long sum_rate_row[], long long rate[], int update_num, int update[], bool flag[] )
{
  for (int i = 0; i < update_num; i++) {
    const int pos = update[i];
    if (flag[pos]) continue;

    if (game->candidates[pos]) {
      const bool self_atari_flag = CheckSelfAtariForSimulation(game, color, pos);

      // 元あったレートを消去
      *sum_rate -= rate[pos];
      sum_rate_row[board_y[pos]] -= rate[pos];

      // パターン、戦術的特徴、距離のγ値
      if (!self_atari_flag) {
        rate[pos] = 0;
      } else {
        CheckCaptureAndAtariForSimulation(game, color, pos);
        const double gamma = po_pattern[MD2(game->pat, pos)]
          * CalculateTacticalFeatures(&game->tactical_features[pos * ALL_MAX]);
        rate[pos] = static_cast<long long>(gamma) + 1;

        // 新たに計算したレートを代入
        *sum_rate += rate[pos];
        sum_rate_row[board_y[pos]] += rate[pos];
      }
    }
    ClearTacticalFeatures(&game->tactical_features[pos * ALL_MAX]);
    // 更新済みフラグを立てる
    flag[pos] = true;
  }
}

// Assembly:
testl %r9d, %r9d
jle 0x47be2
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r10
movq %rdi, %r12
movq 0x68(%rsp), %rdx
movq 0x60(%rsp), %rdi
leaq 0x4748(%r12), %rax
movq %rax, 0x20(%rsp)
leaq 0x97372(%r12), %r11
movl %r9d, %r9d
xorl %r14d, %r14d
leaq 0x1aac5f98(%rip), %r15  # 0x1ab0d9b0
movq %r11, 0x10(%rsp)
movq %r9, 0x8(%rsp)
movq %rcx, 0x18(%rsp)
movl %esi, 0x4(%rsp)
movslq (%rdi,%r14,4), %r13
cmpb $0x0, (%rdx,%r13)
jne 0x47bc8
cmpb $0x1, 0x96ce0(%r12,%r13)
jne 0x47ba8
movq %r12, %rdi
movl %r13d, %edx
movq %r8, %rbp
movq %r10, %rbx
callq 0x57e1b
movq (%rbp,%r13,8), %rcx
subq %rcx, (%rbx)
movq (%rbp,%r13,8), %rcx
movslq (%r15,%r13,4), %rdx
movq 0x18(%rsp), %rsi
subq %rcx, (%rsi,%rdx,8)
testb %al, %al
je 0x47b7a
movq %r12, %rdi
movl 0x4(%rsp), %esi
movl %r13d, %edx
callq 0x58300
movq 0x20(%rsp), %rdi
movl %r13d, %esi
callq 0x4f857
movq %rbx, %r10
movq %rbp, %r8
movl %eax, %eax
leaq 0x32279(%rip), %rcx     # 0x79d20
cvtss2sd (%rcx,%rax,4), %xmm0
leaq (%r13,%r13,2), %rax
movzbl 0x97372(%r12,%rax,2), %ecx
leaq 0x403227f(%rip), %rdx   # 0x4079d40
movss (%rdx,%rcx,4), %xmm1
movzbl 0x97373(%r12,%rax,2), %ecx
leaq 0x40322ba(%rip), %rdx   # 0x4079d90
mulss (%rdx,%rcx,4), %xmm1
movzbl 0x97374(%r12,%rax,2), %ecx
leaq 0x40322c5(%rip), %rdx   # 0x4079db0
mulss (%rdx,%rcx,4), %xmm1
movzbl 0x97375(%r12,%rax,2), %ecx
leaq 0x40322e0(%rip), %rdx   # 0x4079de0
mulss (%rdx,%rcx,4), %xmm1
movzbl 0x97376(%r12,%rax,2), %ecx
leaq 0x40322df(%rip), %rdx   # 0x4079df4
mulss (%rdx,%rcx,4), %xmm1
movzbl 0x97377(%r12,%rax,2), %eax
leaq 0x40322d6(%rip), %rcx   # 0x4079e00
mulss (%rcx,%rax,4), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
incq %rax
movq %rax, (%rbp,%r13,8)
addq %rax, (%rbx)
movq (%rbp,%r13,8), %rax
leaq 0x1aac5e5d(%rip), %r15  # 0x1ab0d9b0
movslq (%r15,%r13,4), %rcx
movq 0x18(%rsp), %rdx
addq %rax, (%rdx,%rcx,8)
movl 0x4(%rsp), %esi
movq 0x68(%rsp), %rdx
movq 0x60(%rsp), %rdi
movq 0x10(%rsp), %r11
movq 0x8(%rsp), %r9
jmp 0x47ba8
movq %rbx, %r10
movq %rbp, %r8
movq $0x0, (%rbp,%r13,8)
movl 0x4(%rsp), %esi
movq 0x68(%rsp), %rdx
movq 0x60(%rsp), %rdi
movq 0x10(%rsp), %r11
movq 0x8(%rsp), %r9
leaq 0x1aac5e08(%rip), %r15  # 0x1ab0d9b0
leaq (,%r13,2), %rax
addq %r13, %rax
movw $0x0, 0x4(%r11,%rax,2)
movl $0x0, (%r11,%rax,2)
movb $0x1, (%rdx,%r13)
incq %r14
cmpq %r14, %r9
jne 0x47a2b
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq