// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: multiply_constant_state_model
void multiply_constant_state_model(void *model, double mul, HMM_STATE_TYPE statetype)
{
 /*!Last Changed 15.03.2007*/
 Gaussianptr g;
 Gaussianmixtureptr gm;
 Multinomialptr m;
 Dirichletptr d;
 Dirichletmixtureptr dm;
 int i, j;
 int numrealfeatures = current_dataset->multifeaturecount - 1;
 switch (statetype)
  {
   case          STATE_DISCRETE:m = (Multinomialptr) model;
                                j = 0;
                                for (i = 0; i < current_dataset->featurecount; i++)
                                  if (current_dataset->features[i].type == STRING)
                                   {
                                    multiply_array(m->prob[j], mul, current_dataset->features[i].valuecount);
                                    j++;
                                   }
                                break;
   case          STATE_GAUSSIAN:g = (Gaussianptr) model;
                                multiply_array(g->mean, mul, numrealfeatures);
                                matrix_multiply_constant(&(g->covariance), mul);
                                break;
   case  STATE_GAUSSIAN_MIXTURE:gm = (Gaussianmixtureptr) model;
                                multiply_array(gm->weights, mul, numrealfeatures);
                                for (i = 0; i < gm->componentcount; i++)
                                 {
                                  multiply_array(gm->components[i].mean, mul, numrealfeatures);
                                  matrix_multiply_constant(&(gm->components[i].covariance), mul);
                                 }
                                break;
   case         STATE_DIRICHLET:d = (Dirichletptr) model;
                                multiply_array(d->alpha, mul, numrealfeatures);
                                break;
   case STATE_DIRICHLET_MIXTURE:dm = (Dirichletmixtureptr) model;
                                multiply_array(dm->weights, mul, dm->componentcount);
                                for (i = 0; i < dm->componentcount; i++)
                                  multiply_array(dm->components[i].alpha, mul, numrealfeatures);
                                break;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movsd %xmm0, (%rsp)
cmpl $0x4, %esi
ja 0x264be
movl %esi, %r14d
movq %rdi, %rbx
leaq 0xa749c(%rip), %r15     # 0xcd870
movq (%r15), %rax
movl 0x1c0(%rax), %ebp
decl %ebp
movl %esi, %ecx
leaq 0x71e90(%rip), %rdx     # 0x98278
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl $0x30f20, %r12d         # imm = 0x30F20
xorl %r13d, %r13d
movslq 0x1bc(%rax), %rcx
cmpq %rcx, %r13
jge 0x264be
cmpl $0x1, -0x18(%rax,%r12)
jne 0x26430
movq (%rbx), %rcx
movslq %r14d, %r14
movq (%rcx,%r14,8), %rdi
movl (%rax,%r12), %esi
movsd (%rsp), %xmm0
callq 0x33a4f
incl %r14d
movq (%r15), %rax
incq %r13
addq $0x340, %r12            # imm = 0x340
jmp 0x263fa
movq 0x10(%rbx), %rdi
movl 0x8(%rbx), %esi
movsd (%rsp), %xmm0
callq 0x33a4f
xorl %r14d, %r14d
movslq 0x8(%rbx), %rax
cmpq %rax, %r14
jge 0x264be
movq (%rbx), %rax
movq (%rax,%r14,8), %rdi
movsd (%rsp), %xmm0
movl %ebp, %esi
callq 0x33a4f
incq %r14
jmp 0x26450
movq 0x10(%rbx), %rdi
movsd (%rsp), %xmm0
movl %ebp, %esi
callq 0x33a4f
pushq $0x8
popq %r14
xorl %r15d, %r15d
movslq 0x8(%rbx), %rax
cmpq %rax, %r15
jge 0x264be
movq (%rbx), %rax
movq -0x8(%rax,%r14), %rdi
movsd (%rsp), %xmm0
movl %ebp, %esi
callq 0x33a4f
movq (%rbx), %rdi
addq %r14, %rdi
movsd (%rsp), %xmm0
callq 0x39a42
incq %r15
addq $0x18, %r14
jmp 0x26488
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %rdi
movsd (%rsp), %xmm0
movl %ebp, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x33a4f
movq (%rbx), %rdi
movsd (%rsp), %xmm0
movl %ebp, %esi
callq 0x33a4f
addq $0x8, %rbx
movq %rbx, %rdi
movsd (%rsp), %xmm0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x39a42