// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/hmm.c
// Function: calloc_state_model
void* calloc_state_model(HMM_STATE_TYPE statetype, int componentcount)
{
 /*!Last Changed 15.03.2007*/
 Gaussianptr g;
 Gaussianmixtureptr gm;
 Multinomialptr m;
 Dirichletptr d;
 Dirichletmixtureptr dm;
 int i, j;
 switch (statetype)
  {
   case          STATE_DISCRETE:m = safemalloc(sizeof(Multinomial), "calloc_state_model", 10);
                                m->prob = safemalloc(sizeof(double*) * (current_dataset->featurecount - 1), "calloc_state_model", 11);
                                j = 0;
                                for (i = 0; i < current_dataset->featurecount; i++)
                                 if (current_dataset->features[i].type == STRING)
                                  {
                                   m->prob[j] = safecalloc(current_dataset->features[i].valuecount, sizeof(double), "calloc_state_model", 16);
                                   j++;
                                  }
                                return m;
                                break;
   case          STATE_GAUSSIAN:g = safemalloc(sizeof(Gaussian), "calloc_state_model", 21);
                                alloc_gaussian(g);
                                initialize_matrix(&(g->covariance), 0.0);
                                return g;
                                break;
   case  STATE_GAUSSIAN_MIXTURE:gm = safemalloc(sizeof(Gaussianmixture), "calloc_state_model", 27);
                                gm->componentcount = componentcount;
                                gm->weights = safecalloc(gm->componentcount, sizeof(double), "calloc_state_model", 29);
                                gm->components = safemalloc(componentcount * sizeof(Gaussian), "calloc_state_model", 30);
                                for (i = 0; i < gm->componentcount; i++)
                                 {
                                  alloc_gaussian(&(gm->components[i]));
                                  initialize_matrix(&(gm->components[i].covariance), 0.0);
                                 }
                                return gm;
                                break;
   case         STATE_DIRICHLET:d = safemalloc(sizeof(Dirichlet), "calloc_state_model", 38);
                                alloc_dirichlet(d);
                                return d;
                                break;
   case STATE_DIRICHLET_MIXTURE:dm = safemalloc(sizeof(Dirichletmixture), "calloc_state_model", 42);
                                dm->componentcount = componentcount;
                                dm->weights = safecalloc(dm->componentcount, sizeof(double), "calloc_state_model", 44);
                                dm->components = safemalloc(componentcount * sizeof(Dirichlet), "calloc_state_model", 45);
                                for (i = 0; i < dm->componentcount; i++)
                                  alloc_dirichlet(&(dm->components[i]));
                                return dm;
                                break;
      default                  :return NULL;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movl -0xc(%rbp), %eax
movq %rax, -0x48(%rbp)
subq $0x4, %rax
ja 0x3915b
movq -0x48(%rbp), %rax
leaq 0xabf82(%rip), %rcx     # 0xe4ddc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x8, %edi
leaq 0xac315(%rip), %rsi     # 0xe5184
movl $0xa, %edx
callq 0x52d70
movq %rax, -0x28(%rbp)
leaq 0xcc9bc(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x1bc(%rax), %eax
subl $0x1, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
leaq 0xac2e6(%rip), %rsi     # 0xe5184
movl $0xb, %edx
callq 0x52d70
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
leaq 0xcc976(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x1bc(%rcx), %eax
jge 0x38f5f
leaq 0xcc960(%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 0x38f4f
leaq 0xcc93d(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x3c(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movslq 0x18(%rax), %rdi
movl $0x8, %esi
leaq 0xac25a(%rip), %rdx     # 0xe5184
movl $0x10, %ecx
callq 0x52f40
movq %rax, %rdx
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0x40(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x38f51
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x38ec0
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x39163
movl $0x18, %edi
leaq 0xac20c(%rip), %rsi     # 0xe5184
movl $0x15, %edx
callq 0x52d70
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3b200
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
xorps %xmm0, %xmm0
callq 0x5a610
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x39163
movl $0x18, %edi
leaq 0xac1cc(%rip), %rsi     # 0xe5184
movl $0x1b, %edx
callq 0x52d70
movq %rax, -0x20(%rbp)
movl -0x10(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x20(%rbp), %rax
movslq 0x8(%rax), %rdi
movl $0x8, %esi
leaq 0xac1a0(%rip), %rdx     # 0xe5184
movl $0x1d, %ecx
callq 0x52f40
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movslq -0x10(%rbp), %rax
imulq $0x18, %rax, %rdi
leaq 0xac17c(%rip), %rsi     # 0xe5184
movl $0x1e, %edx
callq 0x52d70
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x3906f
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movslq -0x3c(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x3b200
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 0x39023
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x39163
movl $0x8, %edi
leaq 0xac0fc(%rip), %rsi     # 0xe5184
movl $0x26, %edx
callq 0x52d70
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x3b280
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x39163
movl $0x18, %edi
leaq 0xac0cc(%rip), %rsi     # 0xe5184
movl $0x2a, %edx
callq 0x52d70
movq %rax, -0x38(%rbp)
movl -0x10(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x38(%rbp), %rax
movslq 0x8(%rax), %rdi
movl $0x8, %esi
leaq 0xac0a0(%rip), %rdx     # 0xe5184
movl $0x2c, %ecx
callq 0x52f40
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movslq -0x10(%rbp), %rdi
shlq $0x3, %rdi
leaq 0xac07c(%rip), %rsi     # 0xe5184
movl $0x2d, %edx
callq 0x52d70
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x39151
movq -0x38(%rbp), %rax
movq (%rax), %rdi
movslq -0x3c(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
callq 0x3b280
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x39123
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x39163
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)