// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/hmm.c
// Function: calc_obslik
double calc_obslik(Hmmptr hmm, Instanceptr inst, int stateindex)
{
 /*!Last Changed 26.03.2007*/
 double obslik;
 Gaussianptr g;
 Gaussianmixtureptr gm;
 Multinomialptr m;
 Dirichletptr d;
 Dirichletmixtureptr dm;
 switch (hmm->statetype)
  {
   case          STATE_DISCRETE:m = (Multinomialptr) (hmm->states[stateindex].b);
                                obslik = multinomial_multivariate(inst, m);
                                break;
   case          STATE_GAUSSIAN:g = (Gaussianptr) (hmm->states[stateindex].b);
                                obslik = gaussian_multivariate(inst, g->mean, g->covariance);
                                break;
   case  STATE_GAUSSIAN_MIXTURE:gm = (Gaussianmixtureptr) (hmm->states[stateindex].b);
                                obslik = gaussian_mixture_multivariate(inst, gm);
                                break;
   case         STATE_DIRICHLET:d = (Dirichletptr) (hmm->states[stateindex].b);
                                obslik = dirichlet(inst, d->alpha);
                                break;
   case STATE_DIRICHLET_MIXTURE:dm = (Dirichletmixtureptr) (hmm->states[stateindex].b);
                                obslik = dirichlet_mixture_multivariate(inst, dm);
                                break;
   default                     :obslik = 1.0;
                                break;
  }
 return obslik;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl 0xc(%rax), %eax
movq %rax, -0x50(%rbp)
subq $0x4, %rax
ja 0x3c16a
movq -0x50(%rbp), %rax
leaq 0xa8e05(%rip), %rcx     # 0xe4e68
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x3b870
movsd %xmm0, -0x20(%rbp)
jmp 0x3c177
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdx
movq 0x10(%rax), %rcx
callq 0xc24d0
movsd %xmm0, -0x20(%rbp)
jmp 0x3c177
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x3bdf0
movsd %xmm0, -0x20(%rbp)
jmp 0x3c177
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rax
movq (%rax), %rsi
callq 0x2dd30
movsd %xmm0, -0x20(%rbp)
jmp 0x3c177
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x3bf30
movsd %xmm0, -0x20(%rbp)
jmp 0x3c177
movsd 0xa5ea6(%rip), %xmm0    # 0xe2018
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)