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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
leaq 0xcbd13(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x1c0(%rax), %eax
decl %eax
movl %eax, -0x74(%rbp)
movl -0x14(%rbp), %eax
movq %rax, -0x80(%rbp)
subq $0x4, %rax
ja 0x39dd6
movq -0x80(%rbp), %rax
leaq 0xab2c1(%rip), %rcx     # 0xe4e18
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x70(%rbp)
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
leaq 0xcbcb8(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x1bc(%rcx), %eax
jge 0x39c1c
leaq 0xcbca2(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x6c(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
cmpl $0x1, (%rax)
jne 0x39c0c
movq -0x40(%rbp), %rax
movq (%rax), %rax
movslq -0x70(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq -0x70(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0xcbc61(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x6c(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movslq 0x18(%rax), %rdx
shlq $0x3, %rdx
callq 0x42b0
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x39c0e
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x39b7e
jmp 0x39dd6
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
movslq -0x74(%rbp), %rdx
shlq $0x3, %rdx
callq 0x42b0
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
callq 0x5c040
jmp 0x39dd6
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x30(%rbp), %rax
movslq 0x8(%rax), %rdx
shlq $0x3, %rdx
callq 0x42b0
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x39d28
movq -0x30(%rbp), %rax
movq (%rax), %rax
movslq -0x6c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x38(%rbp), %rax
movq (%rax), %rax
movslq -0x6c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movslq -0x74(%rbp), %rdx
shlq $0x3, %rdx
callq 0x42b0
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movslq -0x6c(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
addq $0x8, %rdi
movq -0x38(%rbp), %rax
movq (%rax), %rax
movslq -0x6c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
callq 0x5c040
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x39ca2
jmp 0x39dd6
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq (%rax), %rdi
movq -0x58(%rbp), %rax
movq (%rax), %rsi
movslq -0x74(%rbp), %rdx
shlq $0x3, %rdx
callq 0x42b0
jmp 0x39dd6
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x68(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x60(%rbp), %rax
movslq 0x8(%rax), %rdx
shlq $0x3, %rdx
callq 0x42b0
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movq -0x60(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x39dd4
movq -0x60(%rbp), %rax
movq (%rax), %rax
movslq -0x6c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x68(%rbp), %rax
movq (%rax), %rax
movslq -0x6c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movslq -0x74(%rbp), %rdx
shlq $0x3, %rdx
callq 0x42b0
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x39d92
jmp 0x39dd6
addq $0x80, %rsp
popq %rbp
retq
nop