// File: /workspace/github_cpp_makefile_star2_O2/myudelson[P]hmm-scalable/HMMProblem.cpp
// Function: HMMProblem::initXiGamma(int, data**)
void HMMProblem::initXiGamma(NCAT xndat, struct data** x_data) {
    NPAR nS = this->p->nS;
//    int parallel_now = this->p->parallel==2; //PAR
//    #pragma omp parallel for schedule(dynamic) if(parallel_now) //PAR
	for(NCAT x=0; x<xndat; x++) {
        NDAT t;
        NPAR i, j;
		if( x_data[x]->cnt!=0 ) continue; // ... and the thing has not been computed yet (e.g. from group to skill)
		// Xi
		if( x_data[x]->gamma == NULL ) {
			x_data[x]->gamma = Calloc(NUMBER*, (size_t)x_data[x]->n);
			for(t=0; t<x_data[x]->n; t++)
				x_data[x]->gamma[t] = Calloc(NUMBER, (size_t)nS);
			
		} else {
			for(t=0; t<x_data[x]->n; t++)
				for(i=0; i<nS; i++)
					x_data[x]->gamma[t][i] = 0.0;
		}
		// Gamma
		if( x_data[x]->xi == NULL ) {
			x_data[x]->xi = Calloc(NUMBER**, (size_t)x_data[x]->n);
			for(t=0; t<x_data[x]->n; t++) {
				x_data[x]->xi[t] = Calloc(NUMBER*, (size_t)nS);
				for(i=0; i<nS; i++)
					x_data[x]->xi[t][i] = Calloc(NUMBER, (size_t)nS);
			}
			
		} else {
			for(t=0; t<x_data[x]->n; t++)
				for(i=0; i<nS; i++)
					for(j=0; j<nS; j++)
						x_data[x]->xi[t][i][j] = 0.0;
		}
	} // for all groups in skill
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x8(%rsp)
movq 0x88(%rdi), %rax
movzbl 0x8b8(%rax), %r13d
movsbq %r13b, %r15
xorl %eax, %eax
testb %r15b, %r15b
movl $0x0, %ebp
cmovgl %r13d, %ebp
testl %esi, %esi
cmovlel %eax, %esi
movq %rsi, 0x10(%rsp)
xorl %r14d, %r14d
cmpq 0x10(%rsp), %r14
je 0xe6d7
movq 0x8(%rsp), %rax
movq (%rax,%r14,8), %r12
cmpl $0x0, 0x4(%r12)
je 0xe5ac
incq %r14
jmp 0xe58b
movq 0x38(%r12), %rcx
movl (%r12), %eax
testq %rcx, %rcx
je 0xe5e5
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
xorl %esi, %esi
cmpq %rdx, %rsi
je 0xe622
xorl %edi, %edi
cmpq %rdi, %rbp
je 0xe5e0
movq (%rcx,%rsi,8), %r8
andq $0x0, (%r8,%rdi,8)
incq %rdi
jmp 0xe5cd
incq %rsi
jmp 0xe5c6
movslq %eax, %rdi
pushq $0x8
popq %rsi
callq 0x4120
movq %rax, 0x38(%r12)
xorl %ebx, %ebx
movq 0x8(%rsp), %rax
movq (%rax,%r14,8), %r12
movslq (%r12), %rax
cmpq %rax, %rbx
jge 0xe622
movq %r15, %rdi
pushq $0x8
popq %rsi
callq 0x4120
movq 0x38(%r12), %rcx
movq %rax, (%rcx,%rbx,8)
incq %rbx
jmp 0xe5f7
movq 0x40(%r12), %rcx
testq %rcx, %rcx
je 0xe66b
testl %eax, %eax
movl $0x0, %edx
cmovlel %edx, %eax
xorl %edx, %edx
cmpq %rax, %rdx
je 0xe5a7
xorl %esi, %esi
cmpq %rbp, %rsi
je 0xe666
xorl %edi, %edi
cmpq %rdi, %r13
je 0xe661
movq (%rcx,%rdx,8), %r8
movq (%r8,%rsi,8), %r8
andq $0x0, (%r8,%rdi,8)
incq %rdi
jmp 0xe64a
incq %rsi
jmp 0xe643
incq %rdx
jmp 0xe638
movslq %eax, %rdi
pushq $0x8
popq %rsi
callq 0x4120
movq %rax, 0x40(%r12)
xorl %r12d, %r12d
movq 0x8(%rsp), %rax
movq (%rax,%r14,8), %rbx
movslq (%rbx), %rax
cmpq %rax, %r12
jge 0xe5a7
movq %r15, %rdi
pushq $0x8
popq %rsi
callq 0x4120
movq 0x40(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
xorl %ebx, %ebx
cmpq %rbx, %rbp
je 0xe6d2
movq %r15, %rdi
pushq $0x8
popq %rsi
callq 0x4120
movq 0x8(%rsp), %rcx
movq (%rcx,%r14,8), %rcx
movq 0x40(%rcx), %rcx
movq (%rcx,%r12,8), %rcx
movq %rax, (%rcx,%rbx,8)
incq %rbx
jmp 0xe6a8
incq %r12
jmp 0xe67e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq