LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/FitBitSt.cpp
// Function: FitBitSt::~FitBitSt()
FitBitSt::~FitBitSt() {
    // this->PARAM is external reference, do not destroy it
    if(this->PARAMm1 != NULL) free(this->PARAMm1);
    if(this->PARAMm2 != NULL) free(this->PARAMm2);
//    if(this->GRAD != NULL) free(this->GRAD); is external reference, do not destroy it
    if(this->GRADm1 != NULL) free(this->GRADm1);
    if(this->GRADcopy != NULL) free(this->GRADcopy);
    if(this->PARAMcopy != NULL) free(this->PARAMcopy);
    if(this->DIR != NULL) free(this->DIR);
    if(this->DIRm1 != NULL) free(this->DIRm1);
    
    delete [] this->fit_results;

    if(this->sclsmplx_offsets != NULL) free(this->sclsmplx_offsets);
    if(this->sclsmplx_sizes != NULL) free(this->sclsmplx_sizes);
    if(this->sclsmplx_blocks != NULL) free(this->sclsmplx_blocks);
    if(this->param_blocks != NULL) free(this->param_blocks);
    if(this->sclsmplx_bound_offsets != NULL) free(this->sclsmplx_bound_offsets);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x7c3a
callq 0x2240
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x7c48
callq 0x2240
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x7c56
callq 0x2240
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0x7c64
callq 0x2240
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x7c72
callq 0x2240
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x7c80
callq 0x2240
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x7c8e
callq 0x2240
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0x7c9c
callq 0x2290
movq 0x98(%rbx), %rdi
testq %rdi, %rdi
je 0x7cad
callq 0x2240
movq 0xa8(%rbx), %rdi
testq %rdi, %rdi
je 0x7cbe
callq 0x2240
movq 0xb0(%rbx), %rdi
testq %rdi, %rdi
je 0x7ccf
callq 0x2240
movq 0xb8(%rbx), %rdi
testq %rdi, %rdi
je 0x7ce0
callq 0x2240
movq 0xa0(%rbx), %rdi
testq %rdi, %rdi
je 0x7cf2
popq %rbx
jmp 0x2240
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/FitBitSt.cpp
// Function: FitBitSt::checkConvergenceBitSingle(int, int, FitResult*)
NPAR FitBitSt::checkConvergenceBitSingle(NDAT offset, NDAT size, FitResult *fr) {
    NCAT i;
    NUMBER criterion = 0;
    NPAR res = 0;
    if(fr->pO0==fr->pO) {
        res = 1;
    } else {
        switch (this->tol_mode) {
            case 'p':
                for(i=offset; i<(offset+size); i++) {
                    criterion += pow( this->PARAM[i]-this->PARAMm1[i], 2 );
                }
                res = 1*(criterion < this->tol);
                break;
            case 'l':
                criterion = (fr->pO0-fr->pO)/fr->ndat;
                res = 1*(criterion < this->tol);
                break;
        }
    }
    fr->conv = res;
    return res;
}

// Assembly:
movsd 0x10(%rcx), %xmm0
movsd 0x18(%rcx), %xmm1
movb $0x1, %al
ucomisd %xmm1, %xmm0
jne 0x7ec2
jnp 0x7f31
movzbl 0xd0(%rdi), %eax
cmpl $0x6c, %eax
je 0x7f08
cmpl $0x70, %eax
jne 0x7f1a
testl %edx, %edx
jle 0x7f1e
addl %esi, %edx
movq 0x10(%rdi), %rax
movq 0x18(%rdi), %r8
movslq %esi, %rsi
movslq %edx, %rdx
xorpd %xmm0, %xmm0
movsd (%rax,%rsi,8), %xmm1
subsd (%r8,%rsi,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rsi
cmpq %rdx, %rsi
jl 0x7eeb
jmp 0x7f22
subsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x24(%rcx), %xmm1
divsd %xmm1, %xmm0
jmp 0x7f22
xorl %eax, %eax
jmp 0x7f31
xorpd %xmm0, %xmm0
movsd 0xc8(%rdi), %xmm1
ucomisd %xmm0, %xmm1
seta %al
movb %al, 0x20(%rcx)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/FitBitSt.cpp
// Function: FitBitSt::checkConvergence(int, int*, int*, int*, signed char*)
NCAT FitBitSt::checkConvergence(NCAT nbits, NDAT *offsets, NDAT* sizes, NCAT* blocks, NPAR *condition){
    NCAT n_conv = 0;
    bool res;
    for(NCAT i=0; i<nbits; i++) {
        if( condition[ blocks[i] ]==1 ) {
            res = checkConvergenceBit(offsets[i], sizes[i], &this->fit_results[i]);
//            if(blocks[i]<0 || blocks[i]>this->nK) {
//                int a = 0;
//            } // DEBUG
            condition[ blocks[i] ] = !res; // set active set value
        } else {
            res = 1;
        }
        n_conv += res;
    }
    return n_conv;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
testl %esi, %esi
jle 0x7fbc
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movl %esi, %eax
shlq $0x3, %rax
leaq (%rax,%rax,4), %rdx
xorl %r13d, %r13d
xorl %ebp, %ebp
movq %rdx, 0x8(%rsp)
movslq (%r14), %rax
movl $0x1, %ecx
cmpb $0x1, (%rbx,%rax)
jne 0x7fa3
movl (%r12), %esi
movl (%r15), %edx
movq 0x10(%rsp), %rdi
movq 0x58(%rdi), %rcx
addq %r13, %rcx
callq 0x7d54
movzbl %al, %ecx
xorb $0x1, %al
movslq (%r14), %rdx
movb %al, (%rbx,%rdx)
movq 0x8(%rsp), %rdx
addl %ecx, %ebp
addq $0x28, %r13
addq $0x4, %r15
addq $0x4, %r12
addq $0x4, %r14
cmpq %r13, %rdx
jne 0x7f6d
jmp 0x7fbe
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/FitBitSt.cpp
// Function: FitBitSt::checkConvergenceSingle(int, int*, int*, int*, signed char*)
NCAT FitBitSt::checkConvergenceSingle(NCAT nbits, NDAT *offsets, NDAT* sizes, NCAT* blocks, NPAR *condition) {
    NCAT n_conv = 0;
    bool res;
    for(NCAT i=0; i<nbits; i++) {
        if( condition[ blocks[i] ]==1 ) {
            res = checkConvergenceBitSingle(offsets[i], sizes[i], &this->fit_results[i]);
//            if(blocks[i]<0 || blocks[i]>this->nK) {
//                int a = 0;
//            } // DEBUG
            condition[ blocks[i] ] = !res; // set active set value
        } else {
            res = 1;
        }
        n_conv += res;
    }
    return n_conv;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
testl %esi, %esi
jle 0x8056
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movl %esi, %eax
shlq $0x3, %rax
leaq (%rax,%rax,4), %rdx
xorl %r13d, %r13d
xorl %ebp, %ebp
movq %rdx, 0x8(%rsp)
movslq (%r14), %rax
movl $0x1, %ecx
cmpb $0x1, (%rbx,%rax)
jne 0x803d
movl (%r12), %esi
movl (%r15), %edx
movq 0x10(%rsp), %rdi
movq 0x58(%rdi), %rcx
addq %r13, %rcx
callq 0x7eae
movzbl %al, %ecx
xorb $0x1, %al
movslq (%r14), %rdx
movb %al, (%rbx,%rdx)
movq 0x8(%rsp), %rdx
addl %ecx, %ebp
addq $0x28, %r13
addq $0x4, %r15
addq $0x4, %r12
addq $0x4, %r14
cmpq %r13, %rdx
jne 0x8007
jmp 0x8058
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/FitBitSt.cpp
// Function: FitBitSt::scaleGradients(bool, signed char*)
void FitBitSt::scaleGradients(bool direction, NPAR* condition) {
    NUMBER *TOSCALE = NULL;
    if(!direction) TOSCALE = this->GRAD;
    else TOSCALE = this->DIR;
    
    if(this->sclsmplx_n<=0 || this->sclsmplx_sizes==NULL || this->sclsmplx_offsets==NULL || this->sclsmplx_blocks==NULL) {
        fprintf(stderr,"Error, gradient scaling affordances were nnot created.\n");
        exit(1);
    }
    for(NCAT i=0; i<this->sclsmplx_n; i++) {
        if( condition[ this->sclsmplx_blocks[i] ]>0 ) {
            doLog10Scale1DGentle(&TOSCALE[ this->sclsmplx_offsets[i] ],
                                 &this->PARAM[ this->sclsmplx_offsets[i] ],
                                 this->sclsmplx_sizes[i]);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x30(%rdi), %rcx
leaq 0x48(%rdi), %rax
testl %esi, %esi
cmovneq %rax, %rcx
movl 0xc0(%rdi), %eax
testl %eax, %eax
jle 0x810f
movq %rdi, %r14
cmpq $0x0, 0xa8(%rdi)
je 0x810f
cmpq $0x0, 0x98(%r14)
je 0x810f
cmpq $0x0, 0xb0(%r14)
je 0x810f
movq %rdx, %rbx
movq (%rcx), %r15
xorl %r12d, %r12d
movq 0xb0(%r14), %rcx
movslq (%rcx,%r12,4), %rcx
cmpb $0x0, (%rbx,%rcx)
jle 0x80f8
movq 0x98(%r14), %rax
movq 0xa8(%r14), %rcx
movslq (%rax,%r12,4), %rsi
leaq (%r15,%rsi,8), %rdi
shlq $0x3, %rsi
addq 0x10(%r14), %rsi
movsbl (%rcx,%r12), %edx
callq 0x67a3
movl 0xc0(%r14), %eax
incq %r12
movslq %eax, %rcx
cmpq %rcx, %r12
jl 0x80b8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x27c3
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/FitBitSt.cpp
// Function: FitBitSt::projectToSimplex(bool, signed char*)
void FitBitSt::projectToSimplex(bool hasNon01Constraints, NPAR* condition) {
    if(this->sclsmplx_n<=0 || this->sclsmplx_sizes==NULL || this->sclsmplx_offsets==NULL || this->sclsmplx_blocks==NULL) {
        fprintf(stderr,"Error, projection to simplex affordances were nnot created.\n");
        exit(1);
    };
    if(hasNon01Constraints) {
        for(NCAT i=0; i<this->sclsmplx_n; i++) {
//            if(this->sclsmplx_blocks[i]<0 || this->sclsmplx_blocks[i]>this->nK) {
//                int a = 0;
//            } // DEBUG
            if( condition[ this->sclsmplx_blocks[i] ]>0 )
                projectsimplexbounded(&this->PARAM[ this->sclsmplx_offsets[i] ],
                                      &this->task->param_values_lb[ this->sclsmplx_bound_offsets[i] ],
                                      &this->task->param_values_ub[ this->sclsmplx_bound_offsets[i] ],
                                      this->sclsmplx_sizes[i]);
        }
    } else {
        for(NCAT i=0; i<this->sclsmplx_n; i++) {
//            if(this->sclsmplx_blocks[i]<0 || this->sclsmplx_blocks[i]>this->nK) {
//                int a = 0;
//            } // DEBUG
            if( condition[ this->sclsmplx_blocks[i] ] )
                projectsimplex(&this->PARAM[ this->sclsmplx_offsets[i] ], this->sclsmplx_sizes[i]);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl 0xc0(%rdi), %eax
testl %eax, %eax
jle 0x8216
movq %rdi, %r14
cmpq $0x0, 0xa8(%rdi)
je 0x8216
cmpq $0x0, 0x98(%r14)
je 0x8216
cmpq $0x0, 0xb0(%r14)
je 0x8216
movq %rdx, %rbx
xorl %r15d, %r15d
testb %sil, %sil
je 0x81c9
movq 0xb0(%r14), %rcx
movslq (%rcx,%r15,4), %rcx
cmpb $0x0, (%rbx,%rcx)
jle 0x81bc
movq 0x88(%r14), %rax
movq 0x98(%r14), %rcx
movslq (%rcx,%r15,4), %rdi
shlq $0x3, %rdi
addq 0x10(%r14), %rdi
movq 0xa0(%r14), %rcx
movslq (%rcx,%r15,4), %rdx
shlq $0x3, %rdx
movq 0x10(%rax), %rsi
addq %rdx, %rsi
addq 0x18(%rax), %rdx
movq 0xa8(%r14), %rax
movsbl (%rax,%r15), %ecx
callq 0x4ce4
movl 0xc0(%r14), %eax
incq %r15
movslq %eax, %rcx
cmpq %rcx, %r15
jl 0x815f
jmp 0x8210
movq 0xb0(%r14), %rcx
movslq (%rcx,%r15,4), %rcx
cmpb $0x0, (%rbx,%rcx)
je 0x8205
movq 0x98(%r14), %rax
movq 0xa8(%r14), %rcx
movslq (%rax,%r15,4), %rdi
shlq $0x3, %rdi
addq 0x10(%r14), %rdi
movsbl (%rcx,%r15), %esi
callq 0x3d7e
movl 0xc0(%r14), %eax
incq %r15
movslq %eax, %rcx
cmpq %rcx, %r15
jl 0x81c9
popq %rbx
popq %r14
popq %r15
retq
callq 0x27e8
nop
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/./utilsSt.h
// Function: int** initToValue2D<int>(int, int, int)
T** initToValue2D(NDAT size1, NDAT size2, T val) {
    T** ar = (T **)Calloc(T *, (size_t)size1);
    for(NDAT i=0; i<size1; i++) {
        ar[i] = (T *)Calloc(T, (size_t)size2);
        for(NDAT j=0; j<size2; j++)
            ar[i][j] = val;
    }
    return ar;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movl %esi, %r15d
movl %edi, %ebp
movslq %edi, %r12
movl $0x8, %esi
movq %r12, %rdi
callq 0x2110
movq %rax, %r14
testl %r12d, %r12d
jle 0x10adc
movslq %r15d, %r15
movl %ebp, %r12d
movl %r15d, %eax
leal 0x3(%r15), %r13d
decq %rax
movq %rax, %xmm0
pshufd $0x44, %xmm0, %xmm5     # xmm5 = xmm0[0,1,0,1]
shrl $0x2, %r13d
shlq $0x4, %r13
xorl %ebp, %ebp
movdqa 0x2472(%rip), %xmm0     # 0x12e50
pxor %xmm0, %xmm5
movdqa %xmm5, (%rsp)
movl $0x4, %esi
movq %r15, %rdi
callq 0x2110
movdqa 0x2893(%rip), %xmm8     # 0x13290
pcmpeqd %xmm7, %xmm7
movdqa 0x2447(%rip), %xmm6     # 0x12e50
movdqa (%rsp), %xmm5
movq %rax, (%r14,%rbp,8)
testl %r15d, %r15d
jle 0x10ad0
xorl %ecx, %ecx
movdqa 0x241b(%rip), %xmm0     # 0x12e40
movdqa 0x2853(%rip), %xmm1     # 0x13280
movdqa %xmm0, %xmm2
pxor %xmm6, %xmm2
movdqa %xmm2, %xmm3
pcmpgtd %xmm5, %xmm3
pcmpeqd %xmm5, %xmm2
pshufd $0xf5, %xmm2, %xmm4     # xmm4 = xmm2[1,1,3,3]
pand %xmm3, %xmm4
pshufd $0xf5, %xmm3, %xmm2     # xmm2 = xmm3[1,1,3,3]
por %xmm4, %xmm2
movd %xmm2, %edx
notl %edx
testb $0x1, %dl
je 0x10a61
movl %ebx, (%rax,%rcx)
pxor %xmm7, %xmm2
pextrw $0x4, %xmm2, %edx
testb $0x1, %dl
je 0x10a73
movl %ebx, 0x4(%rax,%rcx)
movdqa %xmm1, %xmm2
pxor %xmm6, %xmm2
movdqa %xmm2, %xmm3
pcmpgtd %xmm5, %xmm3
pcmpeqd %xmm5, %xmm2
pshufd $0xf5, %xmm2, %xmm4     # xmm4 = xmm2[1,1,3,3]
pand %xmm3, %xmm4
pshufd $0xf5, %xmm3, %xmm2     # xmm2 = xmm3[1,1,3,3]
por %xmm4, %xmm2
pxor %xmm7, %xmm2
pextrw $0x0, %xmm2, %edx
testb $0x1, %dl
je 0x10aab
movl %ebx, 0x8(%rax,%rcx)
pextrw $0x4, %xmm2, %edx
testb $0x1, %dl
je 0x10ab9
movl %ebx, 0xc(%rax,%rcx)
paddq %xmm8, %xmm0
paddq %xmm8, %xmm1
addq $0x10, %rcx
cmpq %rcx, %r13
jne 0x10a2d
incq %rbp
cmpq %r12, %rbp
jne 0x109e7
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/./StripedArray.h
// Function: StripedArray<signed char>::fromFileToArray(_IO_FILE*, int)
T* StripedArray<T>::fromFileToArray(FILE *f, NDAT N){
    T *result = (T*)malloc( (size_t)N*sizeof(T));
    NDAT nread = (NDAT)fread (result, sizeof(T), (size_t)N, f);
    if(nread != N) {
        fprintf(stderr,"Error reading data from file\n");
        return NULL;
    }
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movslq %esi, %r15
movq %r15, %rdi
callq 0x22a0
movq %rax, %rbx
movl $0x1, %esi
movq %rax, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x22d0
cmpl %r15d, %eax
jne 0xa757
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
callq 0x2961
xorl %ebx, %ebx
jmp 0xa74e
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemSt.cpp
// Function: HMMProblemSt::checkSkillConstraints(double*)
bool HMMProblemSt::checkSkillConstraints(NUMBER* param_skill) {
    NPAR nS = this->task->nS, nO = this->task->nO;
	NCAT skill1_n = nS * (1 + nS + nO); // number of params per 1 skill slot
    NUMBER sum = 0.0;
    
    for(NPAR l=0; l<skill1_n; l++) {
        if( param_skill[l]>1.0 || param_skill[l]<0.0)
            return false;
        sum += param_skill[l];
    }
    if( sum/(skill1_n/2) != 1.0 )
        return false;
    return true;
}

// Assembly:
movq 0x68(%rdi), %rax
movsbl 0x900(%rax), %edx
movsbl 0x901(%rax), %eax
leal (%rdx,%rax), %ecx
incl %ecx
imull %edx, %ecx
testl %ecx, %ecx
jle 0xb1dc
xorpd %xmm1, %xmm1
xorl %edx, %edx
movsd 0x779e(%rip), %xmm2     # 0x12950
xorpd %xmm0, %xmm0
movsbq %dl, %rax
movsd (%rsi,%rax,8), %xmm3
xorl %eax, %eax
ucomisd %xmm2, %xmm3
ja 0xb207
ucomisd %xmm3, %xmm1
ja 0xb207
addsd %xmm3, %xmm0
incb %dl
movsbl %dl, %eax
cmpl %eax, %ecx
jg 0xb1b6
jmp 0xb1e0
xorpd %xmm0, %xmm0
movzwl %cx, %eax
shrl $0xf, %eax
addl %ecx, %eax
cwtl
sarl %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
cmpeqsd 0x7751(%rip), %xmm0     # 0x12950
movq %xmm0, %rax
andl $0x1, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemSt.cpp
// Function: HMMProblemSt::readModel(char const*, bool)
void HMMProblemSt::readModel(const char *filename, bool overwrite) {
	FILE *fid = fopen(filename,"r");
	if(fid == NULL)
	{
		fprintf(stderr,"Can't read model file %s\n",filename);
		exit(1);
	}
	int max_line_length = 1024;
	char *line = Malloc(char,(size_t)max_line_length);
	NDAT line_no = 0;
    struct task inittask;
    set_task_defaults(&inittask);
    
    //
    // read solver info
    //
    if(overwrite)
        readSolverInfo(fid, this->task, &line_no);
    else
        readSolverInfo(fid, &inittask, &line_no);
    //
    // read model
    //
    readModelBody(fid, &inittask, &line_no, overwrite);
		
	fclose(fid);
	free(line);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x998, %rsp            # imm = 0x998
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x6e14(%rip), %rsi      # 0x12038
movq %r15, %rdi
callq 0x2230
testq %rax, %rax
je 0xb293
movq %rax, %rbx
movl $0x0, 0x4(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x6fa9
testb %bpl, %bpl
je 0xb251
movq 0x68(%r14), %rsi
jmp 0xb256
leaq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0x74e6
movq (%r14), %rax
movzbl %bpl, %r8d
leaq 0x8(%rsp), %rdx
leaq 0x4(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq *0x60(%rax)
movq %rbx, %rdi
callq 0x21b0
addq $0x998, %rsp            # imm = 0x998
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x29f6
nop
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemSt.cpp
// Function: HMMProblemSt::getA(int)
NUMBER* HMMProblemSt::getA(NCAT x) {
    NPAR nS = this->task->nS;
    NCAT nK = this->task->nK;
	if( x > (nK-1) ) {
        fprintf(stderr,"While accessing PI, skill index %d exceeded the last skill index %d.\n", x, nK-1);
		exit(1);
	}
	return &this->param_skill[this->skill1_n*x + nS];
}

// Assembly:
movq 0x68(%rdi), %rcx
movl 0x908(%rcx), %eax
cmpl %esi, %eax
jle 0xb4b1
movsbq 0x900(%rcx), %rcx
movslq 0x38(%rdi), %rdx
movslq %esi, %rax
imulq %rdx, %rax
addq %rcx, %rax
shlq $0x3, %rax
addq 0x28(%rdi), %rax
retq
pushq %rax
movl %eax, %edi
callq 0x2a41
nop
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemSt.cpp
// Function: HMMProblemSt::getB(int)
NUMBER* HMMProblemSt::getB(NCAT x) {
    NPAR nS = this->task->nS;
    NCAT nK = this->task->nK;
	if( x > (nK-1) ) {
        fprintf(stderr,"While accessing PI, skill index %d exceeded the last skill index %d.\n", x, nK-1);
		exit(1);
	}
	return &this->param_skill[ this->skill1_n*x + nS*(nS+1) ];
}

// Assembly:
movq 0x68(%rdi), %rcx
movl 0x908(%rcx), %eax
cmpl %esi, %eax
jle 0xb4e7
movsbl 0x900(%rcx), %eax
imull 0x38(%rdi), %esi
leal 0x1(%rax), %ecx
imull %eax, %ecx
addl %esi, %ecx
movslq %ecx, %rax
shlq $0x3, %rax
addq 0x28(%rdi), %rax
retq
pushq %rax
movl %eax, %edi
callq 0x2a68
nop
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemSt.cpp
// Function: HMMProblemSt::getPI(int, signed char)
NUMBER HMMProblemSt::getPI(NCAT x, NPAR i) {
//    if(task->structure != STRUCTURE_SKILL) {
//        fprintf(stderr,"Model structure specified is not supported and should have been caught earlier\n");
//        exit(1);
//    }
    NCAT nK = this->task->nK;
    if( x > (this->task->nK-1) ) {
        fprintf(stderr,"While accessing PI, skill index %d exceeded the last skill index %d.\n", x, nK-1);
        exit(1);
    }
    // checks done
    return this->param_skill[this->skill1_n*x + i];
}

// Assembly:
movq 0x68(%rdi), %rax
movl 0x908(%rax), %eax
cmpl %esi, %eax
jle 0xb514
movq 0x28(%rdi), %rax
imull 0x38(%rdi), %esi
movsbl %dl, %ecx
addl %esi, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
retq
pushq %rax
movl %eax, %edi
callq 0x2a8f
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemSt.cpp
// Function: HMMProblemSt::getA(int, signed char, signed char)
NUMBER HMMProblemSt::getA(NCAT x, NPAR i, NPAR j) {
//    if(task->structure != STRUCTURE_SKILL) {
//        fprintf(stderr,"Model structure specified is not supported and should have been caught earlier\n");
//        exit(1);
//    }
    NPAR nS = this->task->nS;
    NCAT nK = this->task->nK;
    if( x > (nK-1) ) {
        fprintf(stderr,"While accessing PI, skill index %d exceeded the last skill index %d.\n", x, nK-1);
        exit(1);
    }
    // checks done
    return this->param_skill[this->skill1_n*x + nS + i*nS + j];
}

// Assembly:
movq 0x68(%rdi), %r8
movl 0x908(%r8), %eax
cmpl %esi, %eax
jle 0xb554
movsbl 0x900(%r8), %eax
movq 0x28(%rdi), %r8
imull 0x38(%rdi), %esi
movsbl %dl, %edx
imull %eax, %edx
movsbl %cl, %ecx
addl %eax, %ecx
addl %esi, %ecx
addl %edx, %ecx
movslq %ecx, %rax
movsd (%r8,%rax,8), %xmm0
retq
pushq %rax
movl %eax, %edi
callq 0x2ab6
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemSt.cpp
// Function: HMMProblemSt::getB(int, signed char, signed char)
NUMBER HMMProblemSt::getB(NCAT x, NPAR i, NPAR m) {
//    if(task->structure != STRUCTURE_SKILL) {
//        fprintf(stderr,"Model structure specified is not supported and should have been caught earlier\n");
//        exit(1);
//    }
    NPAR nS = this->task->nS;
    NPAR nO = this->task->nO;
    NCAT nK = this->task->nK;
    if( x > (nK-1) ) {
        fprintf(stderr,"While accessing PI, skill index %d exceeded the last skill index %d.\n", x, nK-1);
        exit(1);
    }
    if(m<0)
        return 1;
    // checks done
    return this->param_skill[this->skill1_n*x + nS * (1 + nS )+ i*nO + m];
}

// Assembly:
movq 0x68(%rdi), %r8
movl 0x908(%r8), %eax
cmpl %esi, %eax
jle 0xb5af
testb %cl, %cl
js 0xb5a6
movsbl 0x900(%r8), %eax
movsbl 0x901(%r8), %r8d
movzbl %cl, %ecx
movq 0x28(%rdi), %r9
imull 0x38(%rdi), %esi
leal 0x1(%rax), %edi
imull %eax, %edi
movsbl %dl, %eax
imull %r8d, %eax
addl %ecx, %eax
addl %edi, %eax
addl %esi, %eax
cltq
movsd (%r9,%rax,8), %xmm0
retq
movsd 0x73a2(%rip), %xmm0     # 0x12950
retq
pushq %rax
movl %eax, %edi
callq 0x2add
nop
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemSt.cpp
// Function: HMMProblemSt::getB(context*, signed char, signed char)
NUMBER HMMProblemSt::getB (struct context* ctx, NPAR i, NPAR m) {
//    if(task->structure != STRUCTURE_SKILL) {
//        fprintf(stderr,"Model structure specified is not supported and should have been caught earlier\n");
//        exit(1);
//    }
    // checks done
    NPAR nS = this->task->nS;
    NPAR nO = this->task->nO;
    // special attention for "unknonw" observations, i.e. the observation was there but we do not know what it is
    // in this case we simply return 1, effectively resulting in no change in \alpha or \beta vatiables
    if(m<0)
        return 1;
    return this->param_skill[this->skill1_n*ctx->k + nS * (1 + nS )+ i*nO + m];
}

// Assembly:
testb %cl, %cl
js 0xb639
movzbl %cl, %eax
movq 0x28(%rdi), %rcx
movq 0x68(%rdi), %r8
movsbl 0x901(%r8), %r9d
movsbl 0x900(%r8), %r8d
movl (%rsi), %esi
imull 0x38(%rdi), %esi
leal 0x1(%r8), %edi
imull %r8d, %edi
movsbl %dl, %edx
imull %r9d, %edx
addl %eax, %edx
addl %edi, %edx
addl %esi, %edx
movslq %edx, %rax
movsd (%rcx,%rax,8), %xmm0
retq
movsd 0x730f(%rip), %xmm0     # 0x12950
retq
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemSt.cpp
// Function: HMMProblemSt::fit()
void HMMProblemSt::fit() {
    FitNullSkill(/*loglik_rmse, false do RMSE*/);
    switch(this->task->solver)
    {
        case METHOD_BW: // Baum Welch Method
        case METHOD_GD: // Gradient Descent
        case METHOD_CGD: // Conjugate Gradient Descent
        case METHOD_GDL: // Gradient Descent, Lagrange
        case METHOD_GBB: // Brzilai Borwein Gradient Method
            Cycle();
            break;
        default:
            fprintf(stderr,"Solver specified is not supported.\n");
            break;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0xe3fe
movq 0x68(%rbx), %rax
movb 0x4f(%rax), %al
decb %al
cmpb $0x4, %al
ja 0xe3f7
movq (%rbx), %rax
movq %rbx, %rdi
popq %rbx
jmpq *0x90(%rax)
callq 0x2bdb
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemSt.cpp
// Function: HMMProblemSt::FitNullSkill()
void HMMProblemSt::FitNullSkill() {
    if(this->task->N_null==0) {
        this->null_obs_ratios[0] = 1; // set first obs to 1, simplex preserved
        return; // 0 loglik
    }
    NDAT t;
    NPAR o, m;
    // count distribution of onservations
    for(t=this->task->first_null_skill; t<=this->task->last_null_skill; t++) {
        o = this->task->dat_obs[ t ];
        this->null_obs_ratios[ o ]++;
    }
    // produce per-observation means
    this->null_skill_obs = 0;
    this->null_skill_obs_prob = 0;
    for(m=0;m<this->task->nO;m++) {
        this->null_obs_ratios[ m ] /= this->task->N_null;
        if( this->null_obs_ratios[m] > this->null_skill_obs_prob ) {
            this->null_skill_obs_prob = this->null_obs_ratios[m];
            this->null_skill_obs = m;
        }
    }
    this->null_skill_obs_prob = safe01num(this->null_skill_obs_prob); // safety for logging
    // metrics don't need to be computed it's handled in computeAlpha... -- main negative log-ikelihood computation
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x68(%rdi), %rcx
movl 0x914(%rcx), %eax
testl %eax, %eax
je 0xe4be
movslq 0x918(%rcx), %rdx
movl 0x91c(%rcx), %esi
cmpl %esi, %edx
jg 0xe460
movl %edx, %r8d
movq 0x10(%rbx), %rdi
addq 0x880(%rcx), %rdx
subl %r8d, %esi
incl %esi
xorl %r8d, %r8d
movsd 0x450d(%rip), %xmm0     # 0x12950
movsbq (%rdx,%r8), %r9
movsd (%rdi,%r9,8), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rdi,%r9,8)
incq %r8
cmpl %r8d, %esi
jne 0xe443
xorpd %xmm0, %xmm0
movupd %xmm0, 0x18(%rbx)
movsbq 0x901(%rcx), %rcx
testq %rcx, %rcx
jle 0xe4d1
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movq 0x10(%rbx), %rax
xorl %edx, %edx
movsd (%rax,%rdx,8), %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, (%rax,%rdx,8)
movsd 0x20(%rbx), %xmm0
ucomisd %xmm0, %xmm2
jbe 0xe4b4
movsd %xmm2, 0x20(%rbx)
movsbl %dl, %esi
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
movsd %xmm0, 0x18(%rbx)
movapd %xmm2, %xmm0
incq %rdx
cmpq %rdx, %rcx
jne 0xe483
jmp 0xe4d5
movq 0x10(%rbx), %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, (%rax)
jmp 0xe4df
xorpd %xmm0, %xmm0
callq 0x6132
movsd %xmm0, 0x20(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemSt.cpp
// Function: HMMProblemSt::doLagrangeStep(FitBitSt*)
void HMMProblemSt::doLagrangeStep(FitBitSt *fb) {
    // goal: for PI, and every row of A, and B multiply by negative gradient and average over the sum
        
    NUMBER buf;
    //NCAT active = 0;
    for(NCAT l=0; l<fb->sclsmplx_n; l++) { // for all vectors (simplexes) that are supposed to sum to 1
        if(fb->sclsmplx_blocks[l]==0) continue; // if the simplex belongs to block that is not in active set, skip
        buf = 0;
        for(NCAT i=fb->sclsmplx_offsets[l]; i<(fb->sclsmplx_offsets[l]+fb->sclsmplx_sizes[l]); i++)
            //if( (this->active_set_param[i] + this->unblocked_param[i]) == 2 ) // in active set and unblocked
                buf -= fb->PARAM[i]*fb->GRAD[i];
        for(NCAT i=fb->sclsmplx_offsets[l]; i<(fb->sclsmplx_offsets[l]+fb->sclsmplx_sizes[l]); i++)
            //if( (this->active_set_param[i] + this->unblocked_param[i]) == 2 ) // in active set and unblocked
                fb->PARAM[i] = (buf>0)? (-fb->PARAM[i]*fb->GRAD[i])/buf : fb->PARAM[i];
    }
}

// Assembly:
movslq 0xc0(%rsi), %rax
testq %rax, %rax
jle 0xef4f
pushq %r14
pushq %rbx
movq 0xb0(%rsi), %rcx
xorl %edx, %edx
xorpd %xmm0, %xmm0
movapd 0x3af4(%rip), %xmm1     # 0x129a0
cmpl $0x0, (%rcx,%rdx,4)
je 0xef40
movq 0xa8(%rsi), %rdi
movsbl (%rdi,%rdx), %r9d
testl %r9d, %r9d
jle 0xef40
movq 0x98(%rsi), %r8
movslq (%r8,%rdx,4), %r8
movzbl %r9b, %r10d
addq %r8, %r10
movq 0x10(%rsi), %r11
movq 0x30(%rsi), %rbx
xorpd %xmm2, %xmm2
movq %r8, %r14
movsd (%r11,%r14,8), %xmm3
mulsd (%rbx,%r14,8), %xmm3
subsd %xmm3, %xmm2
incq %r14
cmpq %r10, %r14
jl 0xeee8
testb %r9b, %r9b
jle 0xef40
movq 0x10(%rsi), %r9
movq %r8, %r10
ucomisd %xmm0, %xmm2
movsd (%r9,%r10,8), %xmm3
jbe 0xef2a
xorpd %xmm1, %xmm3
movq 0x30(%rsi), %r11
mulsd (%r11,%r10,8), %xmm3
divsd %xmm2, %xmm3
movsd %xmm3, (%r9,%r10,8)
incq %r10
movsbq (%rdi,%rdx), %r11
addq %r8, %r11
cmpq %r11, %r10
jl 0xef0c
incq %rdx
cmpq %rax, %rdx
jne 0xeeac
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemSt.cpp
// Function: HMMProblemSt::readNullObsRatio(_IO_FILE*, task*, int*)
void HMMProblemSt::readNullObsRatio(FILE *fid, struct task* task, NDAT *line_no) {
	NPAR i;
	//
	// read null skill ratios
	//
    fscanf(fid, "Null skill ratios\t");
    this->null_obs_ratios =Calloc(NUMBER, (size_t)this->task->nO);
    this->null_skill_obs      = 0;
    this->null_skill_obs_prob = 0;
	for(i=0; i<task->nO; i++) {
        if( i==(task->nO-1) ) // end
            fscanf(fid,"%lf\n",&this->null_obs_ratios[i] );
        else
            fscanf(fid,"%lf\t",&this->null_obs_ratios[i] );
		
        if( this->null_obs_ratios[i] > this->null_skill_obs_prob ) {
            this->null_skill_obs_prob = this->null_obs_ratios[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 0x3395(%rip), %rsi      # 0x1334e
movq %r15, %rdi
xorl %eax, %eax
callq 0x23a0
movq 0x68(%r12), %rax
movsbq 0x901(%rax), %rdi
movl $0x8, %esi
callq 0x2110
movq %rax, %rdx
movq %rax, 0x10(%r12)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x18(%r12)
movb 0x901(%r14), %al
testb %al, %al
jle 0x10069
xorl %ebx, %ebx
xorl %r13d, %r13d
xorl %ebp, %ebp
movsbl %al, %eax
decl %eax
addq %rbx, %rdx
cmpl %eax, %r13d
leaq 0x3530(%rip), %rsi      # 0x13541
leaq 0x3524(%rip), %rax      # 0x1353c
cmoveq %rax, %rsi
movq %r15, %rdi
xorl %eax, %eax
callq 0x23a0
movq 0x10(%r12), %rdx
movsd (%rdx,%rbx), %xmm0
ucomisd 0x20(%r12), %xmm0
jbe 0x10052
movsd %xmm0, 0x20(%r12)
movsbl %r13b, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x18(%r12)
incq %rbp
movsbq 0x901(%r14), %rax
incl %r13d
addq $0x8, %rbx
cmpq %rax, %rbp
jl 0xffff
movq (%rsp), %rax
incl (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemSt.cpp
// Function: HMMProblemSt::toFileAlphaBetaObs(char const*, int)
void HMMProblemSt::toFileAlphaBetaObs(const char *filename, NCAT k) {
    NDAT t, tt=0;
    NPAR nS = this->task->nS;
    FILE *fid = fopen(filename,"w");
    
    if(fid == NULL) {
        fprintf(stderr,"Can't write output model file %s\n",filename);
        exit(1);
    }
    
    // first time skill k starts
    while(this->task->dat_skill_stacked[tt]!=k) {
        tt++;
    }
    
    do {
        t = tt;
        for(NPAR i=0; i<nS; i++) fprintf(fid,"%20.17f\t",this->alpha[tt][i]);
        for(NPAR i=0; i<nS; i++) fprintf(fid,"%20.17f\t",this->beta[tt][i]);
        fprintf(fid,"%i\n",this->task->dat_obs_stacked[tt]);
        tt = this->forward_ix[tt];
    }
    while(this->forward_ix[t]!=-1);
    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 0x68(%rdi), %rax
movzbl 0x900(%rax), %r13d
leaq 0x2be8(%rip), %rsi      # 0x1332a
movq %r15, %rdi
callq 0x2230
testq %rax, %rax
je 0x1082c
movq %rax, %r14
movq 0x68(%rbx), %rax
movq 0x8a0(%rax), %rax
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
incl %edx
leaq 0x4(%rax), %rcx
cmpl %ebp, (%rax)
movq %rcx, %rax
jne 0x10766
leaq 0x2de6(%rip), %r15      # 0x13560
testb %r13b, %r13b
jle 0x107e0
movl %edx, 0x4(%rsp)
movslq %edx, %rbp
xorl %r12d, %r12d
movq 0x70(%rbx), %rax
movq (%rax,%rbp,8), %rax
movsd (%rax,%r12,8), %xmm0
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x22b0
incq %r12
cmpq %r12, %r13
jne 0x10789
testb %r13b, %r13b
movl 0x4(%rsp), %edx
jle 0x107e0
xorl %r12d, %r12d
movq 0x90(%rbx), %rax
movq (%rax,%rbp,8), %rax
movsd (%rax,%r12,8), %xmm0
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x22b0
incq %r12
cmpq %r12, %r13
jne 0x107b8
jmp 0x107e3
movslq %edx, %rbp
movq 0x68(%rbx), %rax
movq 0x888(%rax), %rax
movsbl (%rax,%rbp), %edx
movq %r14, %rdi
leaq 0x23de(%rip), %rsi      # 0x12bda
xorl %eax, %eax
callq 0x22b0
movq 0xb8(%rbx), %rax
movl (%rax,%rbp,4), %edx
cmpl $-0x1, %edx
jne 0x1077a
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21b0
movq %r15, %rdi
callq 0x2c1c
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/./utilsSt.h
// Function: double** init2D<double>(int, int)
T** init2D(NDAT size1, NDAT size2) {
    T** ar = (T **)Calloc(T *, (size_t)size1);
    for(NDAT i=0; i<size1; i++)
        ar[i] = (T *)Calloc(T, (size_t)size2);
    return ar;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r14d
movl %edi, %ebp
movslq %edi, %r15
movl $0x8, %esi
movq %r15, %rdi
callq 0x2110
movq %rax, %rbx
testl %r15d, %r15d
jle 0x1087b
movslq %r14d, %r14
movl %ebp, %r15d
xorl %r12d, %r12d
movl $0x8, %esi
movq %r14, %rdi
callq 0x2110
movq %rax, (%rbx,%r12,8)
incq %r12
cmpq %r12, %r15
jne 0x10862
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/./utilsSt.h
// Function: double*** init3D<double>(int, int, int)
T*** init3D(NDAT size1, NDAT size2, NDAT size3) {
    NDAT i,j;
    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);
    }
    return ar;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movl %esi, %r14d
movl %edi, %r12d
movslq %edi, %r15
movl $0x8, %esi
movq %r15, %rdi
callq 0x2110
movq %rax, 0x8(%rsp)
testl %r15d, %r15d
jle 0x1090e
movslq %r14d, %r14
movslq %ebp, %r15
movl %r12d, %eax
movq %rax, 0x10(%rsp)
movl %r14d, %ebp
xorl %ebx, %ebx
movl $0x8, %esi
movq %r14, %rdi
callq 0x2110
movq %rax, %r12
movq 0x8(%rsp), %rax
movq %r12, (%rax,%rbx,8)
testl %r14d, %r14d
jle 0x10904
xorl %r13d, %r13d
movl $0x8, %esi
movq %r15, %rdi
callq 0x2110
movq %rax, (%r12,%r13,8)
incq %r13
cmpq %r13, %rbp
jne 0x108eb
incq %rbx
cmpq 0x10(%rsp), %rbx
jne 0x108ca
movq 0x8(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemEloSt.cpp
// Function: HMMProblemEloSt::HMMProblemEloSt()
HMMProblemEloSt::HMMProblemEloSt() {
    if(task->structure != STRUCTURE_ELO) {
        fprintf(stderr,"Model structure specified is not supported and should have been caught earlier\n");
        exit(1);
    }
    this->param_elo = NULL;
    this->gradient_elo = NULL;
    this->param_elo_n = 0;
    this->elo_track_g = NULL;
    this->elo_count_g = NULL;
    this->elo_track_t = NULL;

}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0xac58
leaq 0x71a0(%rip), %rax      # 0x17cd0
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0xd0(%rbx)
movq 0x68(%rbx), %rax
cmpb $0xe, 0x4e(%rax)
jne 0x10b69
movups %xmm0, 0xe0(%rbx)
movb $0x0, 0xf0(%rbx)
movups %xmm0, 0xf8(%rbx)
movq $0x0, 0x108(%rbx)
popq %rbx
retq
callq 0x2c40
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemEloSt.cpp
// Function: HMMProblemEloSt::HMMProblemEloSt(task*)
HMMProblemEloSt::HMMProblemEloSt(struct task *task) {
//    printf("HMMProblemEloSt::HMMProblemEloSt\n");
    if(task->structure != STRUCTURE_ELO) {
        fprintf(stderr,"Model structure specified is not supported and should have been caught earlier\n");
        exit(1);
    }
    // check done
    this->model_param_n = task->nK * 4;
    // init
    init(task);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0xac58
leaq 0x714c(%rip), %rax      # 0x17cd0
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0xd0(%rbx)
cmpb $0xe, 0x4e(%r14)
jne 0x10bb8
movl 0x908(%r14), %eax
shll $0x2, %eax
movl %eax, 0x8(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x10bd0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x2c65
movq %rax, %r14
movq %rbx, %rdi
callq 0xb29c
movq %r14, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemEloSt.cpp
// Function: HMMProblemEloSt::init(task*)
void HMMProblemEloSt::init(struct task *task) {
//    printf("HMMProblemEloSt::init\n");
    // parent init
    HMMProblemSt::init(task);
    // local init
    // init elo parameters, trackers (values and counts)
    NCAT nG = task->nG;
    this->param_elo_n = task->elo_param_values_n;
    this->param_elo = init1D<NUMBER>(this->param_elo_n);
    for(NPAR i=0; i<this->param_elo_n; i++) {
        this->param_elo[i] = task->elo_param_values[i];
    }
    this->gradient_elo = initToValue1D<NUMBER>(this->param_elo_n, 0);
    this->elo_count_g = initToValue1D<NCAT>((NDAT)nG, 0);
    this->elo_track_g = initToValue1D<NUMBER>((NDAT)nG, 0); // init on logit scale
    this->elo_track_t = initToValue1D<NUMBER>((NDAT)task->N, 0); // init on logit scale
    // init elo sensitivity function
//    NUMBER (HMMProblemEloSt::*sensitivity)(NDAT) = &HMMProblemEloSt::sensitivity_K;
    switch(this->task->elo_type)
    {
        case ELO_DIRECT_K: {
            this->sensitivity = &HMMProblemEloSt::sensitivity_K;
            break;
        }
        case ELO_UNS_REL_1_B: {
            this->sensitivity = &HMMProblemEloSt::sensitivity_U1b;
            break;
        }
        case ELO_UNS_REL_1_EXPB_0_01: {
            this->sensitivity = &HMMProblemEloSt::sensitivity_U1bexp0_01;
            break;
        }
        case ELO_O2Z_IN_B: {
            this->sensitivity = &HMMProblemEloSt::sensitivity_O2Z_IN_B;
            break;
        }
        default:
            fprintf(stderr,"Elo type specified (%d) is not supported.\n",this->task->elo_type);
            exit(1);
            break;
    }

    // init elo gradient function
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0xac80
movslq 0x904(%r14), %r15
movsbq 0x30(%r14), %r12
movb %r12b, 0xf0(%rbx)
movl $0x8, %esi
movq %r12, %rdi
callq 0x2110
movq %rax, 0xe0(%rbx)
testq %r12, %r12
jle 0x10c27
movq 0x28(%r14), %rcx
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, (%rax,%rdx,8)
incq %rdx
cmpq %rdx, %r12
jne 0x10c15
movl $0x8, %esi
movq %r12, %rdi
callq 0x2110
movq %rax, 0xe8(%rbx)
movl $0x4, %esi
movq %r15, %rdi
callq 0x2110
movq %rax, 0x100(%rbx)
movl $0x8, %esi
movq %r15, %rdi
callq 0x2110
movq %rax, 0xf8(%rbx)
movslq 0x8f8(%r14), %rdi
movl $0x8, %esi
callq 0x2110
movq %rax, 0x108(%rbx)
movq 0x68(%rbx), %rax
movzbl 0x20(%rax), %eax
leal -0x1(%rax), %ecx
cmpl $0x3, %ecx
ja 0x10cdb
leaq 0x28da(%rip), %rax      # 0x1356c
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x42(%rip), %rax        # 0x10ce4
jmp 0x10cbd
leaq 0x8f(%rip), %rax        # 0x10d3a
jmp 0x10cbd
leaq 0x100(%rip), %rax       # 0x10db4
jmp 0x10cbd
leaq 0x33(%rip), %rax        # 0x10cf0
movq %rax, 0xd0(%rbx)
movq $0x0, 0xd8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movzbl %al, %edi
callq 0x2c8a
nop
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemEloSt.cpp
// Function: HMMProblemEloSt::sensitivity_U1b(context*)
NUMBER HMMProblemEloSt::sensitivity_U1b(struct context *ctx) {
    // handle negative b by transferring it to the whole resulting K
    NUMBER sig = (this->param_elo[0]>=0)?1.0:-1.0;
    NDAT n = this->elo_count_g[ctx->g];
    return sig*1/(1+sig*this->param_elo[0]*n);
}

// Assembly:
movq 0xe0(%rdi), %rax
movq 0x100(%rdi), %rcx
movsd (%rax), %xmm1
xorpd %xmm0, %xmm0
xorl %eax, %eax
ucomisd %xmm0, %xmm1
setae %al
leaq 0x287a(%rip), %rdx      # 0x13590
movsd (%rdx,%rax,8), %xmm0
movslq 0x4(%rsi), %rax
mulsd %xmm0, %xmm1
cvtsi2sdl (%rcx,%rax,4), %xmm2
mulsd %xmm1, %xmm2
addsd 0x1c1c(%rip), %xmm2     # 0x12950
divsd %xmm2, %xmm0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemEloSt.cpp
// Function: HMMProblemEloSt::sensitivity_U1bexp0_01(context*)
NUMBER HMMProblemEloSt::sensitivity_U1bexp0_01(struct context *ctx) {
    // handle negative b by transferring it to the whole resulting K
    NUMBER sig = (this->param_elo[0]>=0)?1.0:-1.0;
    NDAT n = this->elo_count_g[ctx->g];
    return sig*1/(1+sig*this->param_elo[0]*exp(0.01*n));
}

// Assembly:
subq $0x18, %rsp
movq 0xe0(%rdi), %rax
movq 0x100(%rdi), %rcx
movsd (%rax), %xmm1
xorpd %xmm0, %xmm0
xorl %eax, %eax
ucomisd %xmm0, %xmm1
setae %al
leaq 0x282c(%rip), %rdx      # 0x13590
movsd (%rdx,%rax,8), %xmm0
movsd %xmm0, 0x10(%rsp)
movslq 0x4(%rsi), %rax
mulsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl (%rcx,%rax,4), %xmm0
mulsd 0x2813(%rip), %xmm0     # 0x135a0
callq 0x2380
mulsd 0x8(%rsp), %xmm0
addsd 0x1bb0(%rip), %xmm0     # 0x12950
movsd 0x10(%rsp), %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
addq $0x18, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemEloSt.cpp
// Function: HMMProblemEloSt::sensitivity_O2Z_IN_B(context*)
NUMBER HMMProblemEloSt::sensitivity_O2Z_IN_B(struct context *ctx) {
    // handle negative b by transferring it to the whole resulting K
    NUMBER sig = (this->param_elo[0]>=0)?1.0:-1.0;
    NDAT n = this->elo_count_g[ctx->g];
    return sig*MAX(1-n/this->param_elo[0],0);
}

// Assembly:
movq 0xe0(%rdi), %rax
movq 0x100(%rdi), %rcx
movsd (%rax), %xmm1
movslq 0x4(%rsi), %rax
cvtsi2sdl (%rcx,%rax,4), %xmm0
divsd %xmm1, %xmm0
movsd 0x1b75(%rip), %xmm2     # 0x12950
subsd %xmm0, %xmm2
xorpd %xmm0, %xmm0
maxsd %xmm0, %xmm2
movapd 0x1bb1(%rip), %xmm3     # 0x129a0
xorpd %xmm2, %xmm3
cmplesd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemEloSt.cpp
// Function: HMMProblemEloSt::getPI(context*, signed char)
NUMBER HMMProblemEloSt::getPI(struct context* ctx, NPAR i) {
//    if(this->task->structure != STRUCTURE_ELO)
//    {
//        fprintf(stderr,"Solver specified is not supported.\n");
//        exit(1);
//    }
    // BKT part
    NUMBER ret = this->param_skill[this->skill1_n*ctx->k + i];
    // Elo part
    if( (this->task->elo_scope & BKT_PARAMETER_SCOPE_PI)>0 ) {
//        if( ctx->g > -1) {
        NUMBER sig = ((i==0)?1.0:(-1.0));
        ret = sigmoid( sig * this->elo_track_g[ctx->g] + logit(ret));
//        }
    }
    return(ret);
}

// Assembly:
movl (%rsi), %eax
imull 0x38(%rdi), %eax
addl %edx, %eax
cltq
movq 0x28(%rdi), %rcx
movq 0x68(%rdi), %r8
movsd (%rcx,%rax,8), %xmm0
testb $0x1, 0x24(%r8)
jne 0x10e57
retq
pushq %rax
xorl %eax, %eax
testb %dl, %dl
sete %al
leaq 0x272a(%rip), %rcx      # 0x13590
movsd (%rcx,%rax,8), %xmm1
movq 0xf8(%rdi), %rax
movslq 0x4(%rsi), %rcx
mulsd (%rax,%rcx,8), %xmm1
movsd %xmm1, (%rsp)
callq 0x61e3
addsd (%rsp), %xmm0
popq %rax
jmp 0x61bf
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemEloSt.cpp
// Function: HMMProblemEloSt::getA(context*, signed char, signed char)
NUMBER HMMProblemEloSt::getA (struct context* ctx, NPAR i, NPAR j) {
//    if(this->task->structure != STRUCTURE_ELO)
//    {
//        fprintf(stderr,"Solver specified is not supported.\n");
//        exit(1);
//    }
    NPAR nS = this->task->nS;
    // BKT part
    NUMBER ret = this->param_skill[this->skill1_n*ctx->k + nS + i*nS + j];
    // Elo part
    if( (this->task->elo_scope & BKT_PARAMETER_SCOPE_A)>0 ) {
//        if( ctx->g > -1) {
        NUMBER sig = ((j==0)?1.0:(-1.0));
        ret = sigmoid( sig * this->elo_track_g[ctx->g] + logit(ret));
//        }
    }
    return(ret);
}

// Assembly:
movq 0x28(%rdi), %rax
movq 0x68(%rdi), %r8
movsbl 0x900(%r8), %r9d
movl (%rsi), %r10d
imull 0x38(%rdi), %r10d
imull %r9d, %edx
addl %ecx, %r9d
addl %r10d, %r9d
addl %edx, %r9d
movslq %r9d, %rdx
movsd (%rax,%rdx,8), %xmm0
testb $0x2, 0x24(%r8)
jne 0x10ec5
retq
pushq %rax
xorl %eax, %eax
testb %cl, %cl
sete %al
leaq 0x26bc(%rip), %rcx      # 0x13590
movsd (%rcx,%rax,8), %xmm1
movq 0xf8(%rdi), %rax
movslq 0x4(%rsi), %rcx
mulsd (%rax,%rcx,8), %xmm1
movsd %xmm1, (%rsp)
callq 0x61e3
addsd (%rsp), %xmm0
popq %rax
jmp 0x61bf
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemEloSt.cpp
// Function: HMMProblemEloSt::getB(context*, signed char, signed char)
NUMBER HMMProblemEloSt::getB (struct context* ctx, NPAR i, NPAR m) {
//    if(this->task->structure != STRUCTURE_ELO)
//    {
//        fprintf(stderr,"Solver specified is not supported.\n");
//        exit(1);
//    }
    NPAR nS = this->task->nS;
    NPAR nO = this->task->nO;
    // special attention for "unknonw" observations, i.e. the observation was there but we do not know what it is
    // in this case we simply return 1, effectively resulting in no change in \alpha or \beta vatiables
    if(m<0)
        return 1;
    NUMBER ret = this->param_skill[this->skill1_n*ctx->k + nS * (1 + nS )+ i*nO + m];
    if( (this->task->elo_scope & BKT_PARAMETER_SCOPE_B)>0 ) {
//        if( ctx->g > -1) {
        NUMBER sig = ((m==0)?1.0:(-1.0));
        ret = sigmoid( sig * this->elo_track_g[ctx->g] + logit(ret));
//        }
    }
    return(ret);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testb %cl, %cl
js 0x10f8d
movzbl %cl, %eax
movq 0x28(%rdi), %r8
movq 0x68(%rdi), %r9
movsbl 0x901(%r9), %r10d
movl (%rsi), %r11d
imull 0x38(%rdi), %r11d
movsbl 0x900(%r9), %ebx
leal 0x1(%rbx), %ebp
imull %ebx, %ebp
movsbl %dl, %edx
imull %r10d, %edx
addl %eax, %edx
addl %ebp, %edx
addl %r11d, %edx
movslq %edx, %rax
movsd (%r8,%rax,8), %xmm0
testb $0x4, 0x24(%r9)
je 0x10f95
xorl %eax, %eax
testb %cl, %cl
sete %al
leaq 0x2632(%rip), %rcx      # 0x13590
movsd (%rcx,%rax,8), %xmm1
movq 0xf8(%rdi), %rax
movslq 0x4(%rsi), %rcx
mulsd (%rax,%rcx,8), %xmm1
movsd %xmm1, (%rsp)
callq 0x61e3
addsd (%rsp), %xmm0
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x61bf
movsd 0x19bb(%rip), %xmm0     # 0x12950
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemEloSt.cpp
// Function: HMMProblemEloSt::initAlphaEtAl()
void HMMProblemEloSt::initAlphaEtAl() {
    // call the parent initAlphaEtAl
    HMMProblemSt::initAlphaEtAl();
    // init Elo-related stuff
    toZero1D<NCAT>(this->elo_count_g, (NDAT)this->task->nG);
    toZero1D<NUMBER>(this->elo_track_g, (NDAT)this->task->nG); // init on logit scale
    toZero1D<NUMBER>(this->elo_track_t, (NDAT)this->task->N); // init on logit scale
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xb642
movq 0x68(%rbx), %r14
movslq 0x904(%r14), %rdx
testq %rdx, %rdx
jle 0x10fe8
movq 0x100(%rbx), %rdi
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x2100
movslq 0x904(%r14), %rdx
testq %rdx, %rdx
jle 0x10fe8
movq 0xf8(%rbx), %rdi
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x2100
movslq 0x8f8(%r14), %rdx
testq %rdx, %rdx
jle 0x1100d
movq 0x108(%rbx), %rdi
shlq $0x3, %rdx
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2100
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemEloSt.cpp
// Function: HMMProblemEloSt::postPredictionSave(char const*)
void HMMProblemEloSt::postPredictionSave(const char *filename) {
    // reuse prediction file name to generat new file
    if(this->task->predictions==2) { // if we are saving the skill p-known
        // set file name
        char *fn_suffix = "__ratings.txt";
        char *fn_new = (char *) malloc(1 + strlen(filename)+ strlen(fn_suffix) );
        strcpy(fn_new, filename);
        strcat(fn_new, fn_suffix);
        // open file
        FILE *fid = fopen(fn_new,"w");
        if(fid == NULL)
        {
            fprintf(stderr,"Can't write post-prediction file %s\n",fn_new);
            exit(1);
        }
        for(NDAT t=0; t<this->task->N; t++) {
            fprintf(fid,"%12.10f\n", sigmoid(this->elo_track_t[t]) ); // write probability value, not logit
        }
        // close file
        fclose(fid);
    }
    return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x68(%rdi), %rax
cmpl $0x2, 0x70(%rax)
jne 0x11175
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x20e0
leaq 0xe(%rax), %rdi
callq 0x22a0
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x21a0
movq %r15, %rdi
callq 0x20e0
movabsq $0x676e697461725f5f, %rcx # imm = 0x676E697461725F5F
movq %rcx, (%r15,%rax)
movabsq $0x7478742e73676e, %rcx # imm = 0x7478742E73676E
movq %rcx, 0x6(%r15,%rax)
leaq 0x2221(%rip), %rsi      # 0x1332a
movq %r15, %rdi
callq 0x2230
testq %rax, %rax
je 0x11181
movq %rax, %r14
movq 0x68(%rbx), %rax
cmpl $0x0, 0x8f8(%rax)
jle 0x11162
xorl %r12d, %r12d
leaq 0x2526(%rip), %r15      # 0x13656
movq 0x108(%rbx), %rax
movsd (%rax,%r12,8), %xmm0
callq 0x61bf
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x22b0
incq %r12
movq 0x68(%rbx), %rax
movslq 0x8f8(%rax), %rax
cmpq %rax, %r12
jl 0x11130
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x21b0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r15, %rdi
callq 0x2caf