LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblem.cpp
// Function: HMMProblem::free3Params(double*&, double**&, double**&, signed char)
void HMMProblem::free3Params(NUMBER* &PI, NUMBER** &A, NUMBER** &B, NPAR nS) {
    free(PI);
    free2D<NUMBER>(A, (NDAT)nS);
    free2D<NUMBER>(B, (NDAT)nS);
    PI = NULL;
    A  = NULL;
    B  = NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq (%rsi), %rdi
callq 0x42a0
movq (%r15), %rdi
movl %ebx, %esi
callq 0xa5e0
movq (%r14), %rdi
movl %ebx, %esi
callq 0xa5e0
xorl %eax, %eax
movq %rax, (%r12)
movq %rax, (%r15)
movq %rax, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblem.cpp
// Function: HMMProblem::checkConvergenceBig(FitBit**, int, double, double*)
bool HMMProblem::checkConvergenceBig(FitBit** fbs, NCAT nfbs, NUMBER tol, NUMBER *criterion) {
    NUMBER critetion_bit;
    for(NCAT x=0; x<nfbs; x++)
    {
        critetion_bit = 0;
        for(NPAR i=0; i<fbs[x]->nS; i++)
        {
            if(fbs[x]->pi != NULL) critetion_bit += pow( fbs[x]->pi[i]-fbs[x]->PIm1[i], 2 )/*:0*/;
            for(NPAR j=0; (fbs[x]->A != NULL) && j<fbs[x]->nS; j++) {
                critetion_bit+= pow(fbs[x]->A[i][j] - fbs[x]->Am1[i][j],2);
            }
            for(NPAR k=0; (fbs[x]->B != NULL) && k<fbs[x]->nO; k++) {
                critetion_bit += pow(fbs[x]->B[i][k] - fbs[x]->Bm1[i][k],2);
            }
        }
        *criterion += sqrt(critetion_bit);
    }
    *criterion/=nfbs;
	return (*criterion) < tol; // double the truth or false
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movsd %xmm0, 0x10(%rsp)
movl %edx, 0xc(%rsp)
testl %edx, %edx
jle 0x17664
movq %rsi, %r14
movl 0xc(%rsp), %r15d
xorl %r12d, %r12d
xorpd %xmm2, %xmm2
xorl %r13d, %r13d
movq (%r14,%r13,8), %rax
movsbq 0x1(%rax), %rcx
xorpd %xmm0, %xmm0
testq %rcx, %rcx
jle 0x1763b
movq 0x10(%rax), %rdx
movq (%r14,%r13,8), %rsi
movq 0x18(%rsi), %rdi
movq 0x20(%rsi), %r8
xorl %r9d, %r9d
testq %rdx, %rdx
je 0x175a1
movsd (%rdx,%r9,8), %xmm1
movq 0x28(%rax), %r10
subsd (%r10,%r9,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
testq %rdi, %rdi
je 0x175e9
movzbl 0x1(%rsi), %r10d
testb %r10b, %r10b
cmovlel %r12d, %r10d
movzbl %r10b, %r10d
xorl %r11d, %r11d
cmpq %r11, %r10
je 0x175e9
movq (%rdi,%r9,8), %rbp
movsd (%rbp,%r11,8), %xmm1
movq 0x30(%rsi), %rbp
movq (%rbp,%r9,8), %rbp
subsd (%rbp,%r11,8), %xmm1
incq %r11
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
testq %rdi, %rdi
jne 0x175b9
testq %r8, %r8
je 0x1762f
movl (%rsi), %r10d
testb %r10b, %r10b
cmovlel %r12d, %r10d
movzbl %r10b, %r10d
xorl %r11d, %r11d
cmpq %r11, %r10
je 0x1762f
movq (%r8,%r9,8), %rbp
movsd (%rbp,%r11,8), %xmm1
movq 0x38(%rsi), %rbp
movq (%rbp,%r9,8), %rbp
subsd (%rbp,%r11,8), %xmm1
incq %r11
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
testq %r8, %r8
jne 0x175ff
incq %r9
cmpq %rcx, %r9
jne 0x17584
ucomisd %xmm2, %xmm0
jb 0x17647
sqrtsd %xmm0, %xmm0
jmp 0x17650
callq 0x41a0
xorpd %xmm2, %xmm2
addsd (%rbx), %xmm0
movsd %xmm0, (%rbx)
incq %r13
cmpq %r15, %r13
jne 0x1755b
xorps %xmm0, %xmm0
cvtsi2sdl 0xc(%rsp), %xmm0
movsd (%rbx), %xmm1
divsd %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
ucomisd %xmm1, %xmm0
movsd %xmm1, (%rbx)
seta %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblem.cpp
// Function: HMMProblem::BaumWelchBit(FitBit*)
FitResult HMMProblem::BaumWelchBit(FitBit *fb) {
    FitResult fr;
    fr.iter = 1;
    fr.pO0  = 0.0;
    fr.pO   = 0.0;
    fr.conv = 0; // converged
    fr.ndat = 0;
    NCAT xndat = fb->xndat;
    struct data **x_data = fb->x_data;
    
    fr.ndat = -1; // no accounting so far
    while( !fr.conv && fr.iter<=this->p->maxiter ) {
        if(fr.iter==1) {
            fr.ndat = computeAlphaAndPOParam(xndat, x_data);
            fr.pO0 = HMMProblem::getSumLogPOPara(xndat, x_data);
            fr.pOmid = fr.pO0;
        }
        fb->copy(FBS_PAR, FBS_PARm1);
        fr.pO = doBaumWelchStep(fb);// PI, A, B);
        
        // check convergence
        fr.conv = fb->checkConvergence(&fr);
        
        if( fr.conv || fr.iter==this->p->maxiter ) {
            //computeAlphaAndPOParam(fb->xndat, fb->x_data);
            fr.pO = HMMProblem::getSumLogPOPara(xndat, x_data);
        }
        fr.iter ++;
        fr.pOmid = fr.pO;
    } // main solver loop
    // recycle memory (Alpha, Beta, p_O_param, Xi, Gamma)
    RecycleFitData(fb->xndat, fb->x_data, this->p);
    fr.iter--;
    return fr;
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movl $0x1, (%rdi)
movq $0x0, 0x8(%rdi)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x18(%rdi)
movl 0xe8(%rdx), %r12d
movq 0xf0(%rdx), %r13
movl $0xffffffff, 0x24(%rdi) # imm = 0xFFFFFFFF
cmpl $0x0, 0x20(%rdi)
jne 0x17dd6
leaq 0x18(%rbx), %rbp
movl (%rbx), %eax
movq 0x88(%r14), %rcx
cmpl 0x38(%rcx), %eax
jg 0x17dd6
cmpl $0x1, %eax
jne 0x17d4b
movq %r14, %rdi
movl %r12d, %esi
movq %r13, %rdx
callq 0x11a86
movl %eax, 0x24(%rbx)
xorpd %xmm0, %xmm0
testl %r12d, %r12d
jle 0x17d41
xorl %eax, %eax
movq (%r13,%rax,8), %rcx
cmpl $0x0, 0x4(%rcx)
xorpd %xmm1, %xmm1
jne 0x17d35
movsd 0x50(%rcx), %xmm1
addsd %xmm1, %xmm0
incq %rax
cmpq %rax, %r12
jne 0x17d21
movsd %xmm0, 0x8(%rbx)
movsd %xmm0, 0x10(%rbx)
movq %r15, %rdi
movl $0x1, %esi
movl $0x2, %edx
callq 0xb032
movq %r14, %rdi
movq %r15, %rsi
callq 0x17e04
movsd %xmm0, 0x18(%rbx)
movq %r15, %rdi
movq %rbx, %rsi
callq 0xb162
movzbl %al, %eax
movl %eax, 0x20(%rbx)
testb %al, %al
jne 0x17d90
movl (%rbx), %eax
movq 0x88(%r14), %rcx
cmpl 0x38(%rcx), %eax
jne 0x17dc0
xorpd %xmm0, %xmm0
testl %r12d, %r12d
jle 0x17dbb
xorl %eax, %eax
movq (%r13,%rax,8), %rcx
cmpl $0x0, 0x4(%rcx)
xorpd %xmm1, %xmm1
jne 0x17daf
movsd 0x50(%rcx), %xmm1
addsd %xmm1, %xmm0
incq %rax
cmpq %rax, %r12
jne 0x17d9b
movsd %xmm0, (%rbp)
incl (%rbx)
movsd 0x18(%rbx), %xmm0
movsd %xmm0, 0x10(%rbx)
cmpl $0x0, 0x20(%rbx)
je 0x17cee
movl 0xe8(%r15), %edi
movq 0xf0(%r15), %rsi
movq 0x88(%r14), %rdx
callq 0xa39d
decl (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblem.cpp
// Function: HMMProblem::readNullObsRatio(_IO_FILE*, param*, int*)
void HMMProblem::readNullObsRatio(FILE *fid, struct param* param, NDAT *line_no) {
	NPAR i;
	//
	// read null skill ratios
	//
    fscanf(fid, "Null skill ratios\t");
    this->null_obs_ratio =Calloc(NUMBER, (size_t)this->p->nO);
    this->null_skill_obs      = 0;
    this->null_skill_obs_prob = 0;
	for(i=0; i<param->nO; i++) {
        if( i==(param->nO-1) ) // end
            fscanf(fid,"%lf\n",&this->null_obs_ratio[i] );
        else
            fscanf(fid,"%lf\t",&this->null_obs_ratio[i] );
		
        if( this->null_obs_ratio[i] > this->null_skill_obs_prob ) {
            this->null_skill_obs_prob = this->null_obs_ratio[i];
            this->null_skill_obs = i;
        }
	}
    (*line_no)++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, (%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x1c245(%rip), %rsi     # 0x354da
movq %r15, %rdi
xorl %eax, %eax
callq 0x4460
movq 0x88(%r12), %rax
movsbq 0x8b9(%rax), %rdi
movl $0x8, %esi
callq 0x4130
movq %rax, 0x18(%r12)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x28(%r12)
movb 0x8b9(%r14), %al
testb %al, %al
jle 0x1934a
xorl %ebx, %ebx
xorl %r13d, %r13d
xorl %ebp, %ebp
movsbl %al, %eax
decl %eax
movq 0x18(%r12), %rdx
addq %rbx, %rdx
cmpl %eax, %r13d
leaq 0x1c4e0(%rip), %rsi     # 0x357d2
leaq 0x1c4d4(%rip), %rax     # 0x357cd
cmoveq %rax, %rsi
movq %r15, %rdi
xorl %eax, %eax
callq 0x4460
movq 0x18(%r12), %rax
movsd (%rax,%rbx), %xmm0
ucomisd 0x30(%r12), %xmm0
jbe 0x19333
movsd %xmm0, 0x30(%r12)
movsbl %r13b, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x28(%r12)
incq %rbp
movsbq 0x8b9(%r14), %rax
incl %r13d
addq $0x8, %rbx
cmpq %rax, %rbp
jl 0x192db
movq (%rsp), %rax
incl (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblem.cpp
// Function: HMMProblem::checkConvergenceBig0(FitBit**, int, double, double*)
bool HMMProblem::checkConvergenceBig0(FitBit** fbs, NCAT nfbs, NUMBER tol, NUMBER *criterion) {
    for(NCAT x=0; x<nfbs; x++)
    {
        for(NPAR i=0; i<fbs[x]->nS; i++)
        {
            if(fbs[x]->pi != NULL) *criterion += pow( fbs[x]->pi[i]-fbs[x]->PIm1[i], 2 )/*:0*/;
            for(NPAR j=0; (fbs[x]->A != NULL) && j<fbs[x]->nS; j++) {
                *criterion += pow(fbs[x]->A[i][j] - fbs[x]->Am1[i][j],2);
            }
            for(NPAR k=0; (fbs[x]->B != NULL) && k<fbs[x]->nO; k++) {
                *criterion += pow(fbs[x]->B[i][k] - fbs[x]->Bm1[i][k],2);
            }
        }
    }
    *criterion = sqrt(*criterion);
	return (*criterion) < tol; // double the truth or false
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movapd %xmm0, %xmm2
testl %edx, %edx
jle 0x19a62
movl %edx, %eax
xorl %ecx, %ecx
xorl %edx, %edx
movq (%rsi,%rdx,8), %rdi
movsbq 0x1(%rdi), %r8
testq %r8, %r8
jle 0x19a56
movq 0x10(%rdi), %r9
movq (%rsi,%rdx,8), %r10
movq 0x18(%r10), %r11
movq 0x20(%r10), %r14
xorl %r15d, %r15d
testq %r9, %r9
je 0x199b6
movsd (%r9,%r15,8), %xmm0
movq 0x28(%rdi), %r12
subsd (%r12,%r15,8), %xmm0
mulsd %xmm0, %xmm0
addsd (%rbx), %xmm0
movsd %xmm0, (%rbx)
testq %r11, %r11
je 0x19a01
movzbl 0x1(%r10), %ebp
testb %bpl, %bpl
cmovlel %ecx, %ebp
movzbl %bpl, %r12d
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x19a01
movq (%r11,%r15,8), %rbp
movsd (%rbp,%r13,8), %xmm0
movq 0x30(%r10), %rbp
movq (%rbp,%r15,8), %rbp
subsd (%rbp,%r13,8), %xmm0
mulsd %xmm0, %xmm0
addsd (%rbx), %xmm0
incq %r13
movsd %xmm0, (%rbx)
testq %r11, %r11
jne 0x199cd
testq %r14, %r14
je 0x19a4a
movl (%r10), %ebp
testb %bpl, %bpl
cmovlel %ecx, %ebp
movzbl %bpl, %r12d
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x19a4a
movq (%r14,%r15,8), %rbp
movsd (%rbp,%r13,8), %xmm0
movq 0x38(%r10), %rbp
movq (%rbp,%r15,8), %rbp
subsd (%rbp,%r13,8), %xmm0
mulsd %xmm0, %xmm0
addsd (%rbx), %xmm0
incq %r13
movsd %xmm0, (%rbx)
testq %r14, %r14
jne 0x19a16
incq %r15
cmpq %r8, %r15
jne 0x19995
incq %rdx
cmpq %rax, %rdx
jne 0x19970
movsd (%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x19a76
sqrtsd %xmm0, %xmm0
jmp 0x19a85
movsd %xmm2, (%rsp)
callq 0x41a0
movsd (%rsp), %xmm2
ucomisd %xmm0, %xmm2
movsd %xmm0, (%rbx)
seta %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblem.cpp
// Function: HMMProblem::toFileAlphaBetaObs(char const*, int)
void HMMProblem::toFileAlphaBetaObs(const char *filename, NCAT k) {
    NPAR nS = this->p->nS;
    FILE *fid = fopen(filename,"w");
    
    if(fid == NULL) {
        fprintf(stderr,"Can't write output model file %s\n",filename);
        exit(1);
    }
    
    struct data *dt = this->p->k_data[k];
    
    for(NDAT tt=0; tt<dt->n; tt++) {
        for(NPAR i=0; i<nS; i++) fprintf(fid,"%20.17f\t", dt->alpha[tt][i]);
        for(NPAR i=0; i<nS; i++) fprintf(fid,"%20.17f\t", dt->beta[tt][i]);
        fprintf(fid,"%i\n", this->p->dat_obs[ dt->ix[tt] ]);
    }
   fclose(fid);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x88(%rdi), %rax
movzbl 0x8b8(%rax), %r13d
leaq 0x1b9ed(%rip), %rsi     # 0x354b6
movq %r15, %rdi
callq 0x4290
testq %rax, %rax
je 0x19bb1
movq %rax, %r14
movq 0x88(%rbx), %rax
movq 0x8f0(%rax), %rax
movslq %ebp, %rcx
movq (%rax,%rcx,8), %rbp
cmpl $0x0, (%rbp)
jle 0x19b9b
leaq 0x1bcee(%rip), %r15     # 0x357f1
xorl %r12d, %r12d
movq %rbx, (%rsp)
testb %r13b, %r13b
jle 0x19b33
xorl %ebx, %ebx
movq 0x28(%rbp), %rax
movq (%rax,%r12,8), %rax
movsd (%rax,%rbx,8), %xmm0
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x4330
incq %rbx
cmpq %rbx, %r13
jne 0x19b11
testb %r13b, %r13b
jle 0x19b5c
xorl %ebx, %ebx
movq 0x30(%rbp), %rax
movq (%rax,%r12,8), %rax
movsd (%rax,%rbx,8), %xmm0
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x4330
incq %rbx
cmpq %rbx, %r13
jne 0x19b3a
movq (%rsp), %rbx
movq 0x88(%rbx), %rax
movq 0x870(%rax), %rax
movq 0x10(%rbp), %rcx
movslq (%rcx,%r12,4), %rcx
movsbl (%rax,%rcx), %edx
movq %r14, %rdi
leaq 0x1af62(%rip), %rsi     # 0x34ae6
xorl %eax, %eax
callq 0x4330
incq %r12
movslq (%rbp), %rax
cmpq %rax, %r12
jl 0x19b0a
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4200
movq %r15, %rdi
callq 0x4d3b
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemPiGK.cpp
// Function: HMMProblemPiGK::HMMProblemPiGK(param*)
HMMProblemPiGK::HMMProblemPiGK(struct param *param) {
    for(NPAR i=0; i<3; i++) this->sizes[i] = param->nK;
//    this->sizes = {param->nK, param->nK, param->nK};
    this->n_params = param->nK * 4 + param->nG;
    init(param);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x10b14
leaq 0x25a9e(%rip), %rax     # 0x3f670
movq %rax, (%rbx)
movl $0x3, %eax
movl 0x8c0(%r14), %ecx
movl %ecx, (%rbx,%rax,4)
incq %rax
cmpq $0x6, %rax
jne 0x19bda
movl 0x8c0(%r14), %eax
shll $0x2, %eax
addl 0x8bc(%r14), %eax
movl %eax, 0x8(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19c28
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x11386
movq %r14, %rdi
callq 0x4430
nop
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemPiGK.cpp
// Function: HMMProblemPiGK::setGradPI(FitBit*)
void HMMProblemPiGK::setGradPI(FitBit *fb){
    if(this->p->block_fitting[0]>0) return;
    NDAT t = 0, ndat = 0;
    NPAR i, o;
    NUMBER combined, deriv_logit;
    struct data* dt;
    for(NCAT x=0; x<fb->xndat; x++) {
        dt = fb->x_data[x];
        if( dt->cnt!=0 ) continue;
        ndat += dt->n;
//    o = dt->obs[t];
        o = this->p->dat_obs[ dt->ix[t] ];//->get( dt->ix[t] );
        for(i=0; i<fb->nS; i++) {
            combined = getPI(dt,i);//sigmoid( logit(this->PI[k][i]) + logit(this->PIg[g][i]) );
            deriv_logit = 1 / safe0num( fb->pi[i] * (1-fb->pi[i]) );
            fb->gradPI[i] -= combined * (1-combined) * deriv_logit * dt->beta[t][i] * ((o<0)?1:getB(dt,i,o)) / safe0num(dt->p_O_param);
        }
    }
    if( this->p->Cslices>0 ) // penalty
        fb->addL2Penalty(FBV_PI, this->p, (NUMBER)ndat);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x88(%rdi), %rax
cmpb $0x0, 0x981(%rax)
jle 0x1a399
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x0, 0xe8(%rsi)
jle 0x1a4ec
xorl %r12d, %r12d
xorl %ecx, %ecx
movq 0xf0(%rbx), %rax
movq (%rax,%r12,8), %r15
cmpl $0x0, 0x4(%r15)
jne 0x1a4d0
addl (%r15), %ecx
cmpb $0x0, 0x1(%rbx)
jle 0x1a4d0
movl %ecx, 0x10(%rsp)
movq 0x88(%r14), %rax
movq 0x870(%rax), %rax
movq 0x10(%r15), %rcx
movslq (%rcx), %rcx
movb (%rax,%rcx), %r13b
movsbl %r13b, %eax
movl %eax, 0x14(%rsp)
xorl %ebp, %ebp
movq (%r14), %rax
movsbl %bpl, %edx
movq %r14, %rdi
movq %r15, %rsi
callq *0x10(%rax)
movsd %xmm0, 0x8(%rsp)
movq 0x10(%rbx), %rax
movsd (%rax,%rbp,8), %xmm1
movsd 0x1a4ce(%rip), %xmm0    # 0x348f0
subsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
callq 0x8d88
movsd 0x1a4b9(%rip), %xmm2    # 0x348f0
movapd %xmm2, %xmm1
divsd %xmm0, %xmm1
movapd %xmm2, %xmm0
movsd 0x8(%rsp), %xmm3
subsd %xmm3, %xmm0
mulsd %xmm3, %xmm0
mulsd %xmm1, %xmm0
movq 0x30(%r15), %rax
movq (%rax), %rax
mulsd (%rax,%rbp,8), %xmm0
movsd %xmm0, 0x8(%rsp)
movapd %xmm2, %xmm0
testb %r13b, %r13b
js 0x1a484
movq (%r14), %rax
movsbl %bpl, %edx
movq %r14, %rdi
movq %r15, %rsi
movl 0x14(%rsp), %ecx
callq *0x20(%rax)
movsd 0x8(%rsp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x48(%r15), %xmm0
callq 0x8d88
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movq 0x58(%rbx), %rax
movsd (%rax,%rbp,8), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rbp,8)
incq %rbp
movsbq 0x1(%rbx), %rax
cmpq %rax, %rbp
jl 0x1a3fb
movl 0x10(%rsp), %ecx
incq %r12
movslq 0xe8(%rbx), %rax
cmpq %rax, %r12
jl 0x1a3b1
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
jmp 0x1a4f0
xorpd %xmm0, %xmm0
movq 0x88(%r14), %rdx
cmpb $0x0, 0x42(%rdx)
jle 0x1a38a
movq %rbx, %rdi
movl $0x1, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb936
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemPiGK.cpp
// Function: HMMProblemPiGK::fit()
void HMMProblemPiGK::fit() {
    NUMBER* loglik_rmse = init1D<NUMBER>(2);
    FitNullSkill(loglik_rmse, false /*do not need RMSE/SE*/);
    if(this->p->structure == STRUCTURE_PIgk) {
        loglik_rmse[0] += GradientDescent();
    } else {
        fprintf(stderr,"Solver specified is not supported.\n");
        exit(1);
    }
    this->neg_log_lik = loglik_rmse[0];
    free(loglik_rmse);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x2, %edi
movl $0x8, %esi
callq 0x4130
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x1442c
movq 0x88(%rbx), %rax
cmpb $0x4, 0x3e(%rax)
jne 0x1aa97
movq (%rbx), %rax
movq %rbx, %rdi
callq *0xa0(%rax)
addsd (%r14), %xmm0
movsd %xmm0, (%r14)
movsd %xmm0, 0x20(%rbx)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x42a0
callq 0x4df6
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemPiGKww.cpp
// Function: HMMProblemPiGKww::init(param*)
void HMMProblemPiGKww::init(struct param *param){
//    HMMProblemPiGK::init(param);
    this->ww = init1D<NUMBER>(3);
	this->ww[0] = 0.5;//1;
	this->ww[1] = 0.5;//1;
    this->ww[2] = 0;//0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x3, %edi
movl $0x8, %esi
callq 0x4130
movq %rax, 0x98(%rbx)
movabsq $0x3fe0000000000000, %rcx # imm = 0x3FE0000000000000
movq %rcx, (%rax)
movq %rcx, 0x8(%rax)
movq $0x0, 0x10(%rax)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemPiGKww.cpp
// Function: HMMProblemPiGKww::getPI(data*, signed char)
NUMBER HMMProblemPiGKww::getPI(struct data* dt, NPAR i) {
//    NUMBER p = this->pi[dt->k][i] * 2 * this->ww[0][i], q = this->PIg[dt->g][i] * 2 * this->ww[1][i];
//    return 1/( 1 + (1-p)*(1-q)/(p*q) );

//    NUMBER lw0 = logit(this->ww[0][i]), lw1 = logit(this->ww[1][i]);
//    NUMBER p = this->pi[dt->k][i], q = this->PIg[dt->g][i];
//    return 1/( 1 + pow(1-p,lw0)*pow(1-q,lw1)/(pow(p,lw0)*pow(q,lw1)) );
    
//    NUMBER p = this->pi[dt->k][i] * 2 * this->ww[0], q = this->PIg[dt->g][i] * 2 * this->ww[1];
//    return 1/( 1 + (1-p)*(1-q)/(p*q) );

//    // a logit(k) + b logit(u)
//    NUMBER p = pow((1-this->pi[dt->k][i])/safe0num(this->pi[dt->k][i]), this->ww[0]), q = pow((1-this->PIg[dt->g][i])/safe0num(this->PIg[dt->g][i]), this->ww[1]);
//    return 1/( 1 + p*q/exp(this->ww[2]) );
    
    // logit1(a) logit(k) + logit1(b) logit(u)
    NUMBER p = this->pi[dt->k][i], q = this->PIg[dt->g][i];
    return 1/( 1 + pow( (1-p)/p,1+logit(this->ww[0])) * pow( (1-q)/q,1+logit(this->ww[1])) * ( (0.5-this->ww[2])/safe0num(0.5+this->ww[2]) )/* */  );
    
//    // logit1(a) logit(k) + logit1(b) logit(u)
//    NUMBER p = this->pi[dt->k][i], q = this->PIg[dt->g][i];
//    NUMBER a = 1+sqrt(3)*(this->ww[0]-0.5)/sqrt(1-pow(this->ww[0]-0.5,2)),
//           b = 1+sqrt(3)*(this->ww[1]-0.5)/sqrt(1-pow(this->ww[1]-0.5,2)),
//           c = 1+sqrt(3)*(this->ww[2]-0.5)/sqrt(1-pow(this->ww[2]-0.5,2));
//    
//    return 1/( 1 + pow( (1-p)/p,a) * pow( (1-q)/q,b) * exp(-c)  );
    
    
    
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movslq 0x58(%rsi), %rax
movq 0x38(%rdi), %rcx
movq 0x90(%rdi), %rdi
movq (%rcx,%rax,8), %rax
movslq %edx, %rcx
movsd (%rax,%rcx,8), %xmm0
movslq 0x5c(%rsi), %rax
movq (%rdi,%rax,8), %rax
movsd (%rax,%rcx,8), %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x18be4(%rip), %xmm1    # 0x348f0
subsd %xmm0, %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movq 0x98(%rbx), %rax
movsd (%rax), %xmm0
callq 0x8e13
movapd %xmm0, %xmm1
addsd 0x18bbb(%rip), %xmm1    # 0x348f0
movsd (%rsp), %xmm0
callq 0x4420
movsd %xmm0, (%rsp)
movsd 0x18ba4(%rip), %xmm1    # 0x348f0
movsd 0x8(%rsp), %xmm0
subsd %xmm0, %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movq 0x98(%rbx), %rax
movsd 0x8(%rax), %xmm0
callq 0x8e13
movapd %xmm0, %xmm1
addsd 0x18b73(%rip), %xmm1    # 0x348f0
movsd 0x8(%rsp), %xmm0
callq 0x4420
mulsd (%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x98(%rbx), %rax
movsd 0x10(%rax), %xmm0
movsd 0x18b79(%rip), %xmm1    # 0x34920
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
movsd %xmm2, (%rsp)
addsd %xmm1, %xmm0
callq 0x8d88
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
mulsd 0x8(%rsp), %xmm1
movsd 0x18b1c(%rip), %xmm0    # 0x348f0
addsd %xmm0, %xmm1
divsd %xmm1, %xmm0
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemPiGKww.cpp
// Function: HMMProblemPiGKww::computeGradients(FitBit*)
NDAT HMMProblemPiGKww::computeGradients(FitBit *fb){
    fb->toZero(FBS_GRAD);
    
    NDAT ndat = computeAlphaAndPOParam(fb->xndat, fb->x_data);
    computeBeta(fb->xndat, fb->x_data);

    /*vv diff vv*/
    if(fb->pi != NULL && this->p->block_fitting[0]==0) setGradPI(fb);
    if(fb->pi != NULL && this->p->block_fitting[0]==0) setGradWW(fb);
    /*^^ diff ^^*/

    if(fb->A  != NULL && this->p->block_fitting[1]==0) setGradA(fb);
    if(fb->B  != NULL && this->p->block_fitting[2]==0) setGradB(fb);
    return ndat;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movl $0x3, %esi
callq 0xaf7c
movl 0xe8(%rbx), %esi
movq 0xf0(%rbx), %rdx
movq %r14, %rdi
callq 0x11a86
movl %eax, %ebp
movl 0xe8(%rbx), %esi
movq 0xf0(%rbx), %rdx
movq %r14, %rdi
callq 0x11dac
cmpq $0x0, 0x10(%rbx)
je 0x1c86c
movq 0x88(%r14), %rax
cmpb $0x0, 0x981(%rax)
jne 0x1c86c
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0x28(%rax)
cmpq $0x0, 0x10(%rbx)
je 0x1c892
movq 0x88(%r14), %rax
cmpb $0x0, 0x981(%rax)
jne 0x1c892
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0xc8(%rax)
cmpq $0x0, 0x18(%rbx)
je 0x1c8b5
movq 0x88(%r14), %rax
cmpb $0x0, 0x982(%rax)
jne 0x1c8b5
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0x30(%rax)
cmpq $0x0, 0x20(%rbx)
je 0x1c8d8
movq 0x88(%r14), %rax
cmpb $0x0, 0x983(%rax)
jne 0x1c8d8
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0x38(%rax)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemAGK.cpp
// Function: HMMProblemAGK::HMMProblemAGK(param*)
HMMProblemAGK::HMMProblemAGK(struct param *param) {
    this->sizes[0] = param->nK;
    this->sizes[1] = param->nK;
    this->sizes[2] = param->nK;
    this->n_params = param->nK * 4 + param->nG;
    init(param);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x10b14
leaq 0x21c0a(%rip), %rax     # 0x3f858
movq %rax, (%rbx)
movl 0x8c0(%r14), %eax
movl %eax, 0xc(%rbx)
movl 0x8c0(%r14), %eax
movl %eax, 0x10(%rbx)
movl 0x8c0(%r14), %eax
movl %eax, 0x14(%rbx)
movl 0x8c0(%r14), %eax
shll $0x2, %eax
addl 0x8bc(%r14), %eax
movl %eax, 0x8(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1dcaa
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x11386
movq %r14, %rdi
callq 0x4430
nop
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemAGK.cpp
// Function: HMMProblemAGK::destroy()
void HMMProblemAGK::destroy() {
	// destroy model data
    if( this->Ag != NULL) {
        free3D<NUMBER>(this->Ag, this->p->nG, this->p->nS);
        this->Ag = NULL;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x90(%rdi), %rdi
testq %rdi, %rdi
je 0x1e330
movq 0x88(%rbx), %rax
movl 0x8bc(%rax), %esi
movsbl 0x8b8(%rax), %edx
callq 0xca4f
movq $0x0, 0x90(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemPiAGK.cpp
// Function: HMMProblemPiAGK::HMMProblemPiAGK(param*)
HMMProblemPiAGK::HMMProblemPiAGK(struct param *param) {
//    this->sizes = {param->nK, param->nK, param->nK};
    this->sizes[0] = param->nK;
    this->sizes[1] = param->nK;
    this->sizes[2] = param->nK;
    this->n_params = param->nK * 4 + param->nG * 2;
    init(param);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x10b14
leaq 0x1fae2(%rip), %rax     # 0x3f928
movq %rax, (%rbx)
movl 0x8c0(%r14), %eax
movl %eax, 0xc(%rbx)
movl 0x8c0(%r14), %eax
movl %eax, 0x10(%rbx)
movl 0x8c0(%r14), %eax
movl %eax, 0x14(%rbx)
movl 0x8bc(%r14), %eax
movl 0x8c0(%r14), %ecx
shll $0x2, %ecx
leal (%rcx,%rax,2), %eax
movl %eax, 0x8(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1fea4
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x11386
movq %r14, %rdi
callq 0x4430
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemPiAGK.cpp
// Function: HMMProblemPiAGK::fit()
void HMMProblemPiAGK::fit() {
    NUMBER* loglik_rmse = init1D<NUMBER>(2);
    FitNullSkill(loglik_rmse, false /*do not need RMSE/SE*/);
    if(this->p->structure==STRUCTURE_PIAgk) {
        loglik_rmse[0] += GradientDescent();
    } else {
        fprintf(stderr,"Solver specified is not supported.\n");
        exit(1);
    }
    this->neg_log_lik = loglik_rmse[0];
    free(loglik_rmse);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x2, %edi
movl $0x8, %esi
callq 0x4130
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x1442c
movq 0x88(%rbx), %rax
cmpb $0x5, 0x3e(%rax)
jne 0x2117d
movq (%rbx), %rax
movq %rbx, %rdi
callq *0xa0(%rax)
addsd (%r14), %xmm0
movsd %xmm0, (%r14)
movsd %xmm0, 0x20(%rbx)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x42a0
callq 0x50e6
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemPiABGK.cpp
// Function: HMMProblemPiABGK::HMMProblemPiABGK(param*)
HMMProblemPiABGK::HMMProblemPiABGK(struct param *param) {
    //    this->sizes = {param->nK, param->nK, param->nK};
    this->sizes[0] = param->nK;
    this->sizes[1] = param->nK;
    this->sizes[2] = param->nK;
    this->n_params = param->nK * 4 + param->nG * 4;
    init(param);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x10b14
leaq 0x1d5da(%rip), %rax     # 0x3f9f8
movq %rax, (%rbx)
movl 0x8c0(%r14), %eax
movl %eax, 0xc(%rbx)
movl 0x8c0(%r14), %eax
movl %eax, 0x10(%rbx)
movl 0x8c0(%r14), %eax
movl %eax, 0x14(%rbx)
movl 0x8bc(%r14), %eax
addl 0x8c0(%r14), %eax
shll $0x2, %eax
movl %eax, 0x8(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2247a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x11386
movq %r14, %rdi
callq 0x4430
nop
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemPiABGK.cpp
// Function: HMMProblemPiABGK::destroy()
void HMMProblemPiABGK::destroy() {
	// destroy model data - only additional stuff
	free2D<NUMBER>(this->PIg, this->p->nG);
	free3D<NUMBER>(this->Ag, this->p->nG, this->p->nS);
	free3D<NUMBER>(this->Bg, this->p->nG, this->p->nS);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x88(%rdi), %rax
movq 0x90(%rdi), %rdi
movl 0x8bc(%rax), %esi
callq 0xa5e0
movq 0x88(%rbx), %rax
movq 0x98(%rbx), %rdi
movl 0x8bc(%rax), %esi
movsbl 0x8b8(%rax), %edx
callq 0xca4f
movq 0x88(%rbx), %rax
movq 0xa0(%rbx), %rdi
movl 0x8bc(%rax), %esi
movsbl 0x8b8(%rax), %edx
popq %rbx
jmp 0xca4f
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemPiABGK.cpp
// Function: HMMProblemPiABGK::setGradB(FitBit*)
void HMMProblemPiABGK::setGradB (FitBit *fb){
    if(this->p->block_fitting[2]>0) return;
    NDAT t, ndat = 0;
    NPAR o=0, i;
    NUMBER combined, deriv_logit;
    struct data* dt;
    for(NCAT x=0; x<fb->xndat; x++) {
        dt = fb->x_data[x];
        if( dt->cnt!=0 ) continue;
        ndat += dt->n;
        for(t=0; t<dt->n; t++) {
            o = this->p->dat_obs[ dt->ix[t] ];
            if(o<0)
                continue;
            for(i=0; i<fb->nS; i++) {
                combined = getB(dt,i,o);
                deriv_logit = 1 / safe0num( fb->B[i][o] * (1-fb->B[i][o]) );
                fb->gradB[i][o] -= combined * (1-combined) * deriv_logit * dt->alpha[t][i] * dt->beta[t][i] / safe0num(dt->p_O_param * ((o<0)?1:fb->B[i][o]));
            }
        }
    }
    if( this->p->Cslices>0 ) // penalty
        fb->addL2Penalty(FBV_B, this->p, (NUMBER)ndat);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x88(%rdi), %rax
cmpb $0x0, 0x983(%rax)
jle 0x23195
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x0, 0xe8(%rsi)
jle 0x2330b
xorl %ecx, %ecx
xorl %edx, %edx
movq 0xf0(%rbx), %rax
movq (%rax,%rcx,8), %r15
cmpl $0x0, 0x4(%r15)
jne 0x232ef
movl (%r15), %eax
addl %eax, %edx
testl %eax, %eax
jle 0x232ef
movl %edx, 0xc(%rsp)
movq %rcx, 0x10(%rsp)
xorl %ebp, %ebp
movq 0x88(%r14), %rax
movq 0x870(%rax), %rax
movq 0x10(%r15), %rcx
movslq (%rcx,%rbp,4), %rcx
movsbq (%rax,%rcx), %r12
testq %r12, %r12
js 0x232d7
cmpb $0x0, 0x1(%rbx)
jle 0x232d7
xorl %r13d, %r13d
movq (%r14), %rax
movsbl %r13b, %edx
movq %r14, %rdi
movq %r15, %rsi
movl %r12d, %ecx
callq *0x20(%rax)
movsd %xmm0, (%rsp)
movq 0x20(%rbx), %rax
movq (%rax,%r13,8), %rax
movsd (%rax,%r12,8), %xmm1
movsd 0x116b7(%rip), %xmm0    # 0x348f0
subsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
callq 0x8d88
movsd 0x116a2(%rip), %xmm2    # 0x348f0
movapd %xmm2, %xmm1
divsd %xmm0, %xmm1
movapd %xmm2, %xmm0
movsd (%rsp), %xmm2
subsd %xmm2, %xmm0
mulsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
movq 0x28(%r15), %rax
movq 0x30(%r15), %rcx
movq (%rax,%rbp,8), %rax
mulsd (%rax,%r13,8), %xmm0
movq (%rcx,%rbp,8), %rax
mulsd (%rax,%r13,8), %xmm0
movsd %xmm0, (%rsp)
movsd 0x48(%r15), %xmm0
movq 0x20(%rbx), %rax
movq (%rax,%r13,8), %rax
mulsd (%rax,%r12,8), %xmm0
callq 0x8d88
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movq 0x68(%rbx), %rax
movq (%rax,%r13,8), %rax
movsd (%rax,%r12,8), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, (%rax,%r12,8)
incq %r13
movsbq 0x1(%rbx), %rax
cmpq %rax, %r13
jl 0x2320b
incq %rbp
movslq (%r15), %rax
cmpq %rax, %rbp
jl 0x231da
movq 0x10(%rsp), %rcx
movl 0xc(%rsp), %edx
incq %rcx
movslq 0xe8(%rbx), %rax
cmpq %rax, %rcx
jl 0x231ac
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
jmp 0x2330f
xorpd %xmm0, %xmm0
movq 0x88(%r14), %rdx
cmpb $0x0, 0x42(%rdx)
jle 0x23186
movq %rbx, %rdi
movl $0x3, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb936
nop
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemSlicedAB.cpp
// Function: HMMProblemSlicedAB::HMMProblemSlicedAB(param*)
HMMProblemSlicedAB::HMMProblemSlicedAB(struct param *param) {
    NPAR i;
    switch (param->structure) {
        case STRUCTURE_SKABslc: // Expectation Maximization (Baum-Welch)
            for(i=0; i<3; i++) this->sizes[i] = param->nK;
            this->n_params = param->nK * 4 * param->nZ;
            break;
        default:
            fprintf(stderr,"Structure specified is not supported and should have been caught earlier\n");
            break;
    }
    init(param);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x10b14
leaq 0x1ab8e(%rip), %rax     # 0x3fac8
movq %rax, (%rbx)
cmpb $0xb, 0x3e(%r14)
jne 0x24f84
xorl %eax, %eax
movl 0x8c0(%r14), %ecx
movl %ecx, 0xc(%rbx,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x24f46
movsbl 0x8c8(%r14), %eax
imull 0x8c0(%r14), %eax
shll $0x2, %eax
movl %eax, 0x8(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x70(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x52d8
jmp 0x24f70
movq %rax, %r14
movq %rbx, %rdi
callq 0x11386
movq %r14, %rdi
callq 0x4430
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemSlicedAB.cpp
// Function: HMMProblemSlicedAB::init3Params(double*&, double***&, double***&, signed char, signed char, signed char)
void HMMProblemSlicedAB::init3Params(NUMBER* &PI, NUMBER*** &A, NUMBER*** &B, NPAR nZ, NPAR nS, NPAR nO) {  // sliced
    PI = init1D<NUMBER>((NDAT)nS);
    A  = init3D<NUMBER>((NDAT)nZ, (NDAT)nS, (NDAT)nS);
    B  = init3D<NUMBER>((NDAT)nZ, (NDAT)nS, (NDAT)nO);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movsbl 0x40(%rsp), %ebp
movslq %r9d, %r13
movl $0x8, %esi
movq %r13, %rdi
callq 0x4130
movq %rax, (%r12)
movl %ebx, %edi
movl %r13d, %esi
movl %r13d, %edx
callq 0xcaae
movq %rax, (%r15)
movl %ebx, %edi
movl %r13d, %esi
movl %ebp, %edx
callq 0xcaae
movq %rax, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemSlicedAB.cpp
// Function: HMMProblemSlicedAB::destroy()
void HMMProblemSlicedAB::destroy() {
    NPAR nS = this->p->nS, nZ = this->p->nZ;
	// destroy model data
	if(this->A  != NULL) free4D<NUMBER>(this->A,  this->sizes[1], this->p->nZ, this->p->nS);
	if(this->B  != NULL) free4D<NUMBER>(this->B,  this->sizes[2], this->p->nZ, this->p->nS);
	if(this->lbPI!=NULL) free(this->lbPI);
	if(this->ubPI!=NULL) free(this->ubPI);
	if(this->lbA!=NULL) free3D<NUMBER>(this->lbA, nZ, nS);
	if(this->ubA!=NULL) free3D<NUMBER>(this->ubA, nZ, nS);
	if(this->lbB!=NULL) free3D<NUMBER>(this->lbB, nZ, nS);
	if(this->ubB!=NULL) free3D<NUMBER>(this->ubB, nZ, nS);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movq 0x88(%rdi), %rax
movq 0x90(%rdi), %rdi
movsbl 0x8b8(%rax), %ebx
movsbl 0x8c8(%rax), %ebp
testq %rdi, %rdi
je 0x25b67
movl 0x10(%r14), %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x2b24d
movq 0x98(%r14), %rdi
testq %rdi, %rdi
je 0x25b91
movl 0x14(%r14), %esi
movq 0x88(%r14), %rax
movsbl 0x8c8(%rax), %edx
movsbl 0x8b8(%rax), %ecx
callq 0x2b24d
movq 0xa0(%r14), %rdi
testq %rdi, %rdi
je 0x25ba2
callq 0x42a0
movq 0xb8(%r14), %rdi
testq %rdi, %rdi
je 0x25bb3
callq 0x42a0
movq 0xa8(%r14), %rdi
testq %rdi, %rdi
je 0x25bc8
movl %ebp, %esi
movl %ebx, %edx
callq 0xca4f
movq 0xc0(%r14), %rdi
testq %rdi, %rdi
je 0x25bdd
movl %ebp, %esi
movl %ebx, %edx
callq 0xca4f
movq 0xb0(%r14), %rdi
testq %rdi, %rdi
je 0x25bf2
movl %ebp, %esi
movl %ebx, %edx
callq 0xca4f
movq 0xc8(%r14), %rdi
testq %rdi, %rdi
je 0x25c0b
movl %ebp, %esi
movl %ebx, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0xca4f
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemSlicedAB.cpp
// Function: HMMProblemSlicedAB::getA(int)
NUMBER*** HMMProblemSlicedAB::getA(NCAT x) {
    if( x > (this->sizes[1]-1) ) {
        fprintf(stderr,"While accessing A, skill index %d exceeded last index of the data %d.\n", x, this->sizes[1]-1);
        exit(1);
    }
    return this->A[x];
}

// Assembly:
movq %rdi, %rax
movl 0x10(%rdi), %edi
cmpl %esi, %edi
jle 0x25c5b
movq 0x90(%rax), %rax
movslq %esi, %rcx
movq (%rax,%rcx,8), %rax
retq
pushq %rax
callq 0x5364
nop
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemSlicedAB.cpp
// Function: HMMProblemSlicedAB::getB(int)
NUMBER*** HMMProblemSlicedAB::getB(NCAT x) {
    if( x > (this->sizes[2]-1) ) {
        fprintf(stderr,"While accessing B, skill index %d exceeded last index of the data %d.\n", x, this->sizes[2]-1);
        exit(1);
    }
    return this->B[x];
}

// Assembly:
movq %rdi, %rax
movl 0x14(%rdi), %edi
cmpl %esi, %edi
jle 0x25c7b
movq 0x98(%rax), %rax
movslq %esi, %rcx
movq (%rax,%rcx,8), %rax
retq
pushq %rax
callq 0x538b
nop
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemSlicedAB.cpp
// Function: HMMProblemSlicedAB::toZero3Params(double*&, double***&, double***&, signed char, signed char, signed char)
void HMMProblemSlicedAB::toZero3Params(NUMBER* &PI, NUMBER*** &A, NUMBER*** &B, NPAR nZ, NPAR nS, NPAR nO) { // sliced
    toZero1D<NUMBER>(PI, (NDAT)nS);
    toZero3D<NUMBER>(A,  (NDAT)nZ, (NDAT)nS, (NDAT)nS);
    toZero3D<NUMBER>(B,  (NDAT)nZ, (NDAT)nS, (NDAT)nO);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, %r13d
movl %r8d, %ebx
movq %rcx, 0x20(%rsp)
movq %rdx, %r15
testb %r13b, %r13b
jle 0x27b0d
movq (%rsi), %rdi
leal (,%r13,8), %edx
xorl %esi, %esi
callq 0x4120
movl %ebx, 0xc(%rsp)
movsbl %bl, %eax
movl %r13d, %r12d
movl %eax, %ecx
movq %rcx, 0x10(%rsp)
testb %al, %al
movq %r13, 0x18(%rsp)
jle 0x27b66
movq (%r15), %rbx
leaq (,%r12,8), %r15
xorl %r14d, %r14d
testb %r13b, %r13b
jle 0x27b57
movq (%rbx,%r14,8), %r13
xorl %ebp, %ebp
movq (%r13,%rbp,8), %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x4120
incq %rbp
cmpq %rbp, %r12
jne 0x27b40
incq %r14
cmpq 0x10(%rsp), %r14
movq 0x18(%rsp), %r13
jne 0x27b35
cmpb $0x0, 0xc(%rsp)
jle 0x27bbd
movb 0x60(%rsp), %bpl
movq 0x20(%rsp), %rax
movq (%rax), %r15
movsbq %bpl, %rax
movl %eax, %r14d
shlq $0x3, %r14
xorl %ebx, %ebx
testb %r13b, %r13b
jle 0x27bae
xorl %r13d, %r13d
testb %bpl, %bpl
jle 0x27ba6
movq (%r15,%rbx,8), %rax
movq (%rax,%r13,8), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x4120
incq %r13
cmpq %r13, %r12
jne 0x27b8f
incq %rbx
cmpq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r13
jne 0x27b87
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemSlicedAB.cpp
// Function: HMMProblemSlicedAB::cpy3Params(double*&, double***&, double***&, double*&, double***&, double***&, signed char, signed char, signed char)
void HMMProblemSlicedAB::cpy3Params(NUMBER* &soursePI, NUMBER*** &sourseA, NUMBER*** &sourseB, NUMBER* &targetPI, NUMBER*** &targetA, NUMBER*** &targetB, NPAR nZ, NPAR nS, NPAR nO) {  // sliced
    cpy1D<NUMBER>(soursePI, targetPI, (NDAT)nS);
    cpy3D<NUMBER>(sourseA,  targetA,  (NDAT)nZ, (NDAT)nS, (NDAT)nS);
    cpy3D<NUMBER>(sourseB,  targetB,  (NDAT)nZ, (NDAT)nS, (NDAT)nO);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r13
movq %rcx, 0x20(%rsp)
movq %rdx, %r12
movsbq 0x70(%rsp), %rbx
movsbl 0x68(%rsp), %ebp
movq (%rsi), %rsi
movq (%r8), %rdi
leaq (,%rbx,8), %r14
movq %r14, %rdx
callq 0x41c0
movl %ebp, %eax
movq %rax, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
movl %ebx, %r15d
movl %ebp, 0xc(%rsp)
testl %ebp, %ebp
jle 0x27c5b
movq (%r12), %r12
movq (%r13), %rbx
xorl %r13d, %r13d
cmpb $0x0, 0x18(%rsp)
jle 0x27c51
xorl %ebp, %ebp
movq (%rbx,%r13,8), %rax
movq (%rax,%rbp,8), %rdi
movq (%r12,%r13,8), %rax
movq (%rax,%rbp,8), %rsi
movq %r14, %rdx
callq 0x41c0
incq %rbp
cmpq %rbp, %r15
jne 0x27c31
incq %r13
cmpq 0x10(%rsp), %r13
jne 0x27c28
cmpb $0x0, 0xc(%rsp)
jle 0x27cb2
movq 0x60(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rcx), %r14
movq (%rax), %r12
movsbq 0x78(%rsp), %rbx
shlq $0x3, %rbx
xorl %r13d, %r13d
cmpb $0x0, 0x18(%rsp)
jle 0x27ca8
xorl %ebp, %ebp
movq (%r12,%r13,8), %rax
movq (%rax,%rbp,8), %rdi
movq (%r14,%r13,8), %rax
movq (%rax,%rbp,8), %rsi
movq %rbx, %rdx
callq 0x41c0
incq %rbp
cmpq %rbp, %r15
jne 0x27c88
incq %r13
cmpq 0x10(%rsp), %r13
jne 0x27c7f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemSlicedAB.cpp
// Function: HMMProblemSlicedAB::free3Params(double*&, double***&, double***&, signed char, signed char)
void HMMProblemSlicedAB::free3Params(NUMBER* &PI, NUMBER*** &A, NUMBER*** &B, NPAR nZ, NPAR nS) {  // sliced
    free(PI);
    free3D<NUMBER>(A, (NDAT)nZ, (NDAT)nS);
    free3D<NUMBER>(B, (NDAT)nZ, (NDAT)nS);
    PI = NULL;
    A  = NULL;
    B  = NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r9d, %ebx
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq (%rsi), %rdi
callq 0x42a0
movq (%r15), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0xca4f
movq (%r14), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0xca4f
xorl %eax, %eax
movq %rax, (%r12)
movq %rax, (%r15)
movq %rax, (%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemSlicedAB.cpp
// Function: HMMProblemSlicedAB::BaumWelchBit(FitBitSlicedAB*)
FitResult HMMProblemSlicedAB::BaumWelchBit(FitBitSlicedAB *fb) {
    FitResult fr;
    fr.iter = 1;
    fr.pO0  = 0.0;
    fr.pO   = 0.0;
    fr.conv = 0; // converged
    fr.ndat = 0;
    NCAT xndat = fb->xndat;
    struct data **x_data = fb->x_data;
    
    while( !fr.conv && fr.iter<=this->p->maxiter ) {
        fr.ndat = -1; // no accounting so far
        if(fr.iter==1) {
            computeAlphaAndPOParam(xndat, x_data);
            fr.pO0 = HMMProblemSlicedAB::getSumLogPOPara(xndat, x_data);
            fr.pOmid = fr.pO0;
        }
        fb->copy(FBS_PAR, FBS_PARm1);
        fr.pO = doBaumWelchStep(fb);// PI, A, B);
        
        // check convergence
        fr.conv = fb->checkConvergence(&fr);
        
        if( fr.conv || fr.iter==this->p->maxiter ) {
            //computeAlphaAndPOParam(fb->xndat, fb->x_data);
            fr.pO = HMMProblemSlicedAB::getSumLogPOPara(xndat, x_data);
        }
        fr.iter ++;
        fr.pOmid = fr.pO;
    } // main solver loop
    // recycle memory (Alpha, Beta, p_O_param, Xi, Gamma)
    RecycleFitData(fb->xndat, fb->x_data, this->p);
    fr.iter--;
    return fr;
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movl $0x1, (%rdi)
movq $0x0, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdi)
cmpl $0x0, 0x20(%rdi)
jne 0x297d1
leaq 0x18(%rbx), %r13
movl 0xd0(%r15), %ebp
movq 0xd8(%r15), %r12
movl (%rbx), %eax
movq 0x88(%r14), %rcx
cmpl 0x38(%rcx), %eax
jg 0x297d1
movl $0xffffffff, 0x24(%rbx) # imm = 0xFFFFFFFF
cmpl $0x1, %eax
jne 0x29763
movq %r14, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x25d92
movq %r14, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x1161c
movsd %xmm0, 0x8(%rbx)
movsd %xmm0, 0x10(%rbx)
movq %r15, %rdi
movl $0x1, %esi
movl $0x2, %edx
callq 0xd4bc
movq %r14, %rdi
movq %r15, %rsi
callq 0x29800
movsd %xmm0, 0x18(%rbx)
movq %r15, %rdi
movq %rbx, %rsi
callq 0xd5ec
movzbl %al, %eax
movl %eax, 0x20(%rbx)
testb %al, %al
jne 0x297a8
movl (%rbx), %eax
movq 0x88(%r14), %rcx
cmpl 0x38(%rcx), %eax
jne 0x297bb
movq %r14, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x1161c
movsd %xmm0, (%r13)
incl (%rbx)
movsd 0x18(%rbx), %xmm0
movsd %xmm0, 0x10(%rbx)
cmpl $0x0, 0x20(%rbx)
je 0x29721
movl 0xd0(%r15), %edi
movq 0xd8(%r15), %rsi
movq 0x88(%r14), %rdx
callq 0xa39d
decl (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/./utils.h
// Function: double**** init4D<double>(int, int, int, int)
T**** init4D(NDAT size1, NDAT size2, NDAT size3, NDAT size4) {
    NDAT i,j, l;
    T**** ar = Calloc(T ***, (size_t)size1);
    for(i=0; i<size1; i++) {
        ar[i] = Calloc(T**, (size_t)size2);
        for(j=0; j<size2; j++) {
            ar[i][j] = Calloc(T*, (size_t)size3);
            for(l=0; l<size3; l++)
                ar[i][j][l] = Calloc(T, (size_t)size4);
        }
    }
    return ar;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %ebp
movl %edx, %r15d
movl %esi, %r14d
movl %edi, %r13d
movslq %edi, %r12
movl $0x8, %esi
movq %r12, %rdi
callq 0x4130
movq %rax, (%rsp)
testl %r12d, %r12d
jle 0x2b23a
movslq %r14d, %rax
movslq %r15d, %r15
movslq %ebp, %r12
movl %r13d, %ecx
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movl %eax, %eax
movq %rax, 0x20(%rsp)
movl %r15d, %ebp
xorl %r14d, %r14d
movl $0x8, %esi
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x4130
movq %rax, %r13
movq (%rsp), %rax
movq %r14, 0x18(%rsp)
movq %r13, (%rax,%r14,8)
testl %ebx, %ebx
jle 0x2b22b
xorl %r14d, %r14d
movl $0x8, %esi
movq %r15, %rdi
callq 0x4130
movq %rax, (%r13,%r14,8)
testl %r15d, %r15d
jle 0x2b221
xorl %ebx, %ebx
movl $0x8, %esi
movq %r12, %rdi
callq 0x4130
movq (%r13,%r14,8), %rcx
movq %rax, (%rcx,%rbx,8)
incq %rbx
cmpq %rbx, %rbp
jne 0x2b203
incq %r14
cmpq 0x20(%rsp), %r14
jne 0x2b1ea
movq 0x18(%rsp), %r14
incq %r14
cmpq 0x8(%rsp), %r14
jne 0x2b1c1
movq (%rsp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/./utils.h
// Function: void free4D<double>(double****, int, int, int)
void free4D(T**** ar, NDAT size1, NDAT size2, NDAT size3) {
    for(NDAT i=0; i<size1; i++) {
        for(NDAT j=0; j<size2; j++) {
            for(NDAT l=0; l<size3; l++)
                free(ar[i][j][l]);
            free(ar[i][j]);
        }
        free(ar[i]);
    }
    free(ar);
    //    &ar = NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, 0xc(%rsp)
movl %edx, 0x8(%rsp)
movq %rdi, %r14
testl %esi, %esi
jle 0x2b2d1
movl %esi, %eax
movq %rax, 0x10(%rsp)
movl 0x8(%rsp), %r12d
movl 0xc(%rsp), %r13d
xorl %ebp, %ebp
cmpl $0x0, 0x8(%rsp)
jle 0x2b2be
xorl %r15d, %r15d
cmpl $0x0, 0xc(%rsp)
jle 0x2b2a9
xorl %ebx, %ebx
movq (%r14,%rbp,8), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%rbx,8), %rdi
callq 0x42a0
incq %rbx
cmpq %rbx, %r13
jne 0x2b290
movq (%r14,%rbp,8), %rax
movq (%rax,%r15,8), %rdi
callq 0x42a0
incq %r15
cmpq %r12, %r15
jne 0x2b287
movq (%r14,%rbp,8), %rdi
callq 0x42a0
incq %rbp
cmpq 0x10(%rsp), %rbp
jne 0x2b27d
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x42a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemSlicedA.cpp
// Function: HMMProblemSlicedA::HMMProblemSlicedA(param*)
HMMProblemSlicedA::HMMProblemSlicedA(struct param *param) {
    NPAR i;
    switch (param->structure) {
        case STRUCTURE_SKAslc: 
            for(i=0; i<3; i++) this->sizes[i] = param->nK;
            this->n_params = param->nK * 4 * param->nZ;
            break;
        default:
            fprintf(stderr,"Structure specified is not supported and should have been caught earlier\n");
            break;
    }
    init(param);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x10b14
leaq 0x148aa(%rip), %rax     # 0x3fbc8
movq %rax, (%rbx)
cmpb $0xc, 0x3e(%r14)
jne 0x2b368
xorl %eax, %eax
movl 0x8c0(%r14), %ecx
movl %ecx, 0xc(%rbx,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x2b32a
movsbl 0x8c8(%r14), %eax
imull 0x8c0(%r14), %eax
shll $0x2, %eax
movl %eax, 0x8(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x70(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x5416
jmp 0x2b354
movq %rax, %r14
movq %rbx, %rdi
callq 0x11386
movq %r14, %rdi
callq 0x4430
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemSlicedA.cpp
// Function: HMMProblemSlicedA::destroy()
void HMMProblemSlicedA::destroy() {
    NPAR nS = this->p->nS, nZ = this->p->nZ;
	// destroy model data
    if(this->A  != NULL) {
        free4D<NUMBER>(this->A,  this->sizes[1], this->p->nZ, this->p->nS);
        this->A = NULL;
    }
    if(this->lbA!=NULL) {
        free3D<NUMBER>(this->lbA, nZ, nS);
        this->lbA = NULL;
    }
    if(this->ubA!=NULL) {
        free3D<NUMBER>(this->ubA, nZ, nS);
        this->ubA = NULL;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x88(%rdi), %rax
movq 0x90(%rdi), %rdi
movsbl 0x8b8(%rax), %ebp
movsbl 0x8c8(%rax), %r14d
testq %rdi, %rdi
je 0x2be11
movl 0x10(%rbx), %esi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x2b24d
movq $0x0, 0x90(%rbx)
movq 0x98(%rbx), %rdi
testq %rdi, %rdi
je 0x2be32
movl %r14d, %esi
movl %ebp, %edx
callq 0xca4f
movq $0x0, 0x98(%rbx)
movq 0xa0(%rbx), %rdi
testq %rdi, %rdi
je 0x2be53
movl %r14d, %esi
movl %ebp, %edx
callq 0xca4f
movq $0x0, 0xa0(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemSlicedA.cpp
// Function: HMMProblemSlicedA::getA(int)
NUMBER*** HMMProblemSlicedA::getA(NCAT x) {
    if( x > (this->sizes[1]-1) ) {
        fprintf(stderr,"While accessing A, skill index %d exceeded last index of the data %d.\n", x, this->sizes[1]-1);
        exit(1);
    }
    return this->A[x];
}

// Assembly:
movq %rdi, %rax
movl 0x10(%rdi), %edi
cmpl %esi, %edi
jle 0x2bea1
movq 0x90(%rax), %rax
movslq %esi, %rcx
movq (%rax,%rcx,8), %rax
retq
pushq %rax
callq 0x54a2
nop