// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/hmm.c
// Function: init_state_model
void init_state_model(void *model, HMM_STATE_TYPE statetype)
{
 /*!Last Changed 15.03.2007*/
 Gaussianptr g;
 Gaussianmixtureptr gm;
 Multinomialptr m;
 Dirichletptr d;
 Dirichletmixtureptr dm;
 int i, j;
 int numrealfeatures = current_dataset->multifeaturecount - 1;
 switch (statetype)
  {
   case          STATE_DISCRETE:m = (Multinomialptr) model;
                                j = 0;
                                for (i = 0; i < current_dataset->featurecount; i++)
                                  if (current_dataset->features[i].type == STRING)
                                   {
                                    init_array(m->prob[j], current_dataset->features[i].valuecount);
                                    j++;
                                   }
                                break;
   case          STATE_GAUSSIAN:g = (Gaussianptr) model;
                                init_array(g->mean, numrealfeatures);
                                initialize_matrix(&(g->covariance), 0.0);
                                break;
   case  STATE_GAUSSIAN_MIXTURE:gm = (Gaussianmixtureptr) model;
                                init_array(gm->weights, gm->componentcount);
                                for (i = 0; i < gm->componentcount; i++)
                                 {
                                  init_array(gm->components[i].mean, numrealfeatures);
                                  initialize_matrix(&(gm->components[i].covariance), 0.0);
                                 }
                                break;
   case         STATE_DIRICHLET:d = (Dirichletptr) model;
                                init_array(d->alpha, numrealfeatures);
                                break;
   case STATE_DIRICHLET_MIXTURE:dm = (Dirichletmixtureptr) model;
                                init_array(dm->weights, dm->componentcount);
                                for (i = 0; i < dm->componentcount; i++)
                                  init_array(dm->components[i].alpha, numrealfeatures);
                                break;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
leaq 0xcc05a(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x1c0(%rax), %eax
decl %eax
movl %eax, -0x44(%rbp)
movl -0xc(%rbp), %eax
movq %rax, -0x50(%rbp)
subq $0x4, %rax
ja 0x399c9
movq -0x50(%rbp), %rax
leaq 0xab5f4(%rip), %rcx     # 0xe4e04
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
leaq 0xcc007(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x1bc(%rcx), %eax
jge 0x398b5
leaq 0xcbff5(%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 0x398a5
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xcbfc3(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x3c(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movl 0x18(%rax), %esi
callq 0x50650
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x398a7
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x3982f
jmp 0x399c9
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movl -0x44(%rbp), %esi
callq 0x50650
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
xorps %xmm0, %xmm0
callq 0x5a610
jmp 0x399c9
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x50650
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x3995b
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movl -0x44(%rbp), %esi
callq 0x50650
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movslq -0x3c(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
addq $0x8, %rdi
xorps %xmm0, %xmm0
callq 0x5a610
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x39909
jmp 0x399c9
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movl -0x44(%rbp), %esi
callq 0x50650
jmp 0x399c9
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x38(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x50650
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x399c7
movq -0x38(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl -0x44(%rbp), %esi
callq 0x50650
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x39999
jmp 0x399c9
addq $0x50, %rsp
popq %rbp
retq
nop