// File: /workspace/github_cpp_makefile_star2_O1/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 0x1199f
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq 0x88(%rdi), %rax
movsbq 0x8b8(%rax), %rbp
movzbl %bpl, %r13d
leal (,%r13,8), %eax
movq %rax, 0x30(%rsp)
leal (,%r13,8), %r12d
movl %esi, %eax
movq %rax, 0x20(%rsp)
xorl %eax, %eax
movq %rbp, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movq %r12, 0x28(%rsp)
movq %rax, 0x18(%rsp)
movq (%rdx,%rax,8), %rbx
cmpl $0x0, 0x4(%rbx)
je 0x117fc
movq 0x18(%rsp), %rax
incq %rax
cmpq 0x20(%rsp), %rax
movq 0x10(%rsp), %rdx
jne 0x117d4
jmp 0x11991
movq 0x38(%rbx), %rax
movl (%rbx), %r15d
testq %rax, %rax
je 0x1183a
testl %r15d, %r15d
jle 0x1189b
movq %rax, %r14
xorl %ebx, %ebx
testb %bpl, %bpl
jle 0x11830
movq (%r14,%rbx,8), %rdi
xorl %esi, %esi
movq 0x30(%rsp), %rdx
callq 0x4120
movq 0x8(%rsp), %rbp
incq %rbx
cmpq %rbx, %r15
jne 0x11816
jmp 0x1189b
movslq %r15d, %rdi
movl $0x8, %esi
callq 0x4130
movq 0x8(%rsp), %rbp
movq %rax, 0x38(%rbx)
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rbx
cmpl $0x0, (%rbx)
jle 0x1189b
xorl %r15d, %r15d
movl $0x8, %esi
movq 0x8(%rsp), %rdi
callq 0x4130
movq 0x8(%rsp), %rbp
movq 0x38(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rbx
movslq (%rbx), %rax
cmpq %rax, %r15
jl 0x11866
movq 0x18(%rsp), %r15
movq 0x10(%rsp), %r14
movq (%r14,%r15,8), %rbx
movq 0x40(%rbx), %rcx
movl (%rbx), %eax
movq %rcx, 0x38(%rsp)
testq %rcx, %rcx
je 0x11907
testl %eax, %eax
jle 0x117e3
xorl %r15d, %r15d
movq %rax, 0x40(%rsp)
testb %bpl, %bpl
jle 0x118f0
movq 0x38(%rsp), %rax
movq (%rax,%r15,8), %rbx
xorl %r14d, %r14d
movq (%rbx,%r14,8), %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x4120
incq %r14
cmpq %r14, %r13
jne 0x118da
incq %r15
movq 0x40(%rsp), %rax
cmpq %rax, %r15
movq 0x8(%rsp), %rbp
jne 0x118c9
jmp 0x117e3
movslq %eax, %rdi
movl $0x8, %esi
callq 0x4130
movq 0x8(%rsp), %rbp
movq %rax, 0x40(%rbx)
movq (%r14,%r15,8), %rbx
cmpl $0x0, (%rbx)
jle 0x117e3
xorl %r15d, %r15d
movl $0x8, %esi
movq %rbp, %rdi
callq 0x4130
movq 0x40(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
testb %r13b, %r13b
movq 0x10(%rsp), %r14
movq 0x18(%rsp), %r12
jle 0x11978
xorl %ebx, %ebx
movl $0x8, %esi
movq %rbp, %rdi
callq 0x4130
movq (%r14,%r12,8), %rcx
movq 0x40(%rcx), %rcx
movq (%rcx,%r15,8), %rcx
movq %rax, (%rcx,%rbx,8)
incq %rbx
cmpq %rbx, %r13
jne 0x11953
incq %r15
movq (%r14,%r12,8), %rbx
movslq (%rbx), %rax
cmpq %rax, %r15
movq 0x28(%rsp), %r12
jl 0x1192d
jmp 0x117e3
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq