// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/hmm.c
// Function: free_state_model
void free_state_model(void* model, HMM_STATE_TYPE statetype)
{
 /*!Last Changed 26.02.2007*/
 Gaussianptr g;
 Gaussianmixtureptr gm;
 Multinomialptr m;
 Dirichletptr d;
 Dirichletmixtureptr dm;
 int i;
 switch (statetype)
  {
   case          STATE_DISCRETE:m = (Multinomialptr) model;
                                for (i = 0; i < current_dataset->featurecount - 1; i++)
                                  safe_free(m->prob[i]);
                                safe_free(m->prob);
                                break;
   case          STATE_GAUSSIAN:g = (Gaussianptr) model;
                                safe_free(g->mean);
                                matrix_free(g->covariance);
                                break;
   case  STATE_GAUSSIAN_MIXTURE:gm = (Gaussianmixtureptr) model;
                                safe_free(gm->weights);
                                for (i = 0; i < gm->componentcount; i++)
                                 {
                                  safe_free(gm->components[i].mean);
                                  matrix_free(gm->components[i].covariance);
                                 }
                                safe_free(gm->components);
                                break;
   case         STATE_DIRICHLET:d = (Dirichletptr) model;
                                safe_free(d->alpha);
                                break;
   case STATE_DIRICHLET_MIXTURE:dm = (Dirichletmixtureptr) model;
                                safe_free(dm->weights);
                                for (i = 0; i < dm->componentcount; i++)
                                  safe_free(dm->components[i].alpha);
                                safe_free(dm->components);
                                break;
  }
 safe_free(model);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq %rax, -0x48(%rbp)
subq $0x4, %rax
ja 0x3890a
movq -0x48(%rbp), %rax
leaq 0xac619(%rip), %rcx     # 0xe4db4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
leaq 0xcd083(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
movl 0x1bc(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x387ec
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x52e80
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x387b3
movq -0x28(%rbp), %rax
movq (%rax), %rdi
callq 0x52e80
jmp 0x3890a
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x52e80
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rax), %rsi
callq 0x59ea0
jmp 0x3890a
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x52e80
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x38893
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x52e80
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movq 0x10(%rax), %rsi
callq 0x59ea0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x38843
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x52e80
jmp 0x3890a
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0x52e80
jmp 0x3890a
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x52e80
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x388fe
movq -0x38(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x52e80
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x388d3
movq -0x38(%rbp), %rax
movq (%rax), %rdi
callq 0x52e80
movq -0x8(%rbp), %rdi
callq 0x52e80
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)