// File: 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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rax
movb 0x8b8(%rax), %al
movb %al, -0x19(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x1af56
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, 0x4(%rax)
je 0x1acd1
jmp 0x1af48
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x38(%rax)
jne 0x1ad61
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq (%rax), %rdi
movl $0x8, %esi
callq 0x5180
movq %rax, %rcx
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq %rcx, 0x38(%rax)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x18(%rbp), %rcx
movslq -0x20(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl (%rcx), %eax
jge 0x1ad5f
movsbq -0x19(%rbp), %rdi
movl $0x8, %esi
callq 0x5180
movq %rax, %rdx
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x38(%rax), %rax
movslq -0x24(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1ad17
jmp 0x1adc9
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x18(%rbp), %rcx
movslq -0x20(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl (%rcx), %eax
jge 0x1adc7
movb $0x0, -0x25(%rbp)
movsbl -0x25(%rbp), %eax
movsbl -0x19(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1adba
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x38(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x25(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movb -0x25(%rbp), %al
addb $0x1, %al
movb %al, -0x25(%rbp)
jmp 0x1ad7f
jmp 0x1adbc
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1ad68
jmp 0x1adc9
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x40(%rax)
jne 0x1aeb6
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq (%rax), %rdi
movl $0x8, %esi
callq 0x5180
movq %rax, %rcx
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq %rcx, 0x40(%rax)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x18(%rbp), %rcx
movslq -0x20(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl (%rcx), %eax
jge 0x1aeb1
movsbq -0x19(%rbp), %rdi
movl $0x8, %esi
callq 0x5180
movq %rax, %rdx
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x40(%rax), %rax
movslq -0x24(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movb $0x0, -0x25(%rbp)
movsbl -0x25(%rbp), %eax
movsbl -0x19(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1aea1
movsbq -0x19(%rbp), %rdi
movl $0x8, %esi
callq 0x5180
movq %rax, %rdx
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x40(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x25(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movb -0x25(%rbp), %al
addb $0x1, %al
movb %al, -0x25(%rbp)
jmp 0x1ae58
jmp 0x1aea3
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1ae13
jmp 0x1af46
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x18(%rbp), %rcx
movslq -0x20(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl (%rcx), %eax
jge 0x1af44
movb $0x0, -0x25(%rbp)
movsbl -0x25(%rbp), %eax
movsbl -0x19(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1af34
movb $0x0, -0x26(%rbp)
movsbl -0x26(%rbp), %eax
movsbl -0x19(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1af28
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x40(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x25(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x26(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movb -0x26(%rbp), %al
addb $0x1, %al
movb %al, -0x26(%rbp)
jmp 0x1aee4
jmp 0x1af2a
movb -0x25(%rbp), %al
addb $0x1, %al
movb %al, -0x25(%rbp)
jmp 0x1aed4
jmp 0x1af36
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1aebd
jmp 0x1af46
jmp 0x1af48
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1acae
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)