// File: myudelson[P]hmm-scalable/HMMProblemSlicedAB.cpp
// Function: HMMProblemSlicedAB::doBaumWelchStep(FitBitSlicedAB*)
NUMBER HMMProblemSlicedAB::doBaumWelchStep(FitBitSlicedAB *fb) {
	NCAT x;
    NPAR nS = this->p->nS, nO = this->p->nO, nZ = this->p->nZ;
	NPAR i,j,m, o, z;
	NDAT t;
    NUMBER ll;
    
    NCAT xndat = fb->xndat;
    struct data **x_data = fb->x_data;
    computeAlphaAndPOParam(xndat, x_data);
	computeBeta(xndat, x_data);
	computeXiGamma(xndat, x_data);
	

    NUMBER * b_PI = NULL;
	NUMBER *** b_A_num = NULL;
	NUMBER *** b_A_den = NULL;
	NUMBER *** b_B_num = NULL;
	NUMBER *** b_B_den = NULL;
//    NUMBER *** c_A     = NULL;  // A,B average across sequences
//    NUMBER *** c_B     = NULL;  // A,B average across sequences
    if(fb->pi != NULL)
        b_PI = init1D<NUMBER>((NDAT)nS);
    if(fb->A != NULL) {
        b_A_num = init3D<NUMBER>((NDAT)nZ, (NDAT)nS, (NDAT)nS);
        b_A_den = init3D<NUMBER>((NDAT)nZ, (NDAT)nS, (NDAT)nS);
//        c_A     = init3D<NUMBER>((NDAT)nZ, (NDAT)nS, (NDAT)nS);  // A,B average across sequences
    }
    if(fb->B != NULL) {
        b_B_num = init3D<NUMBER>((NDAT)nZ, (NDAT)nS, (NDAT)nO);
        b_B_den = init3D<NUMBER>((NDAT)nZ, (NDAT)nS, (NDAT)nO);
//        c_B     = init3D<NUMBER>((NDAT)nZ, (NDAT)nS, (NDAT)nO);  // A,B average across sequences
    }

    // compute sums PI

	for(x=0; x<xndat; x++) {
        if( x_data[x]->cnt!=0 ) continue;
        if(fb->pi != NULL) {
            for(i=0; i<nS; i++) {
                b_PI[i] += x_data[x]->gamma[0][i] / xndat;
            }
        }
		
		for(t=0;t<(x_data[x]->n-1);t++) {
            //			o = x_data[x]->obs[t];
            o = this->p->dat_obs[ x_data[x]->ix[t] ];//->get( x_data[x]->ix[t] );
			for(i=0; i<nS; i++) {
                if(fb->A != NULL) {
                    for(j=0; j<nS; j++){
                        z = this->p->dat_slice[ fb->x_data[x]->ix[t] ];
                        b_A_num[z][i][j] += x_data[x]->xi[t][i][j];
                        b_A_den[z][i][j] += x_data[x]->gamma[t][i];
                    }
                }
                if(fb->B != NULL) {
                    for(m=0; m<nO; m++) {
                        z = this->p->dat_slice[ fb->x_data[x]->ix[t] ];
                        b_B_num[z][i][m] += (m==o) * x_data[x]->gamma[t][i];
                        b_B_den[z][i][m] += x_data[x]->gamma[t][i];
                    }
                }
			}
		}
	} // for all groups within a skill
	// set params
	for(i=0; i<nS; i++) {
        if(fb->pi != NULL) fb->pi[i] = b_PI[i];
        if(fb->A != NULL) {
            for(j=0; j<nS; j++) {
                for(z=0; z<nZ; z++) {
                    fb->A[z][i][j] = b_A_num[z][i][j] / safe0num(b_A_den[z][i][j]);
                }
            }
        }
        if(fb->B != NULL) {
            for(m=0; m<nO; m++) {
                for(z=0; z<nZ; z++) {
                    fb->B[z][i][m] = b_B_num[z][i][m] / safe0num(b_B_den[z][i][m]);
                }
            }
        }
	}
    // scale
    if( !this->hasNon01Constraints() ) {
        if(fb->pi != NULL) projectsimplex(fb->pi, nS);
        for(i=0; i<nS; i++) {
            if(fb->A != NULL) {
                for(z=0; z<nZ; z++) {
                    projectsimplex(fb->A[z][i], nS);
                }
            }
            if(fb->B != NULL) {
                for(z=0; z<nZ; z++) {
                    projectsimplex(fb->B[z][i], nS);
                }
            }
        }
    } else {
        if(fb->pi != NULL) projectsimplexbounded(fb->pi, this->getLbPI(), this->getUbPI(), nS);
        for(i=0; i<nS; i++) {
            if(fb->A != NULL) {
                for(z=0; z<nZ; z++) {
                    projectsimplexbounded(fb->A[z][i], this->getLbA()[z][i], this->getUbA()[z][i], nS); // tag is currently fit slice
                }
            }
            if(fb->B != NULL) {
                for(z=0; z<nZ; z++) {
                    projectsimplexbounded(fb->B[z][i], this->getLbB()[z][i], this->getUbB()[z][i], nS);
                }
            }
        }
    }
    // compute LL
    computeAlphaAndPOParam(fb->xndat, fb->x_data);
    ll = HMMProblemSlicedAB::getSumLogPOPara(fb->xndat, fb->x_data);
    // free mem
    //    RecycleFitData(xndat, x_data, this->p);
	if(b_PI    != NULL) free(b_PI);
	if(b_A_num != NULL) free3D<NUMBER>(b_A_num, nZ, nS);
	if(b_A_den != NULL) free3D<NUMBER>(b_A_den, nZ, nS);
	if(b_B_num != NULL) free3D<NUMBER>(b_B_num, nZ, nS);
	if(b_B_den != NULL) free3D<NUMBER>(b_B_den, nZ, nS);
//    if(c_A     != NULL) free3D<NUMBER>(c_A, nZ, nS); // A,B average across sequences
//    if(c_B     != NULL) free3D<NUMBER>(c_B, nZ, nS); // A,B average across sequences
    return ll;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x68(%rbp)
movq 0x88(%rdi), %rax
movb 0x8b8(%rax), %al
movb %al, -0x15(%rbp)
movq 0x88(%rdi), %rax
movb 0x8b9(%rax), %al
movb %al, -0x16(%rbp)
movq 0x88(%rdi), %rax
movb 0x8c8(%rax), %al
movb %al, -0x17(%rbp)
movq -0x10(%rbp), %rax
movl 0xd0(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movq 0xd8(%rax), %rax
movq %rax, -0x38(%rbp)
movl -0x2c(%rbp), %esi
movq -0x38(%rbp), %rdx
callq 0x39fb0
movq -0x68(%rbp), %rdi
movl -0x2c(%rbp), %esi
movq -0x38(%rbp), %rdx
callq 0x3a570
movq -0x68(%rbp), %rdi
movl -0x2c(%rbp), %esi
movq -0x38(%rbp), %rdx
callq 0x3a890
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x3fdf3
movsbl -0x15(%rbp), %edi
callq 0xc410
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x3fe28
movsbl -0x17(%rbp), %edi
movsbl -0x15(%rbp), %esi
movsbl -0x15(%rbp), %edx
callq 0x11310
movq %rax, -0x48(%rbp)
movsbl -0x17(%rbp), %edi
movsbl -0x15(%rbp), %esi
movsbl -0x15(%rbp), %edx
callq 0x11310
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x3fe5d
movsbl -0x17(%rbp), %edi
movsbl -0x15(%rbp), %esi
movsbl -0x16(%rbp), %edx
callq 0x11310
movq %rax, -0x58(%rbp)
movsbl -0x17(%rbp), %edi
movsbl -0x15(%rbp), %esi
movsbl -0x16(%rbp), %edx
callq 0x11310
movq %rax, -0x60(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x40192
movq -0x38(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, 0x4(%rax)
je 0x3fe87
jmp 0x40184
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x3fee7
movb $0x0, -0x18(%rbp)
movsbl -0x18(%rbp), %eax
movsbl -0x15(%rbp), %ecx
cmpl %ecx, %eax
jge 0x3fee5
movq -0x38(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x38(%rax), %rax
movq (%rax), %rax
movsbq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
cvtsi2sdl -0x2c(%rbp), %xmm1
divsd %xmm1, %xmm0
movq -0x40(%rbp), %rax
movsbq -0x18(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movb -0x18(%rbp), %al
addb $0x1, %al
movb %al, -0x18(%rbp)
jmp 0x3fe96
jmp 0x3fee7
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x38(%rbp), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x40182
movq -0x68(%rbp), %rax
movq 0x88(%rax), %rax
movq 0x870(%rax), %rax
movq -0x38(%rbp), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x10(%rcx), %rcx
movslq -0x20(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movb (%rax,%rcx), %al
movb %al, -0x1b(%rbp)
movb $0x0, -0x18(%rbp)
movsbl -0x18(%rbp), %eax
movsbl -0x15(%rbp), %ecx
cmpl %ecx, %eax
jge 0x40172
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x4004e
movb $0x0, -0x19(%rbp)
movsbl -0x19(%rbp), %eax
movsbl -0x15(%rbp), %ecx
cmpl %ecx, %eax
jge 0x4004c
movq -0x68(%rbp), %rax
movq 0x88(%rax), %rax
movq 0x8a8(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0xd8(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x10(%rcx), %rcx
movslq -0x20(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movb (%rax,%rcx), %al
movb %al, -0x1c(%rbp)
movq -0x38(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x40(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x19(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x48(%rbp), %rax
movsbq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x19(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x38(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x50(%rbp), %rax
movsbq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x19(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movb -0x19(%rbp), %al
addb $0x1, %al
movb %al, -0x19(%rbp)
jmp 0x3ff61
jmp 0x4004e
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x40163
movb $0x0, -0x1a(%rbp)
movsbl -0x1a(%rbp), %eax
movsbl -0x16(%rbp), %ecx
cmpl %ecx, %eax
jge 0x40161
movq -0x68(%rbp), %rax
movq 0x88(%rax), %rax
movq 0x8a8(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0xd8(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x10(%rcx), %rcx
movslq -0x20(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movb (%rax,%rcx), %al
movb %al, -0x1c(%rbp)
movsbl -0x1a(%rbp), %eax
movsbl -0x1b(%rbp), %ecx
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
cvtsi2sd %eax, %xmm0
movq -0x38(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x38(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movq -0x58(%rbp), %rax
movsbq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x1a(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x38(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x60(%rbp), %rax
movsbq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x1a(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movb -0x1a(%rbp), %al
addb $0x1, %al
movb %al, -0x1a(%rbp)
jmp 0x40061
jmp 0x40163
jmp 0x40165
movb -0x18(%rbp), %al
addb $0x1, %al
movb %al, -0x18(%rbp)
jmp 0x3ff3e
jmp 0x40174
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x3feee
jmp 0x40184
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3fe64
movb $0x0, -0x18(%rbp)
movsbl -0x18(%rbp), %eax
movsbl -0x15(%rbp), %ecx
cmpl %ecx, %eax
jge 0x4037e
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x401d1
movq -0x40(%rbp), %rax
movsbq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movsbq -0x18(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x402a0
movb $0x0, -0x19(%rbp)
movsbl -0x19(%rbp), %eax
movsbl -0x15(%rbp), %ecx
cmpl %ecx, %eax
jge 0x4029e
movb $0x0, -0x1c(%rbp)
movsbl -0x1c(%rbp), %eax
movsbl -0x17(%rbp), %ecx
cmpl %ecx, %eax
jge 0x4028f
movq -0x48(%rbp), %rax
movsbq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x19(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x50(%rbp), %rax
movsbq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x19(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x9a40
movaps %xmm0, %xmm1
movsd -0x70(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movsbq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x19(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movb -0x1c(%rbp), %al
addb $0x1, %al
movb %al, -0x1c(%rbp)
jmp 0x401f8
jmp 0x40291
movb -0x19(%rbp), %al
addb $0x1, %al
movb %al, -0x19(%rbp)
jmp 0x401e4
jmp 0x402a0
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x4036f
movb $0x0, -0x1a(%rbp)
movsbl -0x1a(%rbp), %eax
movsbl -0x16(%rbp), %ecx
cmpl %ecx, %eax
jge 0x4036d
movb $0x0, -0x1c(%rbp)
movsbl -0x1c(%rbp), %eax
movsbl -0x17(%rbp), %ecx
cmpl %ecx, %eax
jge 0x4035e
movq -0x58(%rbp), %rax
movsbq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x1a(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x78(%rbp)
movq -0x60(%rbp), %rax
movsbq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x1a(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x9a40
movaps %xmm0, %xmm1
movsd -0x78(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movsbq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x1a(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movb -0x1c(%rbp), %al
addb $0x1, %al
movb %al, -0x1c(%rbp)
jmp 0x402c7
jmp 0x40360
movb -0x1a(%rbp), %al
addb $0x1, %al
movb %al, -0x1a(%rbp)
jmp 0x402b3
jmp 0x4036f
jmp 0x40371
movb -0x18(%rbp), %al
addb $0x1, %al
movb %al, -0x18(%rbp)
jmp 0x40196
movq -0x68(%rbp), %rdi
callq 0x1a4e0
testb $0x1, %al
jne 0x40467
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x403ab
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movsbl -0x15(%rbp), %esi
callq 0x7980
movb $0x0, -0x18(%rbp)
movsbl -0x18(%rbp), %eax
movsbl -0x15(%rbp), %ecx
cmpl %ecx, %eax
jge 0x40462
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x40409
movb $0x0, -0x1c(%rbp)
movsbl -0x1c(%rbp), %eax
movsbl -0x17(%rbp), %ecx
cmpl %ecx, %eax
jge 0x40407
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movsbq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movsbl -0x15(%rbp), %esi
callq 0x7980
movb -0x1c(%rbp), %al
addb $0x1, %al
movb %al, -0x1c(%rbp)
jmp 0x403ce
jmp 0x40409
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x40453
movb $0x0, -0x1c(%rbp)
movsbl -0x1c(%rbp), %eax
movsbl -0x17(%rbp), %ecx
cmpl %ecx, %eax
jge 0x40451
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movsbq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movsbl -0x15(%rbp), %esi
callq 0x7980
movb -0x1c(%rbp), %al
addb $0x1, %al
movb %al, -0x1c(%rbp)
jmp 0x40418
jmp 0x40453
jmp 0x40455
movb -0x18(%rbp), %al
addb $0x1, %al
movb %al, -0x18(%rbp)
jmp 0x403af
jmp 0x40621
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x404ae
movq -0x68(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x88(%rbp)
callq 0x39ce0
movq -0x68(%rbp), %rdi
movq %rax, -0x80(%rbp)
callq 0x39da0
movq -0x88(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq %rax, %rdx
movsbl -0x15(%rbp), %ecx
callq 0x87e0
movb $0x0, -0x18(%rbp)
movsbl -0x18(%rbp), %eax
movsbl -0x15(%rbp), %ecx
cmpl %ecx, %eax
jge 0x4061f
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x40569
movb $0x0, -0x1c(%rbp)
movsbl -0x1c(%rbp), %eax
movsbl -0x17(%rbp), %ecx
cmpl %ecx, %eax
jge 0x40567
movq -0x68(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movsbq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x98(%rbp)
callq 0x39d20
movq -0x68(%rbp), %rdi
movsbq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x90(%rbp)
callq 0x39de0
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rsi
movsbq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movsbl -0x15(%rbp), %ecx
callq 0x87e0
movb -0x1c(%rbp), %al
addb $0x1, %al
movb %al, -0x1c(%rbp)
jmp 0x404d5
jmp 0x40569
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x40610
movb $0x0, -0x1c(%rbp)
movsbl -0x1c(%rbp), %eax
movsbl -0x17(%rbp), %ecx
cmpl %ecx, %eax
jge 0x4060e
movq -0x68(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movsbq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xa8(%rbp)
callq 0x39d60
movq -0x68(%rbp), %rdi
movsbq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xa0(%rbp)
callq 0x39e20
movq -0xa8(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movsbq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movsbl -0x15(%rbp), %ecx
callq 0x87e0
movb -0x1c(%rbp), %al
addb $0x1, %al
movb %al, -0x1c(%rbp)
jmp 0x4057c
jmp 0x40610
jmp 0x40612
movb -0x18(%rbp), %al
addb $0x1, %al
movb %al, -0x18(%rbp)
jmp 0x404b2
jmp 0x40621
movq -0x68(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0xd0(%rax), %esi
movq -0x10(%rbp), %rax
movq 0xd8(%rax), %rdx
callq 0x39fb0
movq -0x68(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0xd0(%rax), %esi
movq -0x10(%rbp), %rax
movq 0xd8(%rax), %rdx
callq 0x1a9f0
movsd %xmm0, -0x28(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x40672
movq -0x40(%rbp), %rdi
callq 0x5380
cmpq $0x0, -0x48(%rbp)
je 0x4068a
movq -0x48(%rbp), %rdi
movsbl -0x17(%rbp), %esi
movsbl -0x15(%rbp), %edx
callq 0x11290
cmpq $0x0, -0x50(%rbp)
je 0x406a2
movq -0x50(%rbp), %rdi
movsbl -0x17(%rbp), %esi
movsbl -0x15(%rbp), %edx
callq 0x11290
cmpq $0x0, -0x58(%rbp)
je 0x406ba
movq -0x58(%rbp), %rdi
movsbl -0x17(%rbp), %esi
movsbl -0x15(%rbp), %edx
callq 0x11290
cmpq $0x0, -0x60(%rbp)
je 0x406d2
movq -0x60(%rbp), %rdi
movsbl -0x17(%rbp), %esi
movsbl -0x15(%rbp), %edx
callq 0x11290
movsd -0x28(%rbp), %xmm0
addq $0xb0, %rsp
popq %rbp
retq