// File: /workspace/github_cpp_makefile_star2_O3/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:
testl %esi, %esi
jle 0x11820
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x88(%rdi), %rax
movzbl 0x8b8(%rax), %r12d
movsbq %r12b, %rax
movq %rax, 0x20(%rsp)
movl %r12d, %r15d
shll $0x3, %r15d
movl %esi, %eax
movq %rax, 0x28(%rsp)
xorl %ebp, %ebp
movq %r15, 0x18(%rsp)
movq %rdx, 0x8(%rsp)
movq (%rdx,%rbp,8), %rbx
cmpl $0x0, 0x4(%rbx)
je 0x11686
incq %rbp
cmpq 0x28(%rsp), %rbp
movq 0x8(%rsp), %rdx
jne 0x11668
jmp 0x11812
movq 0x38(%rbx), %rax
movl (%rbx), %r13d
testq %rax, %rax
je 0x116c7
testl %r13d, %r13d
jle 0x1172a
movq %rax, %r14
movq %rbx, 0x10(%rsp)
xorl %ebx, %ebx
testb %r12b, %r12b
jle 0x116b8
movq (%r14,%rbx,8), %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x4120
incq %rbx
cmpq %rbx, %r13
jne 0x116a5
movq 0x10(%rsp), %rbx
jmp 0x1172a
movslq %r13d, %rdi
movl $0x8, %esi
callq 0x4130
movq %rax, 0x38(%rbx)
movq 0x8(%rsp), %r14
movq (%r14,%rbp,8), %rbx
movl (%rbx), %r13d
testl %r13d, %r13d
jle 0x1172f
movq %rbx, %r14
xorl %ebx, %ebx
movq %rbp, %r15
movq 0x20(%rsp), %rbp
movl $0x8, %esi
movq %rbp, %rdi
callq 0x4130
movq 0x38(%r14), %rcx
movq %rax, (%rcx,%rbx,8)
incq %rbx
movq 0x8(%rsp), %rax
movq (%rax,%r15,8), %r14
movslq (%r14), %r13
cmpq %r13, %rbx
jl 0x116f6
movq %r15, %rbp
movq 0x18(%rsp), %r15
movq %r14, %rbx
movq 0x8(%rsp), %r14
movq 0x40(%rbx), %rax
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x11787
testl %r13d, %r13d
jle 0x11672
movl %r13d, %eax
movq %rax, 0x10(%rsp)
xorl %r13d, %r13d
testb %r12b, %r12b
jle 0x11778
movq 0x30(%rsp), %rax
movq (%rax,%r13,8), %rbx
xorl %r14d, %r14d
movq (%rbx,%r14,8), %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x4120
incq %r14
cmpq %r14, %r12
jne 0x11762
incq %r13
cmpq 0x10(%rsp), %r13
jne 0x11751
jmp 0x11672
movslq %r13d, %rdi
movl $0x8, %esi
callq 0x4130
movq %rax, 0x40(%rbx)
movq (%r14,%rbp,8), %rbx
cmpl $0x0, (%rbx)
jle 0x11672
xorl %r13d, %r13d
movl $0x8, %esi
movq %rbp, %r15
movq 0x20(%rsp), %rbp
movq %rbp, %rdi
callq 0x4130
movq 0x40(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
testb %r12b, %r12b
movq 0x8(%rsp), %r14
jle 0x117f6
xorl %ebx, %ebx
movl $0x8, %esi
movq %rbp, %rdi
callq 0x4130
movq (%r14,%r15,8), %rcx
movq 0x40(%rcx), %rcx
movq (%rcx,%r13,8), %rcx
movq %rax, (%rcx,%rbx,8)
incq %rbx
cmpq %rbx, %r12
jne 0x117d1
incq %r13
movq (%r14,%r15,8), %rbx
movslq (%rbx), %rax
cmpq %rax, %r13
movq %r15, %rbp
movq 0x18(%rsp), %r15
jl 0x117a8
jmp 0x11672
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop