// File: /workspace/github_cpp_makefile_star2_O3/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 0x47e56
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 0x1aac6d24(%rip), %r15  # 0x1ab0e9b0
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 0x47e3c
cmpb $0x1, 0x96ce0(%r12,%r13)
jne 0x47e1c
movq %r12, %rdi
movl %r13d, %edx
movq %r8, %rbp
movq %r10, %rbx
callq 0x5871b
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 0x47dee
movq %r12, %rdi
movl 0x4(%rsp), %esi
movl %r13d, %edx
callq 0x58c25
movq 0x20(%rsp), %rdi
movl %r13d, %esi
callq 0x4fc36
movq %rbx, %r10
movq %rbp, %r8
movl %eax, %eax
leaq 0x33005(%rip), %rcx     # 0x7ad20
cvtss2sd (%rcx,%rax,4), %xmm0
leaq (%r13,%r13,2), %rax
movzbl 0x97372(%r12,%rax,2), %ecx
leaq 0x403300b(%rip), %rdx   # 0x407ad40
movss (%rdx,%rcx,4), %xmm1
movzbl 0x97373(%r12,%rax,2), %ecx
leaq 0x4033046(%rip), %rdx   # 0x407ad90
mulss (%rdx,%rcx,4), %xmm1
movzbl 0x97374(%r12,%rax,2), %ecx
leaq 0x4033051(%rip), %rdx   # 0x407adb0
mulss (%rdx,%rcx,4), %xmm1
movzbl 0x97375(%r12,%rax,2), %ecx
leaq 0x403306c(%rip), %rdx   # 0x407ade0
mulss (%rdx,%rcx,4), %xmm1
movzbl 0x97376(%r12,%rax,2), %ecx
leaq 0x403306b(%rip), %rdx   # 0x407adf4
mulss (%rdx,%rcx,4), %xmm1
movzbl 0x97377(%r12,%rax,2), %eax
leaq 0x4033062(%rip), %rcx   # 0x407ae00
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 0x1aac6be9(%rip), %r15  # 0x1ab0e9b0
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 0x47e1c
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 0x1aac6b94(%rip), %r15  # 0x1ab0e9b0
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 0x47c9f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq