// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/hmm.c
// Function: iterate_em_hmm
double iterate_em_hmm(Hmmptr hmm, Instanceptr traindata, double *accumA, double *accumB, double **accumMix)
{
 /*!Last Changed 26.03.2007*/
 int i, j, k, t, f, m, p, f2 = 0, seqlen;
 int numrealfeatures = current_dataset->multifeaturecount - 1;
 Gaussianptr g;
 Gaussianmixtureptr gm;
 Multinomialptr mn;
 Instanceptr inst;
 double  loglikelihood;
 double  numeratorA, denominatorA, numeratorB, denominatorB, denominatorMC;
 double **alpha, **beta, **gamma, ***xi, *scale, ***gammaMix;
 matrix numeratorM, numeratorC;
 seqlen = frame_count(traindata);

 scale = (double *) safecalloc(seqlen, sizeof(double), "iterate_em_hmm", 13);
 alpha = (double **) safecalloc_2d(sizeof(double*), sizeof(double), seqlen, hmm->statecount, "iterate_em_hmm", 14);
 beta = (double **) safemalloc_2d(sizeof(double*), sizeof(double), seqlen, hmm->statecount, "iterate_em_hmm", 15);
 gamma = (double **) safemalloc_2d(sizeof(double*), sizeof(double), seqlen, hmm->statecount, "iterate_em_hmm", 16);
 xi = (double ***) safemalloc_3d(sizeof(double**), sizeof(double*), sizeof(double), seqlen, hmm->statecount, hmm->statecount, "iterate_em_hmm", 17);
 calc_fwd(hmm, traindata, alpha, &loglikelihood, scale);
 calc_bwd(hmm, traindata, seqlen, beta, scale);
 calc_gamma(hmm, seqlen, alpha, beta, gamma);
 /*initialization t=0*/
 calc_xi(hmm, traindata, seqlen, alpha, beta, xi);
 /* reestimate frequency of state i in time t=1 */
 for (i = 0; i < hmm->statecount; i++) 
   hmm->states[i].pi = WEIGHT_DELTA + (1 - WEIGHT_DELTA) * gamma[0][i];
 /* reestimate transition matrix  and symbol prob in each state */
 for (i = 0; i < hmm->statecount; i++)
  { 
   denominatorA = 0.0;
   for (t = 0; t < seqlen - 1; t++) 
     denominatorA += gamma[t][i];
   accumA[i] += denominatorA;
   for (j = 0; j < hmm->statecount; j++)
    {
     numeratorA = 0.0;
     for (t = 0; t < seqlen - 1; t++) 
       numeratorA += xi[t][i][j];
     hmm->states[j].a_dot_j[i] = WEIGHT_DELTA + (1 - WEIGHT_DELTA) * numeratorA;
     hmm->states[i].a_i_dot[j] = hmm->states[j].a_dot_j[i];
    }
   denominatorB = denominatorA + gamma[seqlen - 1][i];
   accumB[i] += denominatorB;
   switch (hmm->statetype)
    {
     case          STATE_DISCRETE:mn = (Multinomialptr) (hmm->states[i].b);
                                  p = 0;
                                  for (f = 0; f < current_dataset->featurecount; f++)
                                    if (current_dataset->features[f].type == STRING)
                                     {
                                      for (k = 0; k < current_dataset->features[f].valuecount; k++)
                                       {
                                        numeratorB = 0.0;
                                        inst = traindata;
                                        t = 0;
                                        while (inst)
                                         {
                                          if (inst->values[f].stringindex == k)
                                            numeratorB += gamma[t][i];
                                          if (t == 0)
                                            inst = inst->sublist;
                                          else
                                            inst = inst->next;
                                          t++;
                                         }
                                        mn->prob[p][k] = WEIGHT_DELTA + (1 - WEIGHT_DELTA) * numeratorB;
                                       }
                                      p++;
                                     }
                                  break;
     case          STATE_GAUSSIAN:g = (Gaussianptr) (hmm->states[i].b);
                                  numeratorM = matrix_alloc(1, numrealfeatures);
                                  numeratorC = matrix_alloc(numrealfeatures, numrealfeatures);
                                  initialize_matrix(&numeratorM, 0);
                                  initialize_matrix(&numeratorC, 0);
                                  inst = traindata;
                                  t = 0;
                                  while (inst)
                                   {
                                    for (f = 0; f < numrealfeatures; f++)
                                     {
                                      numeratorM.values[0][f] += gamma[t][i] * real_feature(inst, f);
                                      for (f2 = 0; f2 < numrealfeatures; f2++)
                                        numeratorC.values[f][f2] += gamma[t][i] * (real_feature(inst, f) - g->mean[f]) * (real_feature(inst, f2) - g->mean[f2]);
                                     }
                                    if (t == 0)
                                      inst = inst->sublist;
                                    else
                                      inst = inst->next;
                                    t++;
                                   }
                                  memcpy(g->mean, numeratorM.values[0], numeratorM.col * sizeof(double));
                                  matrix_identical(&(g->covariance), numeratorC);
                                  matrix_free(numeratorM);
                                  matrix_free(numeratorC);
                                  break;
     case  STATE_GAUSSIAN_MIXTURE:gm = (Gaussianmixtureptr) (hmm->states[i].b);
                                  gammaMix = (double ***) safemalloc_3d(sizeof(double**), sizeof(double*), sizeof(double), seqlen, hmm->statecount, gm->componentcount, "iterate_em_hmm", 22);
                                  numeratorM = matrix_alloc(1, numrealfeatures);
                                  numeratorC = matrix_alloc(numrealfeatures, numrealfeatures);
                                  calc_gammaMix(hmm, traindata, seqlen, gamma, gammaMix);
                                  for (m = 0; m < gm->componentcount; m++)
                                   {
                                    denominatorMC = 0.0;
                                    initialize_matrix(&numeratorM, 0);
                                    initialize_matrix(&numeratorC, 0);
                                    inst = traindata;
                                    t = 0;
                                    while(inst)
                                     {
                                      denominatorMC += gammaMix[t][i][m];
                                      for (f = 0; f < numrealfeatures; f++)
                                       {
                                        numeratorM.values[0][f] += gammaMix[t][i][m] * real_feature(inst, f);
                                        for (f2 = 0; f2 < numrealfeatures; f2++)
                                          numeratorC.values[f][f2] += gammaMix[t][i][m] * (real_feature(inst, f) - gm->components[m].mean[f]) * (real_feature(inst, f2) - gm->components[m].mean[f2]);
                                       }
                                      if (t == 0)
                                        inst = inst->sublist;
                                      else
                                        inst = inst->next;
                                      t++;
                                     }
                                    accumMix[i][m] = denominatorMC;
                                    memcpy(gm->components[m].mean, numeratorM.values[0], numeratorM.col * sizeof(double));
                                    matrix_identical(&(gm->components[m].covariance), numeratorC);
                                    gm->weights[m] = denominatorMC;
                                   }
                                  matrix_free(numeratorM);
                                  matrix_free(numeratorC);
                                  free_3d((void ***)gammaMix, seqlen, hmm->statecount);
                                  break;
     case         STATE_DIRICHLET:break;
     case STATE_DIRICHLET_MIXTURE:break;
    }
  }
 free_3d((void ***)xi, seqlen, hmm->statecount);
 free_2d((void **)alpha, seqlen);
 free_2d((void **)beta, seqlen);
 free_2d((void **)gamma, seqlen);
 safe_free(scale);
 return loglikelihood;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl $0x0, -0x48(%rbp)
leaq 0xc9283(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x1c0(%rax), %eax
subl $0x1, %eax
movl %eax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
callq 0x42ac0
movl %eax, -0x4c(%rbp)
movslq -0x4c(%rbp), %rdi
movl $0x8, %esi
leaq 0xa8bfe(%rip), %rdx     # 0xe51e6
movl $0xd, %ecx
callq 0x52f40
movq %rax, -0xc8(%rbp)
movl -0x4c(%rbp), %edx
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
movl $0x8, %esi
leaq 0xa8bd7(%rip), %r8      # 0xe51e6
movl $0xe, %r9d
movq %rsi, %rdi
callq 0x52fa0
movq %rax, -0xa8(%rbp)
movl -0x4c(%rbp), %edx
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
movl $0x8, %esi
leaq 0xa8bac(%rip), %r8      # 0xe51e6
movl $0xf, %r9d
movq %rsi, %rdi
callq 0x53120
movq %rax, -0xb0(%rbp)
movl -0x4c(%rbp), %edx
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
movl $0x8, %esi
leaq 0xa8b81(%rip), %r8      # 0xe51e6
movl $0x10, %r9d
movq %rsi, %rdi
callq 0x53120
movq %rax, -0xb8(%rbp)
movl -0x4c(%rbp), %ecx
movq -0x8(%rbp), %rax
movl 0x8(%rax), %r8d
movq -0x8(%rbp), %rax
movl 0x8(%rax), %r9d
movl $0x8, %edx
leaq 0xa8b4d(%rip), %rax     # 0xe51e6
movq %rdx, %rdi
movq %rdx, %rsi
movq %rax, (%rsp)
movl $0x11, 0x8(%rsp)
callq 0x531b0
movq %rax, -0xc0(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0xa8(%rbp), %rdx
movq -0xc8(%rbp), %r8
leaq -0x78(%rbp), %rcx
callq 0x3d1c0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x4c(%rbp), %edx
movq -0xb0(%rbp), %rcx
movq -0xc8(%rbp), %r8
callq 0x3d460
movq -0x8(%rbp), %rdi
movl -0x4c(%rbp), %esi
movq -0xa8(%rbp), %rdx
movq -0xb0(%rbp), %rcx
movq -0xb8(%rbp), %r8
callq 0x3d680
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x4c(%rbp), %edx
movq -0xa8(%rbp), %rcx
movq -0xb0(%rbp), %r8
movq -0xc0(%rbp), %r9
callq 0x3d790
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x3c789
movq -0xb8(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
addsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movsd %xmm0, 0x10(%rax)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x3c741
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x3d154
xorps %xmm0, %xmm0
movsd %xmm0, -0x88(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl -0x4c(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x3c7f2
movq -0xb8(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd -0x88(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x3c7b2
movsd -0x88(%rbp), %xmm0
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x3c8e9
xorps %xmm0, %xmm0
movsd %xmm0, -0x80(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl -0x4c(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x3c874
movq -0xc0(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x3c832
movsd -0x80(%rbp), %xmm0
xorps %xmm1, %xmm1
addsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x30(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x30(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movslq -0x30(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x3c813
movsd -0x88(%rbp), %xmm0
movq -0xb8(%rbp), %rax
movl -0x4c(%rbp), %ecx
decl %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x98(%rbp)
movsd -0x98(%rbp), %xmm1
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movl 0xc(%rax), %eax
movq %rax, -0x138(%rbp)
subq $0x4, %rax
ja 0x3d144
movq -0x138(%rbp), %rax
leaq 0xa851f(%rip), %rcx     # 0xe4e7c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq %rax, -0x68(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
leaq 0xc8ea8(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x1bc(%rcx), %eax
jge 0x3cad5
leaq 0xc8e92(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x3c(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
cmpl $0x1, (%rax)
jne 0x3cac5
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
leaq 0xc8e61(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
addq $0x30f08, %rcx          # imm = 0x30F08
movslq -0x3c(%rbp), %rdx
imulq $0x340, %rdx, %rdx      # imm = 0x340
addq %rdx, %rcx
cmpl 0x18(%rcx), %eax
jge 0x3cabc
xorps %xmm0, %xmm0
movsd %xmm0, -0x90(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movl $0x0, -0x38(%rbp)
cmpq $0x0, -0x70(%rbp)
je 0x3ca87
movq -0x70(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
movl (%rax,%rcx,8), %eax
cmpl -0x34(%rbp), %eax
jne 0x3ca5c
movq -0xb8(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd -0x90(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
cmpl $0x0, -0x38(%rbp)
jne 0x3ca70
movq -0x70(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x70(%rbp)
jmp 0x3ca7c
movq -0x70(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x70(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x3ca1a
movsd -0x90(%rbp), %xmm0
xorps %xmm1, %xmm1
addsd %xmm1, %xmm0
movq -0x68(%rbp), %rax
movq (%rax), %rax
movslq -0x44(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x34(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x3c9d5
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x3cac7
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x3c98e
jmp 0x3d144
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq %rax, -0x58(%rbp)
movl -0x50(%rbp), %esi
movl $0x1, %edi
callq 0x57fc0
movq %rax, -0x100(%rbp)
movq %rdx, -0xf8(%rbp)
movq -0x100(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0xf8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movl -0x50(%rbp), %edi
movl -0x50(%rbp), %esi
callq 0x57fc0
movq %rax, -0x110(%rbp)
movq %rdx, -0x108(%rbp)
movq -0x110(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0xe8(%rbp)
leaq -0xe0(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0x5a610
leaq -0xf0(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0x5a610
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movl $0x0, -0x38(%rbp)
cmpq $0x0, -0x70(%rbp)
je 0x3cd00
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x50(%rbp), %eax
jge 0x3ccd2
movq -0xb8(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x140(%rbp)
movq -0x70(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x42c40
movaps %xmm0, %xmm2
movsd -0x140(%rbp), %xmm0
movq -0xd8(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x50(%rbp), %eax
jge 0x3ccc2
movq -0xb8(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x150(%rbp)
movq -0x70(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x42c40
movaps %xmm0, %xmm1
movsd -0x150(%rbp), %xmm0
movq -0x58(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x148(%rbp)
movq -0x70(%rbp), %rdi
movl -0x48(%rbp), %esi
callq 0x42c40
movaps %xmm0, %xmm2
movsd -0x148(%rbp), %xmm0
movq -0x58(%rbp), %rax
movq (%rax), %rax
movslq -0x48(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm2
movq -0xe8(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x48(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x3cc09
jmp 0x3ccc4
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x3cb9f
cmpl $0x0, -0x38(%rbp)
jne 0x3cce6
movq -0x70(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x70(%rbp)
jmp 0x3ccf2
movq -0x70(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x70(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x3cb8d
movq -0x58(%rbp), %rax
movq (%rax), %rdi
movq -0xd8(%rbp), %rax
movq (%rax), %rsi
movslq -0xdc(%rbp), %rdx
shlq $0x3, %rdx
callq 0x42b0
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
callq 0x5c040
movq -0xe0(%rbp), %rdi
movq -0xd8(%rbp), %rsi
callq 0x59ea0
movq -0xf0(%rbp), %rdi
movq -0xe8(%rbp), %rsi
callq 0x59ea0
jmp 0x3d144
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq %rax, -0x60(%rbp)
movl -0x4c(%rbp), %ecx
movq -0x8(%rbp), %rax
movl 0x8(%rax), %r8d
movq -0x60(%rbp), %rax
movl 0x8(%rax), %r9d
movl $0x8, %edx
leaq 0xa8446(%rip), %rax     # 0xe51e6
movq %rdx, %rdi
movq %rdx, %rsi
movq %rax, (%rsp)
movl $0x16, 0x8(%rsp)
callq 0x531b0
movq %rax, -0xd0(%rbp)
movl -0x50(%rbp), %esi
movl $0x1, %edi
callq 0x57fc0
movq %rax, -0x120(%rbp)
movq %rdx, -0x118(%rbp)
movq -0x120(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x118(%rbp), %rax
movq %rax, -0xd8(%rbp)
movl -0x50(%rbp), %edi
movl -0x50(%rbp), %esi
callq 0x57fc0
movq %rax, -0x130(%rbp)
movq %rdx, -0x128(%rbp)
movq -0x130(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x128(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x4c(%rbp), %edx
movq -0xb8(%rbp), %rcx
movq -0xd0(%rbp), %r8
callq 0x3d970
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
movq -0x60(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x3d102
xorps %xmm0, %xmm0
movsd %xmm0, -0xa0(%rbp)
leaq -0xe0(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0x5a610
leaq -0xf0(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0x5a610
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movl $0x0, -0x38(%rbp)
cmpq $0x0, -0x70(%rbp)
je 0x3d066
movq -0xd0(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x40(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd -0xa0(%rbp), %xmm0
movsd %xmm0, -0xa0(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x50(%rbp), %eax
jge 0x3d038
movq -0xd0(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x40(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x158(%rbp)
movq -0x70(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x42c40
movaps %xmm0, %xmm2
movsd -0x158(%rbp), %xmm0
movq -0xd8(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x50(%rbp), %eax
jge 0x3d028
movq -0xd0(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x40(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x168(%rbp)
movq -0x70(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x42c40
movaps %xmm0, %xmm1
movsd -0x168(%rbp), %xmm0
movq -0x60(%rbp), %rax
movq (%rax), %rax
movslq -0x40(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x160(%rbp)
movq -0x70(%rbp), %rdi
movl -0x48(%rbp), %esi
callq 0x42c40
movaps %xmm0, %xmm2
movsd -0x160(%rbp), %xmm0
movq -0x60(%rbp), %rax
movq (%rax), %rax
movslq -0x40(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0x48(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm2
movq -0xe8(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x48(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x3cf4b
jmp 0x3d02a
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x3ced9
cmpl $0x0, -0x38(%rbp)
jne 0x3d04c
movq -0x70(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x70(%rbp)
jmp 0x3d058
movq -0x70(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x70(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x3ce97
movsd -0xa0(%rbp), %xmm0
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x40(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x60(%rbp), %rax
movq (%rax), %rax
movslq -0x40(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0xd8(%rbp), %rax
movq (%rax), %rsi
movslq -0xdc(%rbp), %rdx
shlq $0x3, %rdx
callq 0x42b0
movq -0x60(%rbp), %rax
movq (%rax), %rdi
movslq -0x40(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
addq $0x8, %rdi
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
callq 0x5c040
movsd -0xa0(%rbp), %xmm0
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x40(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x3ce4f
movq -0xe0(%rbp), %rdi
movq -0xd8(%rbp), %rsi
callq 0x59ea0
movq -0xf0(%rbp), %rdi
movq -0xe8(%rbp), %rsi
callq 0x59ea0
movq -0xd0(%rbp), %rdi
movl -0x4c(%rbp), %esi
movq -0x8(%rbp), %rax
movl 0x8(%rax), %edx
callq 0x52ea0
jmp 0x3d144
jmp 0x3d144
jmp 0x3d144
jmp 0x3d146
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x3c790
movq -0xc0(%rbp), %rdi
movl -0x4c(%rbp), %esi
movq -0x8(%rbp), %rax
movl 0x8(%rax), %edx
callq 0x52ea0
movq -0xa8(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0x52e20
movq -0xb0(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0x52e20
movq -0xb8(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0x52e20
movq -0xc8(%rbp), %rdi
callq 0x52e80
movsd -0x78(%rbp), %xmm0
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
nopw %cs:(%rax,%rax)