LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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 0x75da
movq %rdi, %r14
cmpq $0x0, 0xa8(%rdi)
je 0x75da
cmpq $0x0, 0x98(%r14)
je 0x75da
cmpq $0x0, 0xb0(%r14)
je 0x75da
movq %rdx, %rbx
xorl %r15d, %r15d
testb %sil, %sil
jne 0x75cc
movslq %eax, %rcx
cmpq %rcx, %r15
jge 0x75d4
movq 0xb0(%r14), %rcx
movslq (%rcx,%r15,4), %rcx
cmpb $0x0, (%rbx,%rcx)
je 0x7567
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 0x43e4
movl 0xc0(%r14), %eax
incq %r15
jmp 0x751f
movq 0xb0(%r14), %rcx
movslq (%rcx,%r15,4), %rcx
cmpb $0x0, (%rbx,%rcx)
jle 0x75c9
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 0x4b4c
movl 0xc0(%r14), %eax
incq %r15
movslq %eax, %rcx
cmpq %rcx, %r15
jl 0x756c
popq %rbx
popq %r14
popq %r15
retq
movq 0xe9f7(%rip), %rax      # 0x15fd8
movq (%rax), %rcx
leaq 0x9800(%rip), %rdi      # 0x10deb
pushq $0x3c
popq %rsi
pushq $0x1
popq %rdx
callq 0x3400
pushq $0x1
popq %rdi
callq 0x3240
// File: /workspace/github_cpp_makefile_star2_O2/myudelson[P]hmm-scalable/./utilsSt.h
// Function: double** initToValue2D<double>(int, int, double)
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
pushq %rax
movsd %xmm0, (%rsp)
movl %esi, %ebp
movslq %edi, %rbx
pushq $0x8
popq %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3100
movslq %ebp, %r15
xorl %r13d, %r13d
testl %r15d, %r15d
movl $0x0, %ebp
cmovgl %r15d, %ebp
movq %rax, %r12
testl %ebx, %ebx
cmovlel %r13d, %ebx
cmpq %rbx, %r13
je 0x9365
movq %r15, %rdi
movq %r14, %rsi
callq 0x3100
movsd (%rsp), %xmm0
movq %rax, (%r12,%r13,8)
xorl %ecx, %ecx
cmpq %rcx, %rbp
je 0x9360
movsd %xmm0, (%rax,%rcx,8)
incq %rcx
jmp 0x9351
incq %r13
jmp 0x9336
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x32a0
movq %rax, %rbx
pushq $0x1
popq %rsi
movq %rax, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x32f0
cmpl %r15d, %eax
jne 0x950f
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq 0xcac2(%rip), %rax      # 0x15fd8
movq (%rax), %rcx
leaq 0x7d05(%rip), %rdi      # 0x11225
pushq $0x1d
popq %rsi
pushq $0x1
popq %rdx
callq 0x3400
xorl %ebx, %ebx
jmp 0x9506
nop
// File: /workspace/github_cpp_makefile_star2_O2/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), %ecx
movsbl 0x901(%rax), %eax
addl %ecx, %eax
incl %eax
imull %ecx, %eax
xorpd %xmm1, %xmm1
xorl %edx, %edx
movsd 0x6853(%rip), %xmm2     # 0x10950
xorpd %xmm0, %xmm0
movsbl %dl, %ecx
cmpl %ecx, %eax
jle 0xa127
movsbq %dl, %rcx
movsd (%rsi,%rcx,8), %xmm3
xorl %ecx, %ecx
ucomisd %xmm2, %xmm3
ja 0xa14a
ucomisd %xmm3, %xmm1
ja 0xa14a
addsd %xmm3, %xmm0
incb %dl
jmp 0xa101
movw $0x2, %cx
cwtd
idivw %cx
cwtl
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
cmpeqsd 0x680e(%rip), %xmm0     # 0x10950
movq %xmm0, %rcx
andl $0x1, %ecx
movl %ecx, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x5ece(%rip), %rsi      # 0x10038
movq %r15, %rdi
callq 0x3220
testq %rax, %rax
je 0xa1d6
movq %rax, %rbx
andl $0x0, 0x4(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x6299
testb %bpl, %bpl
je 0xa194
movq 0x68(%r14), %rsi
jmp 0xa199
leaq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0x676f
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 0x31b0
addq $0x998, %rsp            # imm = 0x998
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0xbdfb(%rip), %rax      # 0x15fd8
movq (%rax), %rdi
leaq 0x5e53(%rip), %rsi      # 0x1003a
movq %r15, %rdx
xorl %eax, %eax
callq 0x32d0
pushq $0x1
popq %rdi
callq 0x3240
nop
// File: /workspace/github_cpp_makefile_star2_O2/myudelson[P]hmm-scalable/HMMProblemSt.cpp
// Function: HMMProblemSt::~HMMProblemSt()
HMMProblemSt::~HMMProblemSt() {
//    printf("HMMProblemSt::~HMMProblemSt\n");
    NDAT Nst = this->task->Nst;
//    printf("before null_obs_ratios\n");
    if(this->null_obs_ratios != NULL) free(this->null_obs_ratios);
//    printf("before param_skill\n");
    if(this->param_skill != NULL) free(this->param_skill);
//    printf("before gradient_skill\n");
    if(this->gradient_skill != NULL) free(this->gradient_skill);
//    printf("before lb_param_skill\n");
    if(this->lb_param_skill != NULL) free(this->lb_param_skill);
//    printf("before ub_param_skill\n");
    if(this->ub_param_skill != NULL) free(this->ub_param_skill);
//    printf("before alpha %d\n",this->alpha != NULL);
    if(this->alpha != NULL) free2D(this->alpha, Nst);
//    printf("before po_param_gk\n");
    if(this->po_param_gk != NULL) free2D(this->po_param_gk, this->task->nG);
//    printf("before loglik_k\n");
    if(this->loglik_k != NULL) free(this->loglik_k);
//    printf("before ndat_k\n");
    if(this->ndat_k != NULL) free(this->ndat_k);
//    printf("before beta\n");
    if(this->beta != NULL) free2D(this->beta, Nst);
//    printf("before scale\n");
    if(this->scale != NULL) free(this->scale);
//    printf("before gamma\n");
    if(this->gamma != NULL) free2D(this->gamma, Nst);
//    printf("before xi\n");
    if(this->xi != NULL) free3D(this->xi, Nst, this->task->nS);
//    printf("before backward_ix\n");
    if(this->backward_ix != NULL) free(this->backward_ix);
//    printf("before forward_ix\n");
    if(this->forward_ix != NULL) free(this->forward_ix);
    
    free3D(this->group_skill_map, this->task->nG, this->task->nK); //UNBOOST
    
//    printf("before active_set_block\n");
    free(this->active_set_block);
//    printf("before unblocked_simplex\n");
    free(this->unblocked_simplex);
    
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xb9e1(%rip), %rax      # 0x15be8
movq %rax, (%rdi)
movq 0x10(%rdi), %rdi
movq 0x68(%rbx), %rax
movl 0x8fc(%rax), %ebp
callq 0x3230
movq 0x28(%rbx), %rdi
callq 0x3230
movq 0x30(%rbx), %rdi
callq 0x3230
movq 0x40(%rbx), %rdi
callq 0x3230
movq 0x48(%rbx), %rdi
callq 0x3230
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0xa251
movl %ebp, %esi
callq 0x6bc3
movq 0x78(%rbx), %rdi
testq %rdi, %rdi
je 0xa269
movq 0x68(%rbx), %rax
movl 0x904(%rax), %esi
callq 0x6bc3
movq 0x80(%rbx), %rdi
callq 0x3230
movq 0x88(%rbx), %rdi
callq 0x3230
movq 0x90(%rbx), %rdi
testq %rdi, %rdi
je 0xa294
movl %ebp, %esi
callq 0x6bc3
movq 0xa8(%rbx), %rdi
callq 0x3230
movq 0x98(%rbx), %rdi
testq %rdi, %rdi
je 0xa2b3
movl %ebp, %esi
callq 0x6bc3
movq 0xa0(%rbx), %rdi
testq %rdi, %rdi
je 0xa2d1
movq 0x68(%rbx), %rax
movsbl 0x900(%rax), %edx
movl %ebp, %esi
callq 0xed0c
movq 0xb0(%rbx), %rdi
callq 0x3230
movq 0xb8(%rbx), %rdi
callq 0x3230
movq 0x68(%rbx), %rax
movq 0xc8(%rbx), %rdi
movl 0x904(%rax), %esi
movl 0x908(%rax), %edx
callq 0xed0c
movq 0x58(%rbx), %rdi
callq 0x3230
movq 0x60(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3230
nop
// File: /workspace/github_cpp_makefile_star2_O2/myudelson[P]hmm-scalable/HMMProblemSt.cpp
// Function: HMMProblemSt::getPI(int)
NUMBER* HMMProblemSt::getPI(NCAT x) {
	if( x > (this->task->nK-1) ) {
		fprintf(stderr,"While accessing PI, skill index %d exceeded the last skill index %d.\n", x, this->task->nK-1);
		exit(1);
	}
	return &this->param_skill[this->skill1_n*x + 0];
}

// Assembly:
movl %esi, %edx
movq 0x68(%rdi), %rax
movl 0x908(%rax), %ecx
cmpl %esi, %ecx
jle 0xa3aa
movslq 0x38(%rdi), %rcx
movslq %edx, %rax
imulq %rcx, %rax
shlq $0x3, %rax
addq 0x28(%rdi), %rax
retq
pushq %rax
decl %ecx
movq 0xbc24(%rip), %rax      # 0x15fd8
movq (%rax), %rdi
leaq 0x6eda(%rip), %rsi      # 0x11298
xorl %eax, %eax
callq 0x32d0
pushq $0x1
popq %rdi
callq 0x3240
nop
// File: /workspace/github_cpp_makefile_star2_O2/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:
movl %esi, %edx
movq 0x68(%rdi), %rax
movl 0x908(%rax), %ecx
cmpl %esi, %ecx
jle 0xa3fd
movsbq 0x900(%rax), %rcx
movslq 0x38(%rdi), %rsi
movslq %edx, %rax
imulq %rsi, %rax
addq %rcx, %rax
shlq $0x3, %rax
addq 0x28(%rdi), %rax
retq
pushq %rax
decl %ecx
movq 0xbbd1(%rip), %rax      # 0x15fd8
movq (%rax), %rdi
leaq 0x6e87(%rip), %rsi      # 0x11298
xorl %eax, %eax
callq 0x32d0
pushq $0x1
popq %rdi
callq 0x3240
// File: /workspace/github_cpp_makefile_star2_O2/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:
movl %esi, %edx
movq 0x68(%rdi), %rax
movl 0x908(%rax), %ecx
cmpl %esi, %ecx
jle 0xa44f
movsbl 0x900(%rax), %eax
imull 0x38(%rdi), %edx
leal 0x1(%rax), %ecx
imull %eax, %ecx
addl %edx, %ecx
movslq %ecx, %rax
shlq $0x3, %rax
addq 0x28(%rdi), %rax
retq
pushq %rax
decl %ecx
movq 0xbb7f(%rip), %rax      # 0x15fd8
movq (%rax), %rdi
leaq 0x6e35(%rip), %rsi      # 0x11298
xorl %eax, %eax
callq 0x32d0
pushq $0x1
popq %rdi
callq 0x3240
// File: /workspace/github_cpp_makefile_star2_O2/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:
movl %esi, %eax
movq 0x68(%rdi), %rcx
movl 0x908(%rcx), %ecx
cmpl %esi, %ecx
jle 0xa498
movq 0x28(%rdi), %rcx
imull 0x38(%rdi), %eax
movsbl %dl, %edx
addl %eax, %edx
movslq %edx, %rax
movsd (%rcx,%rax,8), %xmm0
retq
pushq %rax
decl %ecx
movq 0xbb36(%rip), %rdx      # 0x15fd8
movq (%rdx), %rdi
leaq 0x6dec(%rip), %rsi      # 0x11298
movl %eax, %edx
xorl %eax, %eax
callq 0x32d0
pushq $0x1
popq %rdi
callq 0x3240
nop
// File: /workspace/github_cpp_makefile_star2_O2/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:
movl %esi, %r8d
movq 0x68(%rdi), %rsi
movl 0x908(%rsi), %eax
cmpl %r8d, %eax
jle 0xa4f9
movsbl 0x900(%rsi), %eax
movq 0x28(%rdi), %rsi
imull 0x38(%rdi), %r8d
movsbl %dl, %edx
imull %eax, %edx
movsbl %cl, %ecx
addl %eax, %ecx
addl %r8d, %ecx
addl %edx, %ecx
movslq %ecx, %rax
movsd (%rsi,%rax,8), %xmm0
retq
pushq %rax
decl %eax
movq 0xbad5(%rip), %rcx      # 0x15fd8
movq (%rcx), %rdi
leaq 0x6d8b(%rip), %rsi      # 0x11298
movl %r8d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x32d0
pushq $0x1
popq %rdi
callq 0x3240
nop
// File: /workspace/github_cpp_makefile_star2_O2/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:
movl %esi, %eax
movq 0x68(%rdi), %rsi
movl 0x908(%rsi), %r8d
cmpl %eax, %r8d
jle 0xa579
testb %cl, %cl
js 0xa570
movsbl 0x900(%rsi), %r8d
movsbl 0x901(%rsi), %esi
movzbl %cl, %ecx
movq 0x28(%rdi), %r9
imull 0x38(%rdi), %eax
leal 0x1(%r8), %edi
imull %r8d, %edi
movsbl %dl, %edx
imull %esi, %edx
addl %ecx, %edx
addl %edi, %edx
addl %eax, %edx
movslq %edx, %rax
movsd (%r9,%rax,8), %xmm0
retq
movsd 0x63d8(%rip), %xmm0     # 0x10950
retq
pushq %rax
decl %r8d
movq 0xba54(%rip), %rcx      # 0x15fd8
movq (%rcx), %rdi
leaq 0x6d0a(%rip), %rsi      # 0x11298
movl %eax, %edx
movl %r8d, %ecx
xorl %eax, %eax
callq 0x32d0
pushq $0x1
popq %rdi
callq 0x3240
// File: /workspace/github_cpp_makefile_star2_O2/myudelson[P]hmm-scalable/HMMProblemSt.cpp
// Function: HMMProblemSt::initAlphaEtAl()
void HMMProblemSt::initAlphaEtAl() {
    NPAR nS = this->task->nS;
    NCAT nK = this->task->nK, nG = this->task->nG;
    NDAT Nst = this->task->Nst;
    NPAR f_is_scaled = this->task->is_scaled==1;
    toZero2D(this->alpha, Nst, nS);
    // if scaled, new parameter values are multiplied, if not scaled – added
    if(f_is_scaled)
        toValue2D(this->po_param_gk, nG, nK, 1.0);
    else
        toZero2D(this->po_param_gk, nG, nK);
    toZero1D(this->loglik_k, nK);
    
    toValue3D(this->group_skill_map, (NDAT)nG, (NDAT)nK, (NDAT)nS, -1.0); // -1 means not set (use pLo)
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movq 0x68(%rdi), %rax
movq 0x70(%rdi), %rdi
movsbl 0x900(%rax), %ebx
movl 0x908(%rax), %ebp
movl 0x904(%rax), %r15d
movl 0x8fc(%rax), %esi
movb 0x41(%rax), %r12b
movl %ebx, %edx
callq 0xed66
movq 0x78(%r14), %rdi
cmpb $0x1, %r12b
jne 0xa682
movsd 0x62da(%rip), %xmm0     # 0x10950
movl %r15d, %esi
movl %ebp, %edx
callq 0xed92
jmp 0xa68c
movl %r15d, %esi
movl %ebp, %edx
callq 0xed66
movq 0x80(%r14), %rdi
movl %ebp, %esi
callq 0xedbf
movq 0xc8(%r14), %rdi
movsd 0x629f(%rip), %xmm0     # 0x10948
movl %r15d, %esi
movl %ebp, %edx
movl %ebx, %ecx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xedd6
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0xccac
movq 0x68(%rbx), %rax
movb 0x4f(%rax), %al
decb %al
cmpb $0x4, %al
ja 0xcc8f
movq (%rbx), %rax
movq %rbx, %rdi
popq %rbx
jmpq *0x90(%rax)
movq 0x9342(%rip), %rax      # 0x15fd8
movq (%rax), %rcx
leaq 0x47e4(%rip), %rdi      # 0x11484
pushq $0x23
popq %rsi
pushq $0x1
popq %rdx
popq %rbx
jmp 0x3400
// File: /workspace/github_cpp_makefile_star2_O2/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), %rax
movl 0x914(%rax), %ecx
testl %ecx, %ecx
je 0xcd65
movslq 0x918(%rax), %rdx
movslq 0x91c(%rax), %rsi
movq 0x10(%rbx), %rdi
movsd 0x3c74(%rip), %xmm0     # 0x10950
cmpq %rsi, %rdx
jg 0xcd02
movq 0x880(%rax), %r8
movsbq (%r8,%rdx), %r8
movsd (%rdi,%r8,8), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rdi,%r8,8)
incq %rdx
jmp 0xccdc
xorpd %xmm0, %xmm0
movupd %xmm0, 0x18(%rbx)
cvtsi2sd %ecx, %xmm1
movsbq 0x901(%rax), %rax
movq 0x10(%rbx), %rcx
xorpd %xmm0, %xmm0
xorl %edx, %edx
cmpq %rax, %rdx
jge 0xcd59
movsd (%rcx,%rdx,8), %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, (%rcx,%rdx,8)
movsd 0x20(%rbx), %xmm0
ucomisd %xmm0, %xmm2
jbe 0xcd54
movsd %xmm2, 0x20(%rbx)
movsbl %dl, %esi
cvtsi2sd %esi, %xmm0
movsd %xmm0, 0x18(%rbx)
movapd %xmm2, %xmm0
incq %rdx
jmp 0xcd21
callq 0x557b
movsd %xmm0, 0x20(%rbx)
jmp 0xcd76
movq 0x10(%rbx), %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, (%rax)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbx
movl 0xc0(%rsi), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
xorpd %xmm0, %xmm0
movapd 0x33f0(%rip), %xmm1     # 0x109a0
cmpq %rax, %rcx
je 0xd65b
movq 0xb0(%rsi), %rdx
cmpl $0x0, (%rdx,%rcx,4)
je 0xd653
movq 0x98(%rsi), %rdi
movq 0xa8(%rsi), %rdx
movslq (%rdi,%rcx,4), %rdi
movsbq (%rdx,%rcx), %r9
movq %r9, %r8
addq %rdi, %r8
xorpd %xmm2, %xmm2
movq %rdi, %r10
cmpq %r8, %r10
jge 0xd610
movq 0x10(%rsi), %r11
movq 0x30(%rsi), %rbx
movsd (%r11,%r10,8), %xmm3
mulsd (%rbx,%r10,8), %xmm3
subsd %xmm3, %xmm2
incq %r10
jmp 0xd5ee
movq %rdi, %r8
movsbl %r9b, %r9d
addl %edi, %r9d
movslq %r9d, %r9
cmpq %r9, %r8
jge 0xd653
ucomisd %xmm0, %xmm2
movq 0x10(%rsi), %r9
movsd (%r9,%r8,8), %xmm3
jbe 0xd644
xorpd %xmm1, %xmm3
movq 0x30(%rsi), %r10
mulsd (%r10,%r8,8), %xmm3
divsd %xmm2, %xmm3
movsd %xmm3, (%r9,%r8,8)
incq %r8
movb (%rdx,%rcx), %r9b
jmp 0xd613
incq %rcx
jmp 0xd5b0
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x2ee1(%rip), %rsi      # 0x11302
movq %r15, %rdi
xorl %eax, %eax
callq 0x33c0
movq 0x68(%r12), %rax
movsbq 0x901(%rax), %rdi
pushq $0x8
popq %rsi
callq 0x3100
movq %rax, %rdx
movq %rax, 0x10(%r12)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x18(%r12)
leaq 0x309b(%rip), %rbp      # 0x114f5
xorl %ebx, %ebx
xorl %r13d, %r13d
movsbq 0x901(%r14), %rax
cmpq %rax, %r13
jge 0xe4bf
decl %eax
addq %rbx, %rdx
cmpl %eax, %r13d
movq %rbp, %rsi
leaq 0x3072(%rip), %rax      # 0x114f0
cmoveq %rax, %rsi
movq %r15, %rdi
xorl %eax, %eax
callq 0x33c0
movq 0x10(%r12), %rdx
movsd (%rdx,%r13,8), %xmm0
ucomisd 0x20(%r12), %xmm0
jbe 0xe4b6
movsd %xmm0, 0x20(%r12)
movsbl %r13b, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x18(%r12)
incq %r13
addq $0x8, %rbx
jmp 0xe45f
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_O2/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
movb 0x900(%rax), %r12b
leaq 0x284b(%rip), %rsi      # 0x112de
movq %r15, %rdi
callq 0x3220
testq %rax, %rax
je 0xeb77
movq %rax, %r14
movq 0x68(%rbx), %rax
movq 0x8a0(%rax), %rcx
pushq $-0x1
popq %rax
incl %eax
leaq 0x4(%rcx), %rdx
cmpl %ebp, (%rcx)
movq %rdx, %rcx
jne 0xeab5
movzbl %r12b, %ecx
xorl %edx, %edx
testb %cl, %cl
cmovlel %edx, %ecx
movzbl %cl, %r13d
leaq 0x2a3c(%rip), %r12      # 0x11514
movslq %eax, %rbp
xorl %r15d, %r15d
cmpq %r15, %r13
je 0xeb03
movq 0x70(%rbx), %rax
movq (%rax,%rbp,8), %rax
movsd (%rax,%r15,8), %xmm0
movq %r14, %rdi
movq %r12, %rsi
movb $0x1, %al
callq 0x32d0
incq %r15
jmp 0xeade
xorl %r15d, %r15d
cmpq %r15, %r13
je 0xeb2e
movq 0x90(%rbx), %rax
movq (%rax,%rbp,8), %rax
movsd (%rax,%r15,8), %xmm0
movq %r14, %rdi
movq %r12, %rsi
movb $0x1, %al
callq 0x32d0
incq %r15
jmp 0xeb06
movq 0x68(%rbx), %rax
movq 0x888(%rax), %rax
movsbl (%rax,%rbp), %edx
movq %r14, %rdi
leaq 0x2093(%rip), %rsi      # 0x10bda
xorl %eax, %eax
callq 0x32d0
movq 0xb8(%rbx), %rax
movl (%rax,%rbp,4), %eax
cmpl $-0x1, %eax
jne 0xead8
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31b0
movq 0x745a(%rip), %rax      # 0x15fd8
movq (%rax), %rdi
leaq 0x2758(%rip), %rsi      # 0x112e0
movq %r15, %rdx
xorl %eax, %eax
callq 0x32d0
pushq $0x1
popq %rdi
callq 0x3240
// File: /workspace/github_cpp_makefile_star2_O2/myudelson[P]hmm-scalable/./utilsSt.h
// Function: double* initToValue1D<double>(int, double)
T* initToValue1D(NDAT size, T val) {
    T* ar = Calloc(T, (size_t)size);
    for(NDAT i=0; i<size; i++)
        ar[i] = val;
    return ar;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, 0x8(%rsp)
movslq %edi, %rbx
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x3100
movsd 0x8(%rsp), %xmm0
xorl %ecx, %ecx
testl %ebx, %ebx
cmovlel %ecx, %ebx
cmpq %rcx, %rbx
je 0xec65
movsd %xmm0, (%rax,%rcx,8)
incq %rcx
jmp 0xec56
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movslq %edi, %rbx
pushq $0x8
popq %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3100
movq %rax, %r15
movslq %ebp, %r12
xorl %r13d, %r13d
testl %ebx, %ebx
cmovlel %r13d, %ebx
cmpq %r13, %rbx
je 0xec13
movq %r12, %rdi
movq %r14, %rsi
callq 0x3100
movq %rax, (%r15,%r13,8)
incq %r13
jmp 0xebfa
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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, %r13d
movl %esi, %r12d
movslq %edi, %rbp
pushq $0x8
popq %r14
movq %rbp, %rdi
movq %r14, %rsi
callq 0x3100
movq %rax, (%rsp)
movslq %r12d, %rax
xorl %r15d, %r15d
testl %eax, %eax
movl $0x0, %ebx
movq %rax, 0x8(%rsp)
cmovgl %eax, %ebx
movslq %r13d, %r13
testl %ebp, %ebp
cmovlel %r15d, %ebp
movq %rbp, 0x10(%rsp)
cmpq 0x10(%rsp), %r15
je 0xecf9
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x3100
movq %rax, %rbp
movq (%rsp), %rax
movq %rbp, (%rax,%r15,8)
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0xecf4
movq %r13, %rdi
movq %r14, %rsi
callq 0x3100
movq %rax, (%rbp,%r12,8)
incq %r12
jmp 0xecda
incq %r15
jmp 0xecb8
movq (%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/myudelson[P]hmm-scalable/./utilsSt.h
// Function: void toValue3D<double>(double***, int, int, int, double)
void toValue3D(T*** ar, NDAT size1, NDAT size2, NDAT size3, T val) {
    for(NDAT i=0; i<size1; i++)
         for(NDAT j=0; j<size2; j++)
             for(NDAT l=0; l<size3; l++)
                 ar[i][j][l] = val;
}

// Assembly:
xorl %eax, %eax
testl %ecx, %ecx
cmovlel %eax, %ecx
testl %edx, %edx
cmovlel %eax, %edx
testl %esi, %esi
cmovlel %eax, %esi
cmpq %rsi, %rax
je 0xee19
xorl %r8d, %r8d
cmpq %rdx, %r8
je 0xee14
xorl %r9d, %r9d
cmpq %r9, %rcx
je 0xee0f
movq (%rdi,%rax,8), %r10
movq (%r10,%r8,8), %r10
movsd %xmm0, (%r10,%r9,8)
incq %r9
jmp 0xedf7
incq %r8
jmp 0xedef
incq %rax
jmp 0xede7
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x9be0
leaq 0x6cb4(%rip), %rax      # 0x15cd0
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0xd0(%rbx)
movq 0x68(%rbx), %rax
cmpb $0xe, 0x4e(%rax)
jne 0xf052
movups %xmm0, 0xe0(%rbx)
movb $0x0, 0xf0(%rbx)
movups %xmm0, 0xf8(%rbx)
andq $0x0, 0x108(%rbx)
popq %rbx
retq
movq 0x6f7f(%rip), %rax      # 0x15fd8
movq (%rax), %rcx
leaq 0x2505(%rip), %rdi      # 0x11568
pushq $0x4f
popq %rsi
pushq $0x1
popq %rdx
callq 0x3400
pushq $0x1
popq %rdi
callq 0x3240
// File: /workspace/github_cpp_makefile_star2_O2/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 0x9be0
leaq 0x6c44(%rip), %rax      # 0x15cd0
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0xd0(%rbx)
cmpb $0xe, 0x4e(%r14)
jne 0xf0c0
movl 0x908(%r14), %eax
shll $0x2, %eax
movl %eax, 0x8(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf0f8
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x6f11(%rip), %rax      # 0x15fd8
movq (%rax), %rcx
leaq 0x2497(%rip), %rdi      # 0x11568
pushq $0x4f
popq %rsi
pushq $0x1
popq %rdx
callq 0x3400
pushq $0x1
popq %rdi
callq 0x3240
movq %rax, %r14
movq %rbx, %rdi
callq 0xa1fa
movq %r14, %rdi
callq 0x3390
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0x9c08
movl 0x904(%r14), %ebp
movsbl 0x30(%r14), %edi
movb %dil, 0xf0(%rbx)
callq 0x6a57
movq %rax, 0xe0(%rbx)
movsbl 0xf0(%rbx), %edi
xorl %ecx, %ecx
testb %dil, %dil
movl $0x0, %edx
cmovgl %edi, %edx
movslq %edx, %rdx
cmpq %rcx, %rdx
je 0xf155
movq 0x28(%r14), %rsi
movsd (%rsi,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
incq %rcx
jmp 0xf13d
xorps %xmm0, %xmm0
callq 0xec30
movq %rax, 0xe8(%rbx)
movl %ebp, %edi
xorl %esi, %esi
callq 0xef2f
movq %rax, 0x100(%rbx)
xorps %xmm0, %xmm0
movl %ebp, %edi
callq 0xec30
movq %rax, 0xf8(%rbx)
movl 0x8f8(%r14), %edi
xorps %xmm0, %xmm0
callq 0xec30
movq %rax, 0x108(%rbx)
movq 0x68(%rbx), %rax
movzbl 0x20(%rax), %eax
leal -0x1(%rax), %ecx
cmpl $0x3, %ecx
ja 0xf1f1
leaq 0x236e(%rip), %rax      # 0x11520
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x52(%rip), %rax        # 0xf214
jmp 0xf1dd
leaq 0x9f(%rip), %rax        # 0xf26a
jmp 0xf1dd
leaq 0x10c(%rip), %rax       # 0xf2e0
jmp 0xf1dd
leaq 0x43(%rip), %rax        # 0xf220
movq %rax, 0xd0(%rbx)
andq $0x0, 0xd8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
movsbl %al, %edx
movq 0x6ddd(%rip), %rax      # 0x15fd8
movq (%rax), %rdi
leaq 0x23b3(%rip), %rsi      # 0x115b8
xorl %eax, %eax
callq 0x32d0
pushq $0x1
popq %rdi
callq 0x3240
// File: /workspace/github_cpp_makefile_star2_O2/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 0x230a(%rip), %rdx      # 0x11550
movsd (%rdx,%rax,8), %xmm0
movslq 0x4(%rsi), %rax
mulsd %xmm0, %xmm1
cvtsi2sdl (%rcx,%rax,4), %xmm2
mulsd %xmm1, %xmm2
addsd 0x16ec(%rip), %xmm2     # 0x10950
divsd %xmm2, %xmm0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x22bc(%rip), %rdx      # 0x11550
movsd (%rdx,%rax,8), %xmm0
movsd %xmm0, 0x10(%rsp)
movslq 0x4(%rsi), %rax
mulsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
cvtsi2sdl (%rcx,%rax,4), %xmm0
mulsd 0x22a6(%rip), %xmm0     # 0x11560
callq 0x33a0
mulsd 0x8(%rsp), %xmm0
addsd 0x1683(%rip), %xmm0     # 0x10950
movsd 0x10(%rsp), %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x1649(%rip), %xmm2     # 0x10950
subsd %xmm0, %xmm2
xorpd %xmm0, %xmm0
maxsd %xmm0, %xmm2
movapd 0x1685(%rip), %xmm3     # 0x109a0
xorpd %xmm2, %xmm3
cmplesd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0xf379
retq
pushq %rax
xorl %eax, %eax
testb %dl, %dl
sete %al
leaq 0x21c8(%rip), %rcx      # 0x11550
movsd (%rcx,%rax,8), %xmm1
movq 0xf8(%rdi), %rax
movslq 0x4(%rsi), %rcx
mulsd (%rax,%rcx,8), %xmm1
movsd %xmm1, (%rsp)
callq 0x561b
addsd (%rsp), %xmm0
popq %rax
jmp 0x55f7
// File: /workspace/github_cpp_makefile_star2_O2/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 0xf3e7
retq
pushq %rax
xorl %eax, %eax
testb %cl, %cl
sete %al
leaq 0x215a(%rip), %rcx      # 0x11550
movsd (%rcx,%rax,8), %xmm1
movq 0xf8(%rdi), %rax
movslq 0x4(%rsi), %rcx
mulsd (%rax,%rcx,8), %xmm1
movsd %xmm1, (%rsp)
callq 0x561b
addsd (%rsp), %xmm0
popq %rax
jmp 0x55f7
// File: /workspace/github_cpp_makefile_star2_O2/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 0xf4af
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 0xf4b7
xorl %eax, %eax
testb %cl, %cl
sete %al
leaq 0x20d0(%rip), %rcx      # 0x11550
movsd (%rcx,%rax,8), %xmm1
movq 0xf8(%rdi), %rax
movslq 0x4(%rsi), %rcx
mulsd (%rax,%rcx,8), %xmm1
movsd %xmm1, (%rsp)
callq 0x561b
addsd (%rsp), %xmm0
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x55f7
movsd 0x1499(%rip), %xmm0     # 0x10950
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
movq %rdi, %rbx
callq 0xa62c
movq 0x68(%rbx), %rax
movq 0x100(%rbx), %rdi
movl 0x904(%rax), %esi
callq 0xef19
movq 0x68(%rbx), %rax
movq 0xf8(%rbx), %rdi
movl 0x904(%rax), %esi
callq 0xedbf
movq 0x68(%rbx), %rax
movq 0x108(%rbx), %rdi
movl 0x8f8(%rax), %esi
popq %rbx
jmp 0xedbf
// File: /workspace/github_cpp_makefile_star2_O2/myudelson[P]hmm-scalable/HMMProblemEloSt.cpp
// Function: HMMProblemEloSt::updateValuesLocal(double***, int*, signed char, double*, context*)
void HMMProblemEloSt::updateValuesLocal(NUMBER*** group_skill_map, NCAT* skills, NPAR n_skills, NUMBER* local_pred, struct context *ctx) {
    // parent (BKT's) updateValuesLocal
    HMMProblemSt::updateValuesLocal(group_skill_map, skills, n_skills, local_pred, ctx);
    
    // local Elo updateValuesLocal
    NPAR corr = (NPAR)(1-ctx->o);
    this->elo_track_g[ctx->g] += (this->*sensitivity)(ctx) * (corr - local_pred[0]);
    this->elo_track_t[ctx->t] = this->elo_track_g[ctx->g];
    // update counts
    this->elo_count_g[ctx->g]++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r15
movq %rdi, %r14
callq 0xc4ec
movb 0x10(%rbx), %cl
movq 0xd0(%r14), %rax
movq 0xd8(%r14), %rdi
addq %r14, %rdi
testb $0x1, %al
je 0xf53f
movq (%rdi), %rdx
movq -0x1(%rdx,%rax), %rax
movb $0x1, %bpl
subb %cl, %bpl
movq %rbx, %rsi
callq *%rax
movsbl %bpl, %eax
cvtsi2sd %eax, %xmm1
subsd (%r15), %xmm1
movq 0xf8(%r14), %rax
movslq 0x4(%rbx), %rcx
mulsd %xmm0, %xmm1
addsd (%rax,%rcx,8), %xmm1
movsd %xmm1, (%rax,%rcx,8)
movq 0x108(%r14), %rax
movslq 0xc(%rbx), %rdx
movsd %xmm1, (%rax,%rdx,8)
movq 0x100(%r14), %rax
incl (%rax,%rcx,4)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0xf64b
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x30d0
leaq 0xe(%rax), %rdi
callq 0x32a0
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x31a0
movq %r15, %rdi
callq 0x30d0
movabsq $0x676e697461725f5f, %rcx # imm = 0x676E697461725F5F
movq %rcx, (%r15,%rax)
movabsq $0x7478742e73676e, %rcx # imm = 0x7478742E73676E
movq %rcx, 0x6(%r15,%rax)
leaq 0x1ce1(%rip), %rsi      # 0x112de
movq %r15, %rdi
callq 0x3220
testq %rax, %rax
je 0xf66a
movq %rax, %r14
xorl %r12d, %r12d
leaq 0x1fff(%rip), %r15      # 0x11616
movq 0x68(%rbx), %rax
movslq 0x8f8(%rax), %rax
cmpq %rax, %r12
jge 0xf657
movq 0x108(%rbx), %rax
movsd (%rax,%r12,8), %xmm0
callq 0x55f7
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x32d0
incq %r12
jmp 0xf617
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x31b0
movq 0x6967(%rip), %rax      # 0x15fd8
movq (%rax), %rdi
leaq 0x1f76(%rip), %rsi      # 0x115f1
movq %r15, %rdx
xorl %eax, %eax
callq 0x32d0
pushq $0x1
popq %rdi
callq 0x3240