// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x3a97a
movq -0x8(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x34(%rbp)
subl $0x2, %eax
je 0x3a7ec
jmp 0x3a7db
movl -0x34(%rbp), %eax
subl $0x4, %eax
je 0x3a8ab
jmp 0x3a968
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %esi
movl -0xc(%rbp), %edx
callq 0x3a6d0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %eax
addl -0xc(%rbp), %eax
cltq
imulq $0x18, %rax, %rsi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %edx
addl -0xc(%rbp), %edx
callq 0x52d10
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x28(%rbp), %rcx
movl 0x8(%rcx), %ecx
addl -0xc(%rbp), %ecx
cmpl %ecx, %eax
jge 0x3a899
movq -0x28(%rbp), %rax
movq (%rax), %rdi
movslq -0x20(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x3a980
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x3a862
movl -0xc(%rbp), %ecx
movq -0x28(%rbp), %rax
addl 0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
jmp 0x3a96a
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x30(%rbp), %rax
movl 0x8(%rax), %esi
movl -0xc(%rbp), %edx
callq 0x3a6d0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movl 0x8(%rax), %eax
addl -0xc(%rbp), %eax
movslq %eax, %rsi
shlq $0x3, %rsi
movq -0x30(%rbp), %rax
movl 0x8(%rax), %edx
addl -0xc(%rbp), %edx
callq 0x52d10
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x30(%rbp), %rcx
movl 0x8(%rcx), %ecx
addl -0xc(%rbp), %ecx
cmpl %ecx, %eax
jge 0x3a959
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movslq -0x20(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x3aae0
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x3a922
movl -0xc(%rbp), %ecx
movq -0x30(%rbp), %rax
addl 0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
jmp 0x3a96a
jmp 0x3a96a
jmp 0x3a96c
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x3a7ba
addq $0x40, %rsp
popq %rbp
retq