// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/hmm.c
// Function: add_component
void add_component(Hmmptr hmm, int count, Instanceptr traindata)
{
 /*!Last Changed 06.04.2007*/
 int i, j;
 Gaussianmixtureptr gm;
 Dirichletmixtureptr dm;
 for (i = 0; i < hmm->statecount; i++)
   switch (hmm->statetype)
    {
     case  STATE_GAUSSIAN_MIXTURE:gm = (Gaussianmixtureptr) hmm->states[i].b;
                                  gm->weights = add_probability_conserving(gm->weights, gm->componentcount, count);
                                  gm->components = alloc(gm->components, (gm->componentcount + count) * sizeof(Gaussian), gm->componentcount + count);
                                  for (j = gm->componentcount; j < gm->componentcount + count; j++)
                                    random_gaussian(&(gm->components[j]), traindata);
                                  gm->componentcount += count;
                                  break;
     case STATE_DIRICHLET_MIXTURE:dm = (Dirichletmixtureptr) hmm->states[i].b;
                                  dm->weights = add_probability_conserving(dm->weights, dm->componentcount, count);
                                  dm->components = alloc(dm->components, (dm->componentcount + count) * sizeof(Dirichlet), dm->componentcount + count);
                                  for (j = dm->componentcount; j < dm->componentcount + count; j++)
                                    random_dirichlet(&(dm->components[j]), traindata);
                                  dm->componentcount += count;
                                  break;
     default                     :break;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, 0x4(%rsp)
cmpl $0x0, 0x8(%rdi)
jle 0x28ecc
movq %rdx, %rbx
movq %rdi, %r13
xorl %r12d, %r12d
movslq 0x4(%rsp), %r15
movq %rdi, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movl 0xc(%r13), %eax
cmpl $0x4, %eax
je 0x28e23
cmpl $0x2, %eax
jne 0x28ebc
movq (%r13), %rax
movq %r12, %rcx
shlq $0x5, %rcx
movq 0x18(%rax,%rcx), %rbp
movq 0x10(%rbp), %rdi
movl 0x8(%rbp), %esi
movl %r15d, %edx
callq 0x28cda
movq %rax, 0x10(%rbp)
movq (%rbp), %rdi
movslq 0x8(%rbp), %rdx
addq %r15, %rdx
movq %rdx, %rax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rsi
callq 0x390c8
movslq 0x8(%rbp), %r14
movq %rax, (%rbp)
testl %r15d, %r15d
jle 0x28eb3
leaq (,%r14,8), %rax
leaq (%rax,%rax,2), %r13
movq (%rbp), %rdi
addq %r13, %rdi
movq %rbx, %rsi
callq 0x28edb
incq %r14
movslq 0x8(%rbp), %rax
addq %r15, %rax
addq $0x18, %r13
cmpq %rax, %r14
jl 0x28df4
movl %eax, %r14d
movq 0x8(%rsp), %r13
jmp 0x28eb8
movq (%r13), %rax
movq %r12, %rcx
shlq $0x5, %rcx
movq 0x18(%rax,%rcx), %rbp
movq 0x10(%rbp), %rdi
movl 0x8(%rbp), %esi
movl %r15d, %edx
callq 0x28cda
movq %rax, 0x10(%rbp)
movq (%rbp), %rdi
movslq 0x8(%rbp), %rdx
addq %r15, %rdx
movq %rdx, %rsi
shlq $0x3, %rsi
callq 0x390c8
movslq 0x8(%rbp), %r14
movq %rax, (%rbp)
testl %r15d, %r15d
jle 0x28eb3
leaq 0xa99ff(%rip), %rbx     # 0xd2870
movq (%rbp), %r13
movq (%rbx), %rax
movl 0x1c0(%rax), %edi
decl %edi
xorps %xmm0, %xmm0
movsd 0x79695(%rip), %xmm1    # 0xa2520
callq 0x3a083
movq %rax, (%r13,%r14,8)
incq %r14
movslq 0x8(%rbp), %rax
addq %r15, %rax
cmpq %rax, %r14
jl 0x28e71
movl %eax, %r14d
movq 0x8(%rsp), %r13
movq 0x10(%rsp), %rbx
jmp 0x28eb8
addl 0x4(%rsp), %r14d
movl %r14d, 0x8(%rbp)
incq %r12
movslq 0x8(%r13), %rax
cmpq %rax, %r12
jl 0x28d83
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq