// File: kobanium[P]Ray/src/learn/MinorizationMaximization.cpp
// Function: UpdateParameters(int)
void
UpdateParameters( const int update_steps )
{
  if (update_steps == -1 || update_steps % MM_UPDATE_INTERVAL == 0) {
    // 3x3パターン
    UpdateGamma(pat3);

    for (int i = 0; i < PAT3_MAX; i++) {
      pat3[0][i].gamma = pat3[0][pat3_index[i]].gamma;
    }
    const std::size_t data_size = pat3[0].size();
    for (std::vector<mm_t> &vec : pat3) {
      for (std::size_t i = 0; i < data_size; i++) {
        vec[i].gamma = pat3[0][i].gamma;
      }
    }
  }

  if (update_steps == -1 || update_steps % MM_UPDATE_INTERVAL == 0) UpdateGamma(md2);
  if (update_steps == -1 || update_steps % MM_UPDATE_INTERVAL == 1) UpdateGamma(previous_distance);
  if (update_steps == -1 || update_steps % MM_UPDATE_INTERVAL == 2) UpdateGamma(capture);
  if (update_steps == -1 || update_steps % MM_UPDATE_INTERVAL == 3) UpdateGamma(save_extension);
  if (update_steps == -1 || update_steps % MM_UPDATE_INTERVAL == 4) UpdateGamma(atari);
  if (update_steps == -1 || update_steps % MM_UPDATE_INTERVAL == 5) UpdateGamma(extension);
  if (update_steps == -1 || update_steps % MM_UPDATE_INTERVAL == 6) UpdateGamma(dame);
  if (update_steps == -1 || update_steps % MM_UPDATE_INTERVAL == 7) UpdateGamma(throw_in);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x4(%rbp)
cmpl $-0x1, -0x4(%rbp)
je 0x73485
movl -0x4(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x735e2
leaq 0x76e6c(%rip), %rdi     # 0xea2f8
callq 0x76ad0
movl $0x0, -0x8(%rbp)
cmpl $0x10000, -0x8(%rbp)    # imm = 0x10000
jge 0x7350c
leaq 0x76e50(%rip), %rdi     # 0xea2f8
xorl %eax, %eax
movl %eax, %esi
callq 0x792c0
movq %rax, -0x48(%rbp)
movslq -0x8(%rbp), %rsi
leaq 0x76df0(%rip), %rdi     # 0xea2b0
callq 0x63590
movq -0x48(%rbp), %rdi
movslq (%rax), %rsi
callq 0x792e0
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
leaq 0x76e16(%rip), %rdi     # 0xea2f8
xorl %eax, %eax
movl %eax, %esi
callq 0x792c0
movq %rax, %rdi
movslq -0x8(%rbp), %rsi
callq 0x792e0
movsd -0x40(%rbp), %xmm0
movsd %xmm0, 0x18(%rax)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x73498
leaq 0x76de5(%rip), %rdi     # 0xea2f8
xorl %eax, %eax
movl %eax, %esi
callq 0x792c0
movq %rax, %rdi
callq 0x78990
movq %rax, -0x10(%rbp)
leaq 0x76dc9(%rip), %rax     # 0xea2f8
movq %rax, -0x18(%rbp)
leaq 0x76dbe(%rip), %rdi     # 0xea2f8
callq 0x77870
movq %rax, -0x20(%rbp)
leaq 0x76dae(%rip), %rdi     # 0xea2f8
callq 0x778a0
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x778d0
testb $0x1, %al
jne 0x73566
jmp 0x735e0
leaq -0x20(%rbp), %rdi
callq 0x77910
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x735d0
leaq 0x76d6c(%rip), %rdi     # 0xea2f8
xorl %eax, %eax
movl %eax, %esi
callq 0x792c0
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x792e0
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x792e0
movsd -0x50(%rbp), %xmm0
movsd %xmm0, 0x18(%rax)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x7357b
jmp 0x735d2
leaq -0x20(%rbp), %rdi
callq 0x77aa0
jmp 0x73553
jmp 0x735e2
cmpl $-0x1, -0x4(%rbp)
je 0x735f8
movl -0x4(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x73604
leaq 0x76d11(%rip), %rdi     # 0xea310
callq 0x76ad0
cmpl $-0x1, -0x4(%rbp)
je 0x7361a
movl -0x4(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x1, %edx
jne 0x73626
leaq 0x76cbf(%rip), %rdi     # 0xea2e0
callq 0x76ad0
cmpl $-0x1, -0x4(%rbp)
je 0x7363c
movl -0x4(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x2, %edx
jne 0x73648
leaq 0x76ce5(%rip), %rdi     # 0xea328
callq 0x76ad0
cmpl $-0x1, -0x4(%rbp)
je 0x7365e
movl -0x4(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x3, %edx
jne 0x7366a
leaq 0x76cdb(%rip), %rdi     # 0xea340
callq 0x76ad0
cmpl $-0x1, -0x4(%rbp)
je 0x73680
movl -0x4(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x4, %edx
jne 0x7368c
leaq 0x76cd1(%rip), %rdi     # 0xea358
callq 0x76ad0
cmpl $-0x1, -0x4(%rbp)
je 0x736a2
movl -0x4(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x5, %edx
jne 0x736ae
leaq 0x76cc7(%rip), %rdi     # 0xea370
callq 0x76ad0
cmpl $-0x1, -0x4(%rbp)
je 0x736c4
movl -0x4(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x6, %edx
jne 0x736d0
leaq 0x76cbd(%rip), %rdi     # 0xea388
callq 0x76ad0
cmpl $-0x1, -0x4(%rbp)
je 0x736e6
movl -0x4(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x7, %edx
jne 0x736f2
leaq 0x76cb3(%rip), %rdi     # 0xea3a0
callq 0x76ad0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)