LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/graphdata.c
// Function: select_node_maximizes_K2_metric
int select_node_maximizes_K2_metric(bayesiangraphptr mygraph, int node, int *parents, int parentcount, int *nodeset, int nodecount)
{
	/*!Last Changed 02.02.2004 added safemalloc*/
 double metricvalue, maxvalue;
 int i, j, maxnode;
 int *currentparents;
 BOOLEAN found;
 currentparents = (int *) safemalloc((parentcount + 1) * sizeof(int), "select_node_maximizes_K2_metric", 4);
 maxvalue = -LONG_MAX;
 maxnode = -1;
 for (i = 0; i < parentcount; i++)
   currentparents[i] = parents[i];
 for (i = 0; i < nodecount; i++)
  {
   found = BOOLEAN_FALSE;
   for (j = 0; j < parentcount; j++)
     if (nodeset[i] == parents[j])
      {
       found = BOOLEAN_TRUE;
       break;
      }
   currentparents[parentcount] = nodeset[i];
   if (!found)
    {
     metricvalue = calculate_K2_metric(mygraph, node, currentparents, parentcount + 1);
     if (metricvalue > maxvalue)
      {
       maxvalue = metricvalue;
       maxnode = nodeset[i];
      }
    }
  }
	safe_free(currentparents);
 return maxnode;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x8(%rsp)
movq %r8, %r14
movq %rdx, %r15
movl %esi, 0x10(%rsp)
movq %rdi, 0x20(%rsp)
movslq %ecx, %r13
incl %ecx
movl %ecx, 0x14(%rsp)
leaq 0x4(,%r13,4), %rdi
leaq 0x73dc0(%rip), %rsi     # 0x981a2
pushq $0x4
popq %rdx
callq 0x34f59
movq %rax, %r12
xorl %eax, %eax
testl %r13d, %r13d
movl $0x0, %ebp
cmovgl %r13d, %ebp
cmpq %rax, %rbp
je 0x2440d
movl (%r15,%rax,4), %ecx
movl %ecx, (%r12,%rax,4)
incq %rax
jmp 0x243fb
xorl %ebx, %ebx
movq 0x8(%rsp), %r8
testl %r8d, %r8d
cmovlel %ebx, %r8d
movsd 0x719ad(%rip), %xmm0    # 0x95dd0
movsd %xmm0, 0x8(%rsp)
pushq $-0x1
popq %rax
movl %eax, 0x4(%rsp)
movq %r14, 0x18(%rsp)
cmpq %r8, %rbx
je 0x2449d
movl (%r14,%rbx,4), %eax
xorl %ecx, %ecx
cmpq %rcx, %rbp
je 0x24458
leaq 0x1(%rcx), %rsi
cmpl (%r15,%rcx,4), %eax
movq %rsi, %rcx
jne 0x24440
movl %eax, (%r12,%r13,4)
jmp 0x24498
movl %eax, (%r12,%r13,4)
movq 0x20(%rsp), %rdi
movl 0x10(%rsp), %esi
movq %r12, %rdx
movl 0x14(%rsp), %ecx
movq %r13, %r14
movq %r8, %r13
callq 0x241e2
movq %r13, %r8
movq %r14, %r13
movq 0x18(%rsp), %r14
ucomisd 0x8(%rsp), %xmm0
jbe 0x24498
movl (%r14,%rbx,4), %eax
movl %eax, 0x4(%rsp)
movsd %xmm0, 0x8(%rsp)
incq %rbx
jmp 0x24435
movq %r12, %rdi
callq 0x34ff7
movl 0x4(%rsp), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: empty_hmm
Hmmptr empty_hmm(int statecount, HMM_STATE_TYPE statetype, HMM_MODEL_TYPE hmmtype)
{
 /*!Last Changed 22.01.2007*/
 Hmmptr result;
 result = safemalloc(sizeof(Hmm), "empty_hmm", 2);
 result->states = safemalloc(statecount * sizeof(State), "empty_hmm", 3);
 result->statecount = statecount;
 result->statetype = statetype;
 result->hmmtype = hmmtype;
 return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movl %edi, %r14d
leaq 0x73cea(%rip), %r15     # 0x982b4
pushq $0x18
popq %rdi
pushq $0x2
popq %rdx
movq %r15, %rsi
callq 0x34f59
movq %rax, %r12
movslq %r14d, %r14
movq %r14, %rdi
shlq $0x5, %rdi
pushq $0x3
popq %rdx
movq %r15, %rsi
callq 0x34f59
movq %rax, (%r12)
movl %r14d, 0x8(%r12)
movl %ebp, 0xc(%r12)
movl %ebx, 0x10(%r12)
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: free_hmm
void free_hmm(Hmmptr hmm)
{
 /*!Last Changed 25.02.2007 added free_state_model*/
 /*!Last Changed 22.01.2007*/
 int i;
 for (i = 0; i < hmm->statecount; i++)
  {
   free_state_model(hmm->states[i].b, hmm->statetype);
   safe_free(hmm->states[i].a_dot_j);
   safe_free(hmm->states[i].a_i_dot);
  }  
 safe_free(hmm->states);
 safe_free(hmm);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %r15d, %r15d
movslq 0x8(%rbx), %rax
movq (%rbx), %rdi
cmpq %rax, %r15
jge 0x24a7b
movq 0x18(%rdi,%r14), %rdi
movl 0xc(%rbx), %esi
callq 0x24a8d
movq (%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x34ff7
movq (%rbx), %rax
movq 0x8(%rax,%r14), %rdi
callq 0x34ff7
incq %r15
addq $0x20, %r14
jmp 0x24a40
callq 0x34ff7
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x34ff7
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: free_state_model
void free_state_model(void* model, HMM_STATE_TYPE statetype)
{
 /*!Last Changed 26.02.2007*/
 Gaussianptr g;
 Gaussianmixtureptr gm;
 Multinomialptr m;
 Dirichletptr d;
 Dirichletmixtureptr dm;
 int i;
 switch (statetype)
  {
   case          STATE_DISCRETE:m = (Multinomialptr) model;
                                for (i = 0; i < current_dataset->featurecount - 1; i++)
                                  safe_free(m->prob[i]);
                                safe_free(m->prob);
                                break;
   case          STATE_GAUSSIAN:g = (Gaussianptr) model;
                                safe_free(g->mean);
                                matrix_free(g->covariance);
                                break;
   case  STATE_GAUSSIAN_MIXTURE:gm = (Gaussianmixtureptr) model;
                                safe_free(gm->weights);
                                for (i = 0; i < gm->componentcount; i++)
                                 {
                                  safe_free(gm->components[i].mean);
                                  matrix_free(gm->components[i].covariance);
                                 }
                                safe_free(gm->components);
                                break;
   case         STATE_DIRICHLET:d = (Dirichletptr) model;
                                safe_free(d->alpha);
                                break;
   case STATE_DIRICHLET_MIXTURE:dm = (Dirichletmixtureptr) model;
                                safe_free(dm->weights);
                                for (i = 0; i < dm->componentcount; i++)
                                  safe_free(dm->components[i].alpha);
                                safe_free(dm->components);
                                break;
  }
 safe_free(model);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x4, %esi
ja 0x24b4a
movl %esi, %eax
leaq 0x73745(%rip), %rcx     # 0x981ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %r14d, %r14d
leaq 0xa8db6(%rip), %r15     # 0xcd870
movq (%r15), %rax
movslq 0x1bc(%rax), %rax
decq %rax
movq (%rbx), %rdi
cmpq %rax, %r14
jge 0x24b45
movq (%rdi,%r14,8), %rdi
callq 0x34ff7
incq %r14
jmp 0x24aba
movq 0x10(%rbx), %rdi
callq 0x34ff7
xorl %r14d, %r14d
movslq 0x8(%rbx), %rax
movq (%rbx), %rdi
cmpq %rax, %r14
jge 0x24b45
movq (%rdi,%r14,8), %rdi
callq 0x34ff7
incq %r14
jmp 0x24ae9
movq 0x10(%rbx), %rdi
callq 0x34ff7
xorl %r14d, %r14d
xorl %r15d, %r15d
movslq 0x8(%rbx), %rax
movq (%rbx), %rdi
cmpq %rax, %r15
jge 0x24b45
movq (%rdi,%r14), %rdi
callq 0x34ff7
movq (%rbx), %rax
movq 0x8(%rax,%r14), %rdi
movq 0x10(%rax,%r14), %rsi
callq 0x3929f
incq %r15
addq $0x18, %r14
jmp 0x24b12
movq (%rbx), %rdi
callq 0x34ff7
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x34ff7
movq (%rbx), %rdi
callq 0x34ff7
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rsi
callq 0x3929f
jmp 0x24b4a
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: alloc_hmm
Hmmptr alloc_hmm(int statecount, HMM_STATE_TYPE statetype, int componentcount, HMM_MODEL_TYPE hmmtype)
{
 /*!Last Changed 15.03.2007*/
 int i;
 Hmmptr desthmm = empty_hmm(statecount, statetype, hmmtype);
 for (i = 0; i < statecount; i++)
  {
    desthmm->states[i].pi = 0;
    desthmm->states[i].a_dot_j = safemalloc(sizeof(double) * statecount, "init_hmm", 6);
    desthmm->states[i].a_i_dot = safemalloc(sizeof(double) * statecount, "init_hmm", 7);
    desthmm->states[i].b = alloc_state_model(statetype, componentcount);
  } 
 return desthmm;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, 0x4(%rsp)
movl %esi, %ebp
movl %edi, %r15d
movl %ecx, %edx
callq 0x245b4
movq %rax, %r14
movslq %r15d, %r13
leaq (,%r13,8), %r15
xorl %ebx, %ebx
testl %r13d, %r13d
cmovlel %ebx, %r13d
shlq $0x5, %r13
leaq 0x7371e(%rip), %r12     # 0x982c9
cmpq %rbx, %r13
je 0x24bfd
movq (%r14), %rax
andq $0x0, 0x10(%rax,%rbx)
movq %r15, %rdi
movq %r12, %rsi
pushq $0x6
popq %rdx
callq 0x34f59
movq (%r14), %rcx
movq %rax, (%rcx,%rbx)
movq %r15, %rdi
movq %r12, %rsi
pushq $0x7
popq %rdx
callq 0x34f59
movq (%r14), %rcx
movq %rax, 0x8(%rcx,%rbx)
movl %ebp, %edi
movl 0x4(%rsp), %esi
callq 0x24c0f
movq (%r14), %rcx
movq %rax, 0x18(%rcx,%rbx)
addq $0x20, %rbx
jmp 0x24bab
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: calloc_hmm
Hmmptr calloc_hmm(int statecount, HMM_STATE_TYPE statetype, int componentcount, HMM_MODEL_TYPE hmmtype)
{
 /*!Last Changed 15.03.2007*/
 int i;
 Hmmptr desthmm = empty_hmm(statecount, statetype, hmmtype);
 for (i = 0; i < statecount; i++)
  {
    desthmm->states[i].pi = 0;
    desthmm->states[i].a_dot_j = safecalloc(statecount, sizeof(double), "init_hmm", 6);
    desthmm->states[i].a_i_dot = safecalloc(statecount, sizeof(double), "init_hmm", 7);
    desthmm->states[i].b = calloc_state_model(statetype, componentcount);
  } 
 return desthmm;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, 0x4(%rsp)
movl %edi, %r15d
movl %esi, (%rsp)
movl %ecx, %edx
callq 0x245b4
movq %rax, %r14
movslq %r15d, %r15
xorl %ebx, %ebx
testl %r15d, %r15d
movl $0x0, %ebp
cmovgl %r15d, %ebp
shlq $0x5, %rbp
leaq 0x73493(%rip), %r12     # 0x982c9
pushq $0x8
popq %r13
cmpq %rbx, %rbp
je 0x24e93
movq (%r14), %rax
andq $0x0, 0x10(%rax,%rbx)
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
pushq $0x6
popq %rcx
callq 0x35067
movq (%r14), %rcx
movq %rax, (%rcx,%rbx)
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
pushq $0x7
popq %rcx
callq 0x35067
movq (%r14), %rcx
movq %rax, 0x8(%rcx,%rbx)
movl (%rsp), %edi
movl 0x4(%rsp), %esi
callq 0x24ea5
movq (%r14), %rcx
movq %rax, 0x18(%rcx,%rbx)
addq $0x20, %rbx
jmp 0x24e3a
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: clone_hmm
Hmmptr clone_hmm(Hmmptr srchmm)
{
 /*!Last Changed 15.03.2007*/
 int i;
 Hmmptr desthmm = empty_hmm(srchmm->statecount, srchmm->statetype, srchmm->hmmtype);
 for (i = 0; i < srchmm->statecount; i++)
  {
    desthmm->states[i].pi = srchmm->states[i].pi;
    desthmm->states[i].a_dot_j = clone_array(srchmm->states[i].a_dot_j, srchmm->statecount);
    desthmm->states[i].a_i_dot = clone_array(srchmm->states[i].a_i_dot, srchmm->statecount);
    desthmm->states[i].b = clone_state_model(srchmm->states[i].b, srchmm->statetype);
  } 
 return desthmm;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x8(%rdi), %edi
movl 0xc(%rbx), %esi
movl 0x10(%rbx), %edx
callq 0x245b4
movq %rax, %r14
xorl %r15d, %r15d
xorl %r12d, %r12d
movslq 0x8(%rbx), %rsi
cmpq %rsi, %r12
jge 0x2513d
movq (%rbx), %rax
movsd 0x10(%rax,%r15), %xmm0
movq (%r14), %rcx
movsd %xmm0, 0x10(%rcx,%r15)
movq (%rax,%r15), %rdi
callq 0x3325d
movq (%r14), %rcx
movq %rax, (%rcx,%r15)
movq (%rbx), %rax
movq 0x8(%rax,%r15), %rdi
movl 0x8(%rbx), %esi
callq 0x3325d
movq (%r14), %rcx
movq %rax, 0x8(%rcx,%r15)
movq (%rbx), %rax
movq 0x18(%rax,%r15), %rdi
movl 0xc(%rbx), %esi
callq 0x2514c
movq (%r14), %rcx
movq %rax, 0x18(%rcx,%r15)
incq %r12
addq $0x20, %r15
jmp 0x250d7
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: init_hmm
void init_hmm(Hmmptr srchmm)
{
 /*!Last Changed 15.03.2007*/
 int i;
 for (i = 0; i < srchmm->statecount; i++)
  {
    srchmm->states[i].pi = 0;
    init_array(srchmm->states[i].a_dot_j, srchmm->statecount);
    init_array(srchmm->states[i].a_i_dot, srchmm->statecount);
    init_state_model(srchmm->states[i].b, srchmm->statetype);
  } 
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %r15d, %r15d
movslq 0x8(%rbx), %rsi
cmpq %rsi, %r15
jge 0x253d3
movq (%rbx), %rax
andq $0x0, 0x10(%rax,%r14)
movq (%rax,%r14), %rdi
callq 0x339dc
movq (%rbx), %rax
movq 0x8(%rax,%r14), %rdi
movl 0x8(%rbx), %esi
callq 0x339dc
movq (%rbx), %rax
movq 0x18(%rax,%r14), %rdi
movl 0xc(%rbx), %esi
callq 0x253d9
incq %r15
addq $0x20, %r14
jmp 0x2538f
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: copy_hmm
void copy_hmm(Hmmptr desthmm, Hmmptr srchmm)
{
 /*!Last Changed 15.03.2007*/
 int i;
 desthmm->hmmtype = srchmm->hmmtype;
 desthmm->statetype = srchmm->statetype;
 for (i = 0; i < srchmm->statecount; i++)
  {
    desthmm->states[i].pi = srchmm->states[i].pi;
    memcpy(desthmm->states[i].a_dot_j, srchmm->states[i].a_dot_j, srchmm->statecount * sizeof(double));
    memcpy(desthmm->states[i].a_i_dot, srchmm->states[i].a_i_dot, srchmm->statecount * sizeof(double));
    copy_state_model(desthmm->states[i].b, srchmm->states[i].b, srchmm->statetype);
  } 
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0xc(%rsi), %rax
movq %rax, 0xc(%rdi)
xorl %r15d, %r15d
xorl %r12d, %r12d
movslq 0x8(%rbx), %rdx
cmpq %rdx, %r12
jge 0x255a0
movq (%rbx), %rax
movsd 0x10(%rax,%r15), %xmm0
movq (%r14), %rcx
movsd %xmm0, 0x10(%rcx,%r15)
movq (%rcx,%r15), %rdi
movq (%rax,%r15), %rsi
shlq $0x3, %rdx
callq 0x4310
movq (%r14), %rax
movq 0x8(%rax,%r15), %rdi
movq (%rbx), %rax
movq 0x8(%rax,%r15), %rsi
movslq 0x8(%rbx), %rdx
shlq $0x3, %rdx
callq 0x4310
movq (%r14), %rax
movq 0x18(%rax,%r15), %rdi
movq (%rbx), %rax
movq 0x18(%rax,%r15), %rsi
movl 0xc(%rbx), %edx
callq 0x255ac
incq %r12
addq $0x20, %r15
jmp 0x25534
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: sum_hmm
void sum_hmm(Hmmptr desthmm, Hmmptr srchmm)
{
 /*!Last Changed 15.03.2007*/
 int i;
 for (i = 0; i < srchmm->statecount; i++)
  {
    desthmm->states[i].pi += srchmm->states[i].pi;
    add_arrays(desthmm->states[i].a_dot_j, srchmm->states[i].a_dot_j, srchmm->statecount);
    add_arrays(desthmm->states[i].a_i_dot, srchmm->states[i].a_i_dot, srchmm->statecount);
    sum_state_model(desthmm->states[i].b, srchmm->states[i].b, srchmm->statetype);
  } 
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
xorl %r12d, %r12d
movslq 0x8(%rbx), %rdx
cmpq %rdx, %r12
jge 0x257c9
movq (%rbx), %rax
movsd 0x10(%rax,%r15), %xmm0
movq (%r14), %rcx
addsd 0x10(%rcx,%r15), %xmm0
movsd %xmm0, 0x10(%rcx,%r15)
movq (%rcx,%r15), %rdi
movq (%rax,%r15), %rsi
callq 0x3323c
movq (%r14), %rax
movq 0x8(%rax,%r15), %rdi
movq (%rbx), %rax
movq 0x8(%rax,%r15), %rsi
movl 0x8(%rbx), %edx
callq 0x3323c
movq (%r14), %rax
movq 0x18(%rax,%r15), %rdi
movq (%rbx), %rax
movq 0x18(%rax,%r15), %rsi
movl 0xc(%rbx), %edx
callq 0x257d5
incq %r12
addq $0x20, %r15
jmp 0x2575f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: add_probability_conserving
double* add_probability_conserving(double* prob, int count, int added)
{
 /*!Last Changed 05.04.2007*/
 double* result;
 int i;
 result = alloc(prob, (count + added) * sizeof(double), count + added);
 for (i = 0; i < count; i++)
   result[i] *= (count + 0.0) / (count + added);
 for (i = count; i < count + added; i++)
   result[i] = 1.0 / (count + added);
 return result;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
addl %esi, %edx
movslq %edx, %rbx
leaq (,%rbx,8), %rsi
movl %ebx, %edx
callq 0x34f30
cvtsi2sd %ebp, %xmm1
cvtsi2sd %ebx, %xmm0
divsd %xmm0, %xmm1
xorl %ecx, %ecx
testl %ebp, %ebp
movl $0x0, %edx
cmovgl %ebp, %edx
cmpq %rcx, %rdx
je 0x25ca9
movsd (%rax,%rcx,8), %xmm2
mulsd %xmm1, %xmm2
movsd %xmm2, (%rax,%rcx,8)
incq %rcx
jmp 0x25c91
movsd 0x6f86f(%rip), %xmm1    # 0x95520
divsd %xmm0, %xmm1
movslq %ebp, %rcx
cmpq %rbx, %rcx
jge 0x25cc7
movsd %xmm1, (%rax,%rcx,8)
incq %rcx
jmp 0x25cb8
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: random_gaussian
void random_gaussian(Gaussianptr g, Instanceptr traindata)
{
 /*!Last Changed 07.04.2007*/
 int numrealfeatures = current_dataset->multifeaturecount - 1;
 int size, index, seqlen, i, t;
 matrix m;
 Instanceptr datapoint, tmp;
 size = data_size(traindata);
 index = myrand() % size;
 datapoint = data_x(traindata, index);
 seqlen = frame_count(datapoint);
 m = matrix_alloc(seqlen, numrealfeatures);
 tmp = datapoint;
 t = 0;
 while (tmp)
  {
   for (i = 0; i < numrealfeatures; i++)
     m.values[t][i] = real_feature(tmp, i);
   if (t == 0)
     tmp = tmp->sublist;
   else
     tmp = tmp->next;
   t++;
  }
 g->mean = matrix_average_columns(m);
 g->covariance = identity(numrealfeatures);
 matrix_free(m);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, 0x10(%rsp)
leaq 0xa7a3a(%rip), %rax     # 0xcd870
movq (%rax), %rax
movl 0x1c0(%rax), %ebp
decl %ebp
movq %rsi, %rdi
callq 0x2c3cc
movl %eax, %r15d
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x35c7f
cltd
idivl %r15d
movq %r14, %rdi
movl %edx, %esi
callq 0x2d761
movq %rax, %r12
movq %rax, %rdi
callq 0x2adc0
movl %eax, %edi
movl %ebp, %esi
callq 0x380d3
movq %rax, 0x8(%rsp)
movq %rdx, %r15
testl %ebp, %ebp
movl $0x0, %r14d
cmovgl %ebp, %r14d
testq %r12, %r12
je 0x25ecb
xorl %r13d, %r13d
cmpq %r13, %r14
je 0x25eb2
movq %r12, %rdi
movl %r13d, %esi
callq 0x2aea2
movq (%r15,%rbx,8), %rax
movsd %xmm0, (%rax,%r13,8)
incq %r13
jmp 0x25e93
leaq 0x10(%r12), %rax
addq $0x28, %r12
testq %rbx, %rbx
cmovneq %rax, %r12
movq (%r12), %r12
incq %rbx
jmp 0x25e8b
movq 0x8(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x39f86
movq 0x10(%rsp), %rbx
movq %rax, (%rbx)
movl %ebp, %edi
callq 0x3930e
movq %rax, 0x8(%rbx)
movq %rdx, 0x10(%rbx)
movq %r14, %rdi
movq %r15, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3929f
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: multinomial_multivariate
double multinomial_multivariate(Instanceptr inst, Multinomialptr m)
{
 /*!Last Changed 26.02.2007*/
 double prod = 1.0;
 int i, j = 0;
 for (i = 0; i < current_dataset->featurecount; i++)
   if (current_dataset->features[i].type == STRING)
    {
     prod *= m->prob[j][inst->values[i].stringindex];
     j++; 
    } 
 return prod;
}

// Assembly:
leaq 0xa7127(%rip), %rax     # 0xcd870
movq (%rax), %rax
movl 0x1bc(%rax), %ecx
addq $0x30f08, %rax          # imm = 0x30F08
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
movsd 0x6edb9(%rip), %xmm0    # 0x95520
xorl %r8d, %r8d
cmpq %rdx, %rcx
je 0x26799
cmpl $0x1, (%rax)
jne 0x2678e
movq (%rsi), %r9
movslq %r8d, %r8
movq (%r9,%r8,8), %r9
movq (%rdi), %r10
movslq (%r10,%rdx,8), %r10
mulsd (%r9,%r10,8), %xmm0
incl %r8d
incq %rdx
addq $0x340, %rax            # imm = 0x340
jmp 0x2676a
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: read_gaussian_mixture
Gaussianmixtureptr read_gaussian_mixture(char* filename, int** classes)
{ 
 /*!Last Changed 28.04.2007*/
 Gaussianmixtureptr gm;
 FILE* infile;
 int i, dimension;
 infile = fopen(filename, "r");
 if (!infile)
   return NULL;
 fscanf(infile, "%d", &dimension);
 gm = safemalloc(sizeof(Gaussianmixture), "read_gaussian_mixture", 7);
 fscanf(infile, "%d", &(gm->componentcount));
 *classes = safemalloc(gm->componentcount * sizeof(int), "read_gaussian_mixture", 9);
 gm->weights = safemalloc(gm->componentcount * sizeof(double), "read_gaussian_mixture", 10);
 gm->components = safemalloc(gm->componentcount * sizeof(Gaussian), "read_gaussian_mixture", 11);
 for (i = 0; i < gm->componentcount; i++)
   fscanf(infile, "%lf", &(gm->weights[i]));
 for (i = 0; i < gm->componentcount; i++)
  {
   fscanf(infile, "%d", &((*classes)[i]));
   gm->components[i].mean = load_array(infile, dimension);
   gm->components[i].covariance = load_matrix(infile, dimension, dimension);
  }
 fclose(infile);
 return gm;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
leaq 0x74f1a(%rip), %rsi     # 0x9b87f
callq 0x40f0
testq %rax, %rax
je 0x26aa5
movq %rax, %r14
leaq 0x7a1dc(%rip), %rbp     # 0xa0b59
leaq 0xc(%rsp), %rdx
movq %rax, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x4070
leaq 0x71c12(%rip), %r13     # 0x985a8
pushq $0x18
popq %rdi
pushq $0x7
popq %rdx
movq %r13, %rsi
callq 0x34f59
movq %rax, %r15
leaq 0x8(%rax), %r12
movq %r14, %rdi
movq %rbp, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x4070
movslq 0x8(%r15), %rdi
shlq $0x2, %rdi
pushq $0x9
popq %rdx
movq %r13, %rsi
callq 0x34f59
movq %rbx, 0x10(%rsp)
movq %rax, (%rbx)
movslq 0x8(%r15), %rdi
shlq $0x3, %rdi
pushq $0xa
popq %rdx
movq %r13, %rsi
callq 0x34f59
movq %rax, 0x10(%r15)
movslq 0x8(%r15), %rax
imulq $0x18, %rax, %rdi
pushq $0xb
popq %rdx
movq %r13, %rsi
callq 0x34f59
movq %rax, (%r15)
leaq 0x7319e(%rip), %r13     # 0x99ba8
xorl %ebx, %ebx
xorl %ebp, %ebp
movslq (%r12), %rax
cmpq %rax, %rbp
jge 0x26a34
movq 0x10(%r15), %rdx
addq %rbx, %rdx
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x4070
incq %rbp
addq $0x8, %rbx
jmp 0x26a0e
pushq $0x4
popq %r13
xorl %ebp, %ebp
xorl %ebx, %ebx
cltq
cmpq %rax, %rbx
jge 0x26a9b
movq 0x10(%rsp), %rax
movq (%rax), %rdx
addq %rbp, %rdx
movq %r14, %rdi
leaq 0x7a101(%rip), %rsi     # 0xa0b59
xorl %eax, %eax
callq 0x4070
movl 0xc(%rsp), %esi
movq %r14, %rdi
callq 0x3615a
movq (%r15), %r12
movq %rax, -0x10(%r12,%r13,4)
movl 0xc(%rsp), %edx
movq %r14, %rdi
movl %edx, %esi
callq 0x360cc
movq %rax, -0x8(%r12,%r13,4)
movq %rdx, (%r12,%r13,4)
incq %rbx
movl 0x8(%r15), %eax
addq $0x6, %r13
addq $0x4, %rbp
jmp 0x26a3c
movq %r14, %rdi
callq 0x42a0
jmp 0x26aa8
xorl %r15d, %r15d
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: gaussian_mixture_multivariate
double gaussian_mixture_multivariate(Instanceptr inst, Gaussianmixtureptr gm)
{
 /*!Last Changed 26.02.2007*/
 double sum = 0.0;
 int i;
 for (i = 0; i < gm->componentcount; i++)
   sum += gm->weights[i] * gaussian_multivariate(inst, gm->components[i].mean, gm->components[i].covariance);
 return sum;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorpd %xmm0, %xmm0
pushq $0x2
popq %r15
xorl %r12d, %r12d
movslq 0x8(%rbx), %rax
cmpq %rax, %r12
jge 0x26b33
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movsd (%rcx,%r12,8), %xmm1
movsd %xmm1, 0x10(%rsp)
movq -0x10(%rax,%r15,8), %rsi
movq -0x8(%rax,%r15,8), %rdx
movq (%rax,%r15,8), %rcx
movq %r14, %rdi
movsd %xmm0, 0x8(%rsp)
callq 0x80279
mulsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
incq %r12
addq $0x3, %r15
jmp 0x26ad6
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: dirichlet_mixture_multivariate
double dirichlet_mixture_multivariate(Instanceptr inst, Dirichletmixtureptr dm)
{
 /*!Last Changed 28.02.2007*/
 double sum = 0.0;
 int i;
 for (i = 0; i < dm->componentcount; i++)
   sum += dm->weights[i] * dirichlet(inst, dm->components[i].alpha);
 return sum;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorpd %xmm0, %xmm0
xorl %r15d, %r15d
movslq 0x8(%rbx), %rax
cmpq %rax, %r15
jge 0x26bd3
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movsd (%rcx,%r15,8), %xmm1
movsd %xmm1, 0x8(%rsp)
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
movsd %xmm0, (%rsp)
callq 0x1daad
mulsd 0x8(%rsp), %xmm0
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r15
jmp 0x26b88
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: calc_obslik
double calc_obslik(Hmmptr hmm, Instanceptr inst, int stateindex)
{
 /*!Last Changed 26.03.2007*/
 double obslik;
 Gaussianptr g;
 Gaussianmixtureptr gm;
 Multinomialptr m;
 Dirichletptr d;
 Dirichletmixtureptr dm;
 switch (hmm->statetype)
  {
   case          STATE_DISCRETE:m = (Multinomialptr) (hmm->states[stateindex].b);
                                obslik = multinomial_multivariate(inst, m);
                                break;
   case          STATE_GAUSSIAN:g = (Gaussianptr) (hmm->states[stateindex].b);
                                obslik = gaussian_multivariate(inst, g->mean, g->covariance);
                                break;
   case  STATE_GAUSSIAN_MIXTURE:gm = (Gaussianmixtureptr) (hmm->states[stateindex].b);
                                obslik = gaussian_mixture_multivariate(inst, gm);
                                break;
   case         STATE_DIRICHLET:d = (Dirichletptr) (hmm->states[stateindex].b);
                                obslik = dirichlet(inst, d->alpha);
                                break;
   case STATE_DIRICHLET_MIXTURE:dm = (Dirichletmixtureptr) (hmm->states[stateindex].b);
                                obslik = dirichlet_mixture_multivariate(inst, dm);
                                break;
   default                     :obslik = 1.0;
                                break;
  }
 return obslik;
}

// Assembly:
movl 0xc(%rdi), %eax
cmpq $0x4, %rax
ja 0x26caf
leaq 0x7168a(%rip), %rcx     # 0x982a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rdi), %rax
movslq %edx, %rcx
shlq $0x5, %rcx
movq 0x18(%rax,%rcx), %rax
movq %rsi, %rdi
movq %rax, %rsi
jmp 0x26742
movq (%rdi), %rax
movslq %edx, %rcx
shlq $0x5, %rcx
movq 0x18(%rax,%rcx), %rax
movq %rsi, %rdi
movq %rax, %rsi
jmp 0x26b72
movq (%rdi), %rax
movslq %edx, %rcx
shlq $0x5, %rcx
movq 0x18(%rax,%rcx), %rax
movq %rsi, %rdi
movq %rax, %rsi
jmp 0x26aba
movq (%rdi), %rax
movslq %edx, %rcx
shlq $0x5, %rcx
movq 0x18(%rax,%rcx), %rax
movq (%rax), %rax
movq %rsi, %rdi
movq %rax, %rsi
jmp 0x1daad
movq (%rdi), %rax
movslq %edx, %rcx
shlq $0x5, %rcx
movq 0x18(%rax,%rcx), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rdx
movq 0x10(%rcx), %rcx
movq %rsi, %rdi
movq %rax, %rsi
jmp 0x80279
movsd 0x6e869(%rip), %xmm0    # 0x95520
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: calc_obslikMix
double calc_obslikMix(Hmmptr hmm, Instanceptr inst, int stateindex, int componentindex)
{
 /*!Last Changed 26.03.2007*/
 double obslik;
 Gaussianmixtureptr gm;
 Dirichletmixtureptr dm;
 switch (hmm->statetype)
  {
   case  STATE_GAUSSIAN_MIXTURE:gm = (Gaussianmixtureptr) (hmm->states[stateindex].b);
                                obslik = get_gaussian_mixture_multivariate_component(inst, gm, componentindex);
                                break;
   case STATE_DIRICHLET_MIXTURE:dm = (Dirichletmixtureptr) (hmm->states[stateindex].b);
                                obslik = get_dirichlet_mixture_multivariate_component(inst, dm, componentindex);
                                break;
   default                     :obslik = 1.0;
                                break;
  }
 return obslik;
}

// Assembly:
movl 0xc(%rdi), %eax
cmpl $0x4, %eax
je 0x26ce1
cmpl $0x2, %eax
jne 0x26cfd
movq (%rdi), %rax
movslq %edx, %rdx
shlq $0x5, %rdx
movq 0x18(%rax,%rdx), %rax
movq %rsi, %rdi
movq %rax, %rsi
movl %ecx, %edx
jmp 0x26b3f
movq (%rdi), %rax
movslq %edx, %rdx
shlq $0x5, %rdx
movq 0x18(%rax,%rdx), %rax
movq %rsi, %rdi
movq %rax, %rsi
movl %ecx, %edx
jmp 0x26bdd
movsd 0x6e81b(%rip), %xmm0    # 0x95520
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: calc_bwd
void calc_bwd(Hmmptr hmm, Instanceptr traindata, int seqlen, double **beta, double *scale)
{
 /*!Last Changed 13.03.2007*/
 int i, j, t;
 double sumvalue, obslik;
 double *temp1D2;
 Instanceptr inst;
 /*initialization t = T - 1*/
 for (i = 0; i < hmm->statecount; i++)
   beta[seqlen - 1][i] = 1;  
 /*recursion t=T-2:0*/
 reverse_instancelist(&(traindata->sublist));
 inst = traindata->sublist; /* listeyi ters cevirmek lazim*/
 inst = inst->next;
 t = seqlen - 2; 
 while (t >= 0)
  {
   for (i = 0; i < hmm->statecount; i++)
    {
     temp1D2 = multiply_two_arrays_by_value(beta[t + 1], hmm->states[i].a_i_dot, hmm->statecount);
     for (j = 0; j < hmm->statecount; j++)
      {
       obslik = calc_obslik(hmm, inst, j);
       temp1D2[j] *= obslik;
      }
     sumvalue = sum_of_list_double(temp1D2, hmm->statecount);
     beta[t][i] = sumvalue;
     safe_free(temp1D2);
    }
   t--;
   inst = inst->next;
   if (!inst)
     inst = traindata;
  }
 reverse_instancelist(&(traindata->sublist)); 
 if (scale)
  {
   for (i = 0; i < seqlen; i++)
		   for (j = 0; j < hmm->statecount; j++)
			    beta[i][j] /= scale[i];
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r13
movl %edx, %ebx
movq %rsi, 0x10(%rsp)
movq %rdi, %r12
movl 0x8(%rdi), %eax
movslq %edx, %rcx
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
movabsq $0x3ff0000000000000, %rsi # imm = 0x3FF0000000000000
cmpq %rdx, %rax
je 0x27a55
movq -0x8(%r13,%rcx,8), %rdi
movq %rsi, (%rdi,%rdx,8)
incq %rdx
jmp 0x27a42
movq %r8, 0x30(%rsp)
movq 0x10(%rsp), %r14
leaq 0x28(%r14), %rdi
movq %rdi, 0x20(%rsp)
callq 0x2c6c6
movq 0x28(%r14), %rax
movq 0x10(%rax), %rbp
movq %rbx, 0x28(%rsp)
leal -0x2(%rbx), %eax
testl %eax, %eax
js 0x27b30
movl %eax, 0xc(%rsp)
movl %eax, %eax
movq %rax, 0x18(%rsp)
xorl %r14d, %r14d
movslq 0x8(%r12), %rdx
cmpq %rdx, %r14
jge 0x27b18
movq %r13, %rbx
movq 0x18(%rsp), %rax
movq 0x8(%r13,%rax,8), %rdi
movq (%r12), %rax
movq %r14, %rcx
shlq $0x5, %rcx
movq 0x8(%rax,%rcx), %rsi
callq 0x33a93
movq %rax, %r15
xorl %r13d, %r13d
movslq 0x8(%r12), %rsi
cmpq %rsi, %r13
jge 0x27aee
movq %r12, %rdi
movq %rbp, %rsi
movl %r13d, %edx
callq 0x26c02
mulsd (%r15,%r13,8), %xmm0
movsd %xmm0, (%r15,%r13,8)
incq %r13
jmp 0x27ac5
movq %r15, %rdi
callq 0x33c3e
movq %rbx, %r13
movq 0x18(%rsp), %rax
movq (%rbx,%rax,8), %rax
movsd %xmm0, (%rax,%r14,8)
movq %r15, %rdi
callq 0x34ff7
incq %r14
jmp 0x27a93
movl 0xc(%rsp), %eax
decl %eax
movq 0x10(%rbp), %rbp
testq %rbp, %rbp
cmoveq 0x10(%rsp), %rbp
jmp 0x27a7d
movq 0x20(%rsp), %rdi
callq 0x2c6c6
movq 0x30(%rsp), %r8
testq %r8, %r8
movq 0x28(%rsp), %r9
je 0x27b89
xorl %eax, %eax
testl %r9d, %r9d
cmovlel %eax, %r9d
xorl %ecx, %ecx
cmpq %r9, %rcx
je 0x27b89
movl 0x8(%r12), %edx
testl %edx, %edx
cmovlel %eax, %edx
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x27b84
movq (%r13,%rcx,8), %rdi
movsd (%rdi,%rsi,8), %xmm0
divsd (%r8,%rcx,8), %xmm0
movsd %xmm0, (%rdi,%rsi,8)
incq %rsi
jmp 0x27b65
incq %rcx
jmp 0x27b54
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: calc_gamma
void calc_gamma(Hmmptr hmm, int seqlen, double **alpha, double **beta, double **gamma)
{
 /*!Last Changed 26.03.2007*/
 int i, j, t;
 double denominator;
 for (t = 0; t < seqlen; t++) 
  {
   denominator = 0.0;
   for (j = 0; j < hmm->statecount; j++) 
    {
     gamma[t][j] = alpha[t][j] * beta[t][j];
     denominator += gamma[t][j];
    }
   for (i = 0; i < hmm->statecount; i++) 
     gamma[t][i] = gamma[t][i] / denominator;
  }
}

// Assembly:
pushq %rbx
xorl %eax, %eax
testl %esi, %esi
cmovlel %eax, %esi
xorl %r9d, %r9d
cmpq %rsi, %r9
je 0x27c0c
movl 0x8(%rdi), %r10d
testl %r10d, %r10d
cmovlel %eax, %r10d
xorpd %xmm0, %xmm0
xorl %r11d, %r11d
cmpq %r11, %r10
je 0x27be6
movq (%rdx,%r9,8), %rbx
movsd (%rbx,%r11,8), %xmm1
movq (%rcx,%r9,8), %rbx
mulsd (%rbx,%r11,8), %xmm1
movq (%r8,%r9,8), %rbx
movsd %xmm1, (%rbx,%r11,8)
addsd %xmm1, %xmm0
incq %r11
jmp 0x27bba
xorl %r11d, %r11d
cmpq %r11, %r10
je 0x27c07
movq (%r8,%r9,8), %rbx
movsd (%rbx,%r11,8), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rbx,%r11,8)
incq %r11
jmp 0x27be9
incq %r9
jmp 0x27ba3
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: calc_xi
void calc_xi(Hmmptr hmm, Instanceptr traindata, int seqlen, double **alpha, double **beta, double ***xi)
{
 /*!Last Changed 26.03.2007*/
 int i, j, t;
 double sum, obslik;
 Instanceptr inst = traindata;
 inst = inst->sublist;
 for (t = 0; t < seqlen - 1; t++) 
  {
   sum = 0.0;  
   for (i = 0; i < hmm->statecount; i++) 
     for (j = 0; j < hmm->statecount; j++) 
      {
       obslik = calc_obslik(hmm, inst, j);
       xi[t][i][j] = alpha[t][i] * beta[t + 1][j] * (hmm->states[i].a_i_dot[j]) * obslik;
       sum += xi[t][i][j];
      }
   for (i = 0; i < hmm->statecount; i++) 
     for (j = 0; j < hmm->statecount; j++)
       xi[t][i][j] /= sum;
   inst = inst->next;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %rbx
movq %r8, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdi, %r13
addq $0x28, %rsi
movq %rsi, (%rsp)
cmpl $0x2, %edx
pushq $0x1
popq %rax
cmovgel %edx, %eax
decl %eax
movq %rax, 0x10(%rsp)
xorl %r14d, %r14d
cmpq 0x10(%rsp), %r14
je 0x27d44
movq (%rsp), %rax
movq (%rax), %rax
movq %rax, (%rsp)
movl 0x8(%r13), %eax
xorpd %xmm1, %xmm1
xorl %r15d, %r15d
movslq %eax, %rcx
cmpq %rcx, %r15
jge 0x27cfd
movsd %xmm1, 0x8(%rsp)
movq %r15, %r12
shlq $0x5, %r12
xorl %ebp, %ebp
movslq %eax, %rcx
cmpq %rcx, %rbp
jge 0x27cef
movq %r13, %rdi
movq (%rsp), %rsi
movl %ebp, %edx
callq 0x26c02
movq 0x18(%rsp), %rax
movq (%rax,%r14,8), %rax
movsd (%rax,%r15,8), %xmm1
movq 0x20(%rsp), %rax
movq 0x8(%rax,%r14,8), %rax
mulsd (%rax,%rbp,8), %xmm1
movq (%r13), %rax
movq 0x8(%rax,%r12), %rax
mulsd (%rax,%rbp,8), %xmm1
mulsd %xmm0, %xmm1
movq (%rbx,%r14,8), %rax
movq (%rax,%r15,8), %rax
movsd %xmm1, (%rax,%rbp,8)
movsd 0x8(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
incq %rbp
movl 0x8(%r13), %eax
jmp 0x27c83
incq %r15
movsd 0x8(%rsp), %xmm1
jmp 0x27c68
testl %eax, %eax
movl $0x0, %ecx
cmovgl %eax, %ecx
movl %eax, %eax
xorl %edx, %edx
cmpq %rcx, %rdx
je 0x27d37
xorl %esi, %esi
cmpq %rsi, %rax
je 0x27d32
movq (%rbx,%r14,8), %rdi
movq (%rdi,%rdx,8), %rdi
movsd (%rdi,%rsi,8), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, (%rdi,%rsi,8)
incq %rsi
jmp 0x27d12
incq %rdx
jmp 0x27d0b
addq $0x10, (%rsp)
incq %r14
jmp 0x27c47
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: calc_gammaMix
void calc_gammaMix(Hmmptr hmm, Instanceptr traindata, int seqlen, double **gamma, double ***gammaMix)
{
 /*!Last Changed 26.03.2007*/
 int j, t, m;
 int componentcount;
 double obslik, obslikMix;
 Instanceptr inst = traindata;
 for (t = 0; t < seqlen; t++) 
  {
   for (j = 0; j < hmm->statecount; j++) 
    {
     obslik = calc_obslik(hmm, inst, j);
     componentcount = get_component_count(hmm->states[j], hmm->statetype);
     for (m = 0; m < componentcount; m++)
      {        
       obslikMix = calc_obslikMix(hmm, inst, j, m);
       gammaMix[t][j][m] = gamma[t][j] * obslikMix / obslik;
      }
    }
   if (t == 0)
     inst = inst->sublist;
   else
     inst = inst->next;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq %rsi, %r12
movq %rdi, %r13
xorl %eax, %eax
testl %edx, %edx
cmovlel %eax, %edx
movq %rdx, 0x8(%rsp)
xorl %ebx, %ebx
cmpq 0x8(%rsp), %rbx
je 0x27e45
xorl %ebp, %ebp
movslq 0x8(%r13), %rax
cmpq %rax, %rbp
jge 0x27e29
movq %r13, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x26c02
movsd %xmm0, 0x20(%rsp)
movl 0xc(%r13), %eax
cmpl $0x4, %eax
je 0x27dbd
xorl %r14d, %r14d
cmpl $0x2, %eax
jne 0x27dd1
movq (%r13), %rax
movq %rbp, %rcx
shlq $0x5, %rcx
movq 0x18(%rax,%rcx), %rax
movl 0x8(%rax), %r14d
testl %r14d, %r14d
movl $0x0, %eax
cmovlel %eax, %r14d
xorl %r15d, %r15d
cmpq %r15, %r14
je 0x27e21
movq %r13, %rdi
movq %r12, %rsi
movl %ebp, %edx
movl %r15d, %ecx
callq 0x26cb8
movq 0x10(%rsp), %rax
movq (%rax,%rbx,8), %rax
mulsd (%rax,%rbp,8), %xmm0
divsd 0x20(%rsp), %xmm0
movq 0x18(%rsp), %rax
movq (%rax,%rbx,8), %rax
movq (%rax,%rbp,8), %rax
movsd %xmm0, (%rax,%r15,8)
incq %r15
jmp 0x27de0
incq %rbp
jmp 0x27d8c
leaq 0x10(%r12), %rax
addq $0x28, %r12
testq %rbx, %rbx
cmovneq %rax, %r12
movq (%r12), %r12
incq %rbx
jmp 0x27d7f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: printcontemission
void printcontemission(FILE *controlfile, Gaussianptr g)
{
 int ft, ft2;
 int numrealfeatures = current_dataset->multifeaturecount - 1;
 fprintf(controlfile, "\n mean\n");
 for (ft = 0; ft < numrealfeatures; ft++)
  {
	  fprintf(controlfile, "%.14f ", g->mean[ft]);
  }
 fprintf(controlfile,"\n\ncovariance\n");
 for (ft = 0; ft < numrealfeatures; ft++)
  {
   for (ft2 = 0; ft2 < numrealfeatures; ft2++)
	    fprintf(controlfile, "%.14f ", g->covariance.values[ft][ft2]);
   fprintf(controlfile,"\n");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xa5a04(%rip), %rax     # 0xcd870
movq (%rax), %rax
movl 0x1c0(%rax), %ebp
decl %ebp
leaq 0x70831(%rip), %rdi     # 0x986af
pushq $0x7
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x42c0
xorl %r13d, %r13d
testl %ebp, %ebp
movl $0x0, %r12d
cmovgl %ebp, %r12d
leaq 0x7087c(%rip), %r15     # 0x9871e
cmpq %r13, %r12
je 0x27ec2
movq (%rbx), %rax
movsd (%rax,%r13,8), %xmm0
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x42e0
incq %r13
jmp 0x27ea2
leaq 0x7070c(%rip), %rdi     # 0x985d5
pushq $0xd
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x42c0
movl %ebp, %r13d
xorl %ebp, %ebp
leaq 0x7083b(%rip), %r15     # 0x9871e
movq %r12, (%rsp)
cmpq %r12, %rbp
je 0x27f28
xorl %r12d, %r12d
cmpq %r12, %r13
je 0x27f14
movq 0x10(%rbx), %rax
movq (%rax,%rbp,8), %rax
movsd (%rax,%r12,8), %xmm0
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x42e0
incq %r12
jmp 0x27eef
pushq $0xa
popq %rdi
movq %r14, %rsi
callq 0x4150
incq %rbp
movq (%rsp), %r12
jmp 0x27ee7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: printcontobservation
void printcontobservation(FILE *controlfile, Instanceptr inst)
{
 int i;
 int numrealfeatures = current_dataset->multifeaturecount - 1;
 Instanceptr inst1 = inst;
 fprintf(controlfile, "observation\n ");
 for (i = 0; i < numrealfeatures; i++)
  {
	  fprintf(controlfile, "inst :%f feature:%d \n ", real_feature(inst1, i), i);
  }
 fprintf(controlfile, "\n\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xa541e(%rip), %rax     # 0xcd870
movq (%rax), %rax
movl 0x1c0(%rax), %r12d
decl %r12d
leaq 0x701dc(%rip), %rdi     # 0x98642
pushq $0xd
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x42c0
xorl %ebp, %ebp
testl %r12d, %r12d
cmovlel %ebp, %r12d
leaq 0x701cc(%rip), %r15     # 0x98650
cmpl %ebp, %r12d
je 0x284a6
movq %r14, %rdi
movl %ebp, %esi
callq 0x2aea2
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
movb $0x1, %al
callq 0x42e0
incl %ebp
jmp 0x28484
leaq 0x6ee59(%rip), %rdi     # 0x97306
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x42c0
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: printcontinstance
void printcontinstance(FILE *controlfile, Instanceptr inst)
{
 int i, instindex;
 Instanceptr inst1 = inst;
 int numrealfeatures = current_dataset->multifeaturecount - 1;
 fprintf(controlfile, "instance\n");
 instindex = 0;
 for (i = 0; i < numrealfeatures; i++)
  {
 	 fprintf(controlfile, "instance %d\n", instindex);
	  fprintf(controlfile, "inst :%f feature:%d \n ", real_feature(inst1, i), i);
  }
 instindex++;
 inst1 = inst1->sublist;
 while (inst1)
  {
 	 for (i = 0; i < numrealfeatures; i++)
 		 {
 			 fprintf(controlfile, "instance %d\n", instindex);
 			 fprintf(controlfile, "inst :%f feature:%d \n", real_feature(inst1, i), i);
 		 }
 		instindex++;
 		inst1 = inst1->next;
  }
 fprintf(controlfile, "\n\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xa5395(%rip), %rax     # 0xcd870
movq (%rax), %rax
movl 0x1c0(%rax), %r15d
decl %r15d
leaq 0x70178(%rip), %rdi     # 0x98667
pushq $0x9
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x42c0
xorl %eax, %eax
testl %r15d, %r15d
cmovlel %eax, %r15d
leaq 0x70164(%rip), %r13     # 0x98671
leaq 0x7013c(%rip), %r12     # 0x98650
xorl %ebp, %ebp
cmpl %ebp, %r15d
je 0x28547
movq %rbx, %rdi
movq %r13, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x42e0
movq %r14, %rdi
movl %ebp, %esi
callq 0x2aea2
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
movb $0x1, %al
callq 0x42e0
incl %ebp
jmp 0x28516
addq $0x28, %r14
pushq $0x1
popq %rbp
leaq 0x70129(%rip), %r12     # 0x9867e
movq (%r14), %r14
testq %r14, %r14
je 0x285a0
xorl %r13d, %r13d
cmpl %r13d, %r15d
je 0x28598
movq %rbx, %rdi
leaq 0x70102(%rip), %rsi     # 0x98671
movl %ebp, %edx
xorl %eax, %eax
callq 0x42e0
movq %r14, %rdi
movl %r13d, %esi
callq 0x2aea2
movq %rbx, %rdi
movq %r12, %rsi
movl %r13d, %edx
movb $0x1, %al
callq 0x42e0
incl %r13d
jmp 0x28560
incl %ebp
addq $0x10, %r14
jmp 0x28555
leaq 0x6ed5f(%rip), %rdi     # 0x97306
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x42c0
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: printgamma
void printgamma(FILE *controlfile, double **gamma, Hmmptr hmm, int seqlen)
{
 int i, t;
 fprintf(controlfile, "\ngamma:\n");
 for (t = 0; t < seqlen; t++)
  {
 	 fprintf(controlfile, "%d ", t);
 	 for (i = 0; i < hmm->statecount; i++)
 		  fprintf(controlfile, "%.14f ", gamma[t][i]);
 	 fprintf(controlfile, "\n");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x700b4(%rip), %rdi     # 0x98694
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
movq %r12, %rcx
callq 0x42c0
xorl %eax, %eax
testl %ebx, %ebx
cmovlel %eax, %ebx
movq %rbx, (%rsp)
leaq 0x7011e(%rip), %rbp     # 0x9871e
xorl %r13d, %r13d
cmpq (%rsp), %r13
je 0x28653
movq %r12, %rdi
leaq 0x776a5(%rip), %rsi     # 0x9fcb8
movl %r13d, %edx
xorl %eax, %eax
callq 0x42e0
xorl %ebx, %ebx
movslq 0x8(%r14), %rax
cmpq %rax, %rbx
jge 0x28643
movq (%r15,%r13,8), %rax
movsd (%rax,%rbx,8), %xmm0
movq %r12, %rdi
movq %rbp, %rsi
movb $0x1, %al
callq 0x42e0
incq %rbx
jmp 0x2861f
pushq $0xa
popq %rdi
movq %r12, %rsi
callq 0x4150
incq %r13
jmp 0x28603
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: best_hmm_for_single
Hmmptr best_hmm_for_single(Instanceptr traindata, Instanceptr cvdata, Hmm_parameterptr p)
{
 /*!Last Changed 14.04.2007*/
 double ll, bestll;
 Hmmptr hmm, besthmm;
 hmm = random_hmm(2, p->statetype, 1, p->hmmtype, traindata); 
 baumwelch(hmm, traindata, p->iteration);
 ll = bestll = loglikelihood_of_hmm(hmm, cvdata);
 while (ll >= bestll)
  {
   bestll = ll;
   besthmm = clone_hmm(hmm);
   free_hmm(hmm);
   hmm = apply_operator(besthmm, 0, p, traindata);
   ll = loglikelihood_of_hmm(hmm, cvdata);  
  }
 free_hmm(hmm);
 return besthmm;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl (%rdx), %ecx
movl 0x4(%rdx), %esi
pushq $0x2
popq %rdi
pushq $0x1
popq %rdx
movq %r15, %r8
callq 0x2460f
movq %rax, %r12
movl 0x8(%rbx), %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x27f37
movq %r12, %rdi
movq %r14, %rsi
callq 0x288d2
movapd %xmm0, %xmm1
ucomisd %xmm1, %xmm0
jb 0x288b9
movq %r12, %rdi
movsd %xmm0, 0x8(%rsp)
callq 0x250b5
movq %rax, %r13
movq %r12, %rdi
callq 0x24a32
movq %r13, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x289aa
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x288d2
movsd 0x8(%rsp), %xmm1
jmp 0x28874
movq %r12, %rdi
callq 0x24a32
movq %r13, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: loglikelihood_of_hmm
double loglikelihood_of_hmm(Hmmptr hmm, Instanceptr data)
{
 /*!Last Changed 04.04.2007*/
 double **alpha, *scale, ll, total_loglikelihood = 0.0;
 int seqlen, count = 0;
 Instanceptr inst;
 inst = data;
 while (inst)
  {
   seqlen = frame_count(inst);
   alpha = (double **) safemalloc_2d(sizeof(double*), sizeof(double), seqlen, hmm->statecount, "loglikelihood_of_hmm", 5);
   scale = safecalloc(seqlen, sizeof(double), "loglikelihood_of_hmm", 6);
   calc_fwd(hmm, inst, alpha, &ll, scale);   
   free_2d((void **) alpha, seqlen);
   safe_free(scale);
   total_loglikelihood += ll;
   inst = inst->next;
   count++;
  }
 return total_loglikelihood / count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, 0x10(%rsp)
xorl %eax, %eax
xorpd %xmm0, %xmm0
movq 0x10(%rsp), %r12
pushq $0x8
popq %r14
testq %rbx, %rbx
je 0x28993
movq %rbx, %rdi
movsd %xmm0, 0x18(%rsp)
movl %eax, 0xc(%rsp)
callq 0x2adc0
movl %eax, %r13d
movl 0x8(%r12), %ecx
movq %r14, %rdi
movq %r14, %rsi
movl %eax, %edx
leaq 0x6fe47(%rip), %r15     # 0x98770
movq %r15, %r8
pushq $0x5
popq %r9
callq 0x351c3
movq %rax, %rbp
movslq %r13d, %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
pushq $0x6
popq %rcx
callq 0x35067
movq %rax, %r15
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x20(%rsp), %rcx
movq %rax, %r8
callq 0x27819
movq %rbp, %rdi
movl %r13d, %esi
callq 0x34fc3
movq %r15, %rdi
callq 0x34ff7
movl 0xc(%rsp), %eax
movsd 0x18(%rsp), %xmm0
addsd 0x20(%rsp), %xmm0
movq 0x10(%rbx), %rbx
incl %eax
jmp 0x288f7
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/hmm.c
// Function: apply_operator
Hmmptr apply_operator(Hmmptr hmm, int operatortype, Hmm_parameterptr p, Instanceptr traindata)
{
 /*!Last Changed 14.04.2007*/
 Hmmptr result;
 int statecount, componentcount;
 if (p->weightfreezing)
  {
   result = clone_hmm(hmm);
   if (in_list(operatortype, 2, ADD_ONE_STATE, ADD_ONE_BOTH))
     add_state(result, 1, traindata);
   if (in_list(operatortype, 2, ADD_ONE_COMPONENT, ADD_ONE_BOTH))
     add_component(result, 1, traindata);
  }
 else
  {
   statecount = hmm->statecount;
   componentcount = get_component_count(hmm->states[0], hmm->statetype);
   if (in_list(operatortype, 2, ADD_ONE_STATE, ADD_ONE_BOTH))
     statecount++;
   if (in_list(operatortype, 2, ADD_ONE_COMPONENT, ADD_ONE_BOTH))
     componentcount++;
   result = random_hmm(statecount, p->statetype, componentcount, p->hmmtype, traindata);
  }
 baumwelch(result, traindata, p->iteration);
 return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %ebp
cmpl $0x0, 0xc(%rdx)
je 0x28a12
callq 0x250b5
movq %rax, %r15
pushq $0x2
popq %rcx
movl %ebp, %edi
movl %ecx, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x35812
testl %eax, %eax
je 0x289ed
pushq $0x1
popq %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x25f36
pushq $0x1
popq %rdx
pushq $0x2
popq %rcx
movl %ebp, %edi
movl %ecx, %esi
xorl %eax, %eax
callq 0x35812
testl %eax, %eax
je 0x28a7e
pushq $0x1
popq %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x25cce
jmp 0x28a7e
movl 0x8(%rdi), %r15d
movl 0xc(%rdi), %eax
cmpl $0x4, %eax
je 0x28a26
xorl %r12d, %r12d
cmpl $0x2, %eax
jne 0x28a31
movq (%rdi), %rax
movq 0x18(%rax), %rax
movl 0x8(%rax), %r12d
pushq $0x2
popq %r13
movl %ebp, %edi
movl %r13d, %esi
xorl %edx, %edx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x35812
cmpl $0x1, %eax
sbbl $-0x1, %r15d
pushq $0x1
popq %rdx
movl %ebp, %edi
movl %r13d, %esi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x35812
cmpl $0x1, %eax
sbbl $-0x1, %r12d
movl (%r14), %ecx
movl 0x4(%r14), %esi
movl %r15d, %edi
movl %r12d, %edx
movq %rbx, %r8
callq 0x2460f
movq %rax, %r15
movl 0x8(%r14), %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x27f37
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq