// File: myudelson[P]hmm-scalable/HMMProblemPiABGK.cpp
// Function: HMMProblemPiABGK::init(param*)
void HMMProblemPiABGK::init(struct param *param) {
	this->p = param;
	this->non01constraints = true;
    this->null_obs_ratio = Calloc(NUMBER, (size_t)this->p->nO);
    this->neg_log_lik = 0;
    this->null_skill_obs = 0;
    this->null_skill_obs_prob = 0;
    NPAR nS = this->p->nS, nO = this->p->nO; NCAT nK = this->p->nK, nG = this->p->nG;
    
    NUMBER *a_PI, ** a_A, ** a_B;
    init3Params(a_PI, a_A, a_B, nS, nO);
    
    //
    // setup params
    //
	NPAR i, j, m, idx, offset;
	NUMBER sumPI = 0;
	NUMBER sumA[nS];
	NUMBER sumB[nS];
	for(i=0; i<nS; i++) {
		sumA[i] = 0;
		sumB[i] = 0;
	}
    
    // write default parameters first
	// populate PI
	for(i=0; i<((nS)-1); i++) {
		a_PI[i] = this->p->init_params[i];
		sumPI  += this->p->init_params[i];
	}
	a_PI[nS-1] = 1 - sumPI;
	// populate A
	offset = (NPAR)(nS-1);
	for(i=0; i<nS; i++) {
		for(j=0; j<((nS)-1); j++) {
			idx = (NPAR)(offset + i*((nS)-1) + j);
			a_A[i][j] = this->p->init_params[idx];
			sumA[i]  += this->p->init_params[idx];
		}
		a_A[i][((nS)-1)]  = 1 - sumA[i];
	}
	// polupale B
	offset = (NPAR)((nS-1) + nS*(nS-1));
	for(i=0; i<nS; i++) {
		for(j=0; j<((nO)-1); j++) {
			idx = (NPAR)(offset + i*((nO)-1) + j);
			a_B[i][j] = this->p->init_params[idx];
			sumB[i] += this->p->init_params[idx];
		}
		a_B[i][((nO)-1)]  = 1 - sumB[i];
	}
    
    // mass produce PI's/PIg's, A's, B's
    if( this->p->do_not_check_constraints==0 && !checkPIABConstraints(a_PI, a_A, a_B)) {
        fprintf(stderr,"params do not meet constraints.\n");
        exit(1);
    }
    this->pi  = init2D<NUMBER>(nK, nS);
    this->A   = init3D<NUMBER>(nK, nS, nS);
    this->B   = init3D<NUMBER>(nK, nS, nO);
    this->PIg = init2D<NUMBER>(nG, nS);
    this->Ag  = init3D<NUMBER>(nG, nS, nS);
    this->Bg  = init3D<NUMBER>(nG, nS, nO);
    NCAT x;
    for(x=0; x<nK; x++) {
        cpy1D<NUMBER>(a_PI, this->pi[x], nS);
        cpy2D<NUMBER>(a_A,  this->A[x],  nS, nS);
        cpy2D<NUMBER>(a_B,  this->B[x],  nS, nO);
    }
    // PIg start with "no-effect" params,PI[i] = 1/nS
    for(x=0; x<nG; x++) {
        for(i=0; i<nS; i++) {
            this->PIg[x][i] = (NUMBER)1/nS;
            for(j=0; j<nS; j++)
                this->Ag[x][i][j] = (NUMBER)1/nS;
            for(m=0; m<nS; m++)
                this->Bg[x][i][m] = (NUMBER)1/nO;
        }
    }
    // destroy setup params
	free(a_PI);
	free2D<NUMBER>(a_A, nS);
	free2D<NUMBER>(a_B, nS);
	
    // if needs be -- read in init params from a file
    if(param->initfile[0]!=0)
        this->readModel(param->initfile, false /* read and upload but not overwrite*/);

    // populate boundaries
	// populate lb*/ub*
	// *PI
    init3Params(this->lbPI, this->lbA, this->lbB, nS, nO);
    init3Params(this->ubPI, this->ubA, this->ubB, nS, nO);
	for(i=0; i<nS; i++) {
		lbPI[i] = this->p->param_lo[i];
		ubPI[i] = this->p->param_hi[i];
	}
	// *A
	offset = nS;
	for(i=0; i<nS; i++)
		for(j=0; j<nS; j++) {
			idx = (NPAR)(offset + i*nS + j);
			lbA[i][j] = this->p->param_lo[idx];
			ubA[i][j] = this->p->param_hi[idx];
		}
	// *B
	offset = (NPAR)(nS + nS*nS);
	for(i=0; i<nS; i++)
		for(j=0; j<nO; j++) {
			idx = (NPAR)(offset + i*nS + j);
			lbB[i][j] = this->p->param_lo[idx];
			ubB[i][j] = this->p->param_hi[idx];
		}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, 0x88(%rax)
movb $0x1, 0x80(%rax)
movq 0x88(%rax), %rax
movsbq 0x8b9(%rax), %rdi
movl $0x8, %esi
callq 0x5180
movq -0x80(%rbp), %rdi
movq %rax, 0x18(%rdi)
movq $0x0, 0x20(%rdi)
movq $0x0, 0x28(%rdi)
movq $0x0, 0x30(%rdi)
movq 0x88(%rdi), %rax
movb 0x8b8(%rax), %al
movb %al, -0x11(%rbp)
movq 0x88(%rdi), %rax
movb 0x8b9(%rax), %al
movb %al, -0x12(%rbp)
movq 0x88(%rdi), %rax
movl 0x8c0(%rax), %eax
movl %eax, -0x18(%rbp)
movq 0x88(%rdi), %rax
movl 0x8bc(%rax), %eax
movl %eax, -0x1c(%rbp)
movsbl -0x11(%rbp), %r8d
movsbl -0x12(%rbp), %r9d
leaq -0x28(%rbp), %rsi
leaq -0x30(%rbp), %rdx
leaq -0x38(%rbp), %rcx
callq 0x19de0
movq $0x0, -0x48(%rbp)
movzbl -0x11(%rbp), %edx
movl %edx, %eax
movq %rsp, %rcx
movq %rcx, -0x50(%rbp)
movl %edx, %ecx
leal 0xf(,%rcx,8), %ecx
andl $-0x10, %ecx
movl %ecx, %edx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x78(%rbp)
movq %rcx, %rsp
movq %rax, -0x58(%rbp)
movzbl -0x11(%rbp), %edx
movl %edx, %eax
movl %edx, %ecx
leal 0xf(,%rcx,8), %ecx
andl $-0x10, %ecx
movl %ecx, %edx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x70(%rbp)
movq %rcx, %rsp
movq %rax, -0x60(%rbp)
movb $0x0, -0x39(%rbp)
movsbl -0x39(%rbp), %eax
movsbl -0x11(%rbp), %ecx
cmpl %ecx, %eax
jge 0x347e6
movq -0x70(%rbp), %rax
movq -0x78(%rbp), %rcx
movsbq -0x39(%rbp), %rdx
xorps %xmm0, %xmm0
movsd %xmm0, (%rcx,%rdx,8)
movsbq -0x39(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movb -0x39(%rbp), %al
addb $0x1, %al
movb %al, -0x39(%rbp)
jmp 0x347ae
movb $0x0, -0x39(%rbp)
movsbl -0x39(%rbp), %eax
movsbl -0x11(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x34849
movq -0x80(%rbp), %rax
movq 0x88(%rax), %rcx
movq 0x8(%rcx), %rcx
movsbq -0x39(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq -0x28(%rbp), %rcx
movsbq -0x39(%rbp), %rdx
movsd %xmm0, (%rcx,%rdx,8)
movq 0x88(%rax), %rax
movq 0x8(%rax), %rax
movsbq -0x39(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movb -0x39(%rbp), %al
addb $0x1, %al
movb %al, -0x39(%rbp)
jmp 0x347ea
movsd 0x1b1b7(%rip), %xmm0    # 0x4fa08
subsd -0x48(%rbp), %xmm0
movq -0x28(%rbp), %rax
movsbl -0x11(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movsbl -0x11(%rbp), %eax
subl $0x1, %eax
movb %al, -0x3d(%rbp)
movb $0x0, -0x39(%rbp)
movsbl -0x39(%rbp), %eax
movsbl -0x11(%rbp), %ecx
cmpl %ecx, %eax
jge 0x3495f
movb $0x0, -0x3a(%rbp)
movsbl -0x3a(%rbp), %eax
movsbl -0x11(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x34920
movq -0x78(%rbp), %rax
movq -0x80(%rbp), %rcx
movsbl -0x3d(%rbp), %edx
movsbl -0x39(%rbp), %esi
movsbl -0x11(%rbp), %edi
subl $0x1, %edi
imull %edi, %esi
addl %esi, %edx
movsbl -0x3a(%rbp), %esi
addl %esi, %edx
movb %dl, -0x3c(%rbp)
movq 0x88(%rcx), %rdx
movq 0x8(%rdx), %rdx
movsbq -0x3c(%rbp), %rsi
movsd (%rdx,%rsi,8), %xmm0
movq -0x30(%rbp), %rdx
movsbq -0x39(%rbp), %rsi
movq (%rdx,%rsi,8), %rdx
movsbq -0x3a(%rbp), %rsi
movsd %xmm0, (%rdx,%rsi,8)
movq 0x88(%rcx), %rcx
movq 0x8(%rcx), %rcx
movsbq -0x3c(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movsbq -0x39(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movb -0x3a(%rbp), %al
addb $0x1, %al
movb %al, -0x3a(%rbp)
jmp 0x3488b
movq -0x78(%rbp), %rax
movsbq -0x39(%rbp), %rcx
movsd 0x1b0d7(%rip), %xmm0    # 0x4fa08
subsd (%rax,%rcx,8), %xmm0
movq -0x30(%rbp), %rax
movsbq -0x39(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl -0x11(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movb -0x39(%rbp), %al
addb $0x1, %al
movb %al, -0x39(%rbp)
jmp 0x34877
movsbl -0x11(%rbp), %eax
subl $0x1, %eax
movsbl -0x11(%rbp), %ecx
movsbl -0x11(%rbp), %edx
subl $0x1, %edx
imull %edx, %ecx
addl %ecx, %eax
movb %al, -0x3d(%rbp)
movb $0x0, -0x39(%rbp)
movsbl -0x39(%rbp), %eax
movsbl -0x11(%rbp), %ecx
cmpl %ecx, %eax
jge 0x34a65
movb $0x0, -0x3a(%rbp)
movsbl -0x3a(%rbp), %eax
movsbl -0x12(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x34a26
movq -0x70(%rbp), %rax
movq -0x80(%rbp), %rcx
movsbl -0x3d(%rbp), %edx
movsbl -0x39(%rbp), %esi
movsbl -0x12(%rbp), %edi
subl $0x1, %edi
imull %edi, %esi
addl %esi, %edx
movsbl -0x3a(%rbp), %esi
addl %esi, %edx
movb %dl, -0x3c(%rbp)
movq 0x88(%rcx), %rdx
movq 0x8(%rdx), %rdx
movsbq -0x3c(%rbp), %rsi
movsd (%rdx,%rsi,8), %xmm0
movq -0x38(%rbp), %rdx
movsbq -0x39(%rbp), %rsi
movq (%rdx,%rsi,8), %rdx
movsbq -0x3a(%rbp), %rsi
movsd %xmm0, (%rdx,%rsi,8)
movq 0x88(%rcx), %rcx
movq 0x8(%rcx), %rcx
movsbq -0x3c(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movsbq -0x39(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movb -0x3a(%rbp), %al
addb $0x1, %al
movb %al, -0x3a(%rbp)
jmp 0x34991
movq -0x70(%rbp), %rax
movsbq -0x39(%rbp), %rcx
movsd 0x1afd1(%rip), %xmm0    # 0x4fa08
subsd (%rax,%rcx,8), %xmm0
movq -0x38(%rbp), %rax
movsbq -0x39(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl -0x12(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movb -0x39(%rbp), %al
addb $0x1, %al
movb %al, -0x39(%rbp)
jmp 0x3497d
movq -0x80(%rbp), %rax
movq 0x88(%rax), %rax
movsbl 0x32(%rax), %eax
cmpl $0x0, %eax
jne 0x34ab4
movq -0x80(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0x19e80
testb $0x1, %al
jne 0x34ab4
movq 0x2653f(%rip), %rax     # 0x5afd8
movq (%rax), %rdi
leaq 0x1b9cc(%rip), %rsi     # 0x5046f
movb $0x0, %al
callq 0x5440
movl $0x1, %edi
callq 0x5390
movl -0x18(%rbp), %edi
movsbl -0x11(%rbp), %esi
callq 0xf580
movq %rax, %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x38(%rax)
movl -0x18(%rbp), %edi
movsbl -0x11(%rbp), %esi
movsbl -0x11(%rbp), %edx
callq 0x11310
movq %rax, %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x40(%rax)
movl -0x18(%rbp), %edi
movsbl -0x11(%rbp), %esi
movsbl -0x12(%rbp), %edx
callq 0x11310
movq %rax, %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x48(%rax)
movl -0x1c(%rbp), %edi
movsbl -0x11(%rbp), %esi
callq 0xf580
movq %rax, %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x90(%rax)
movl -0x1c(%rbp), %edi
movsbl -0x11(%rbp), %esi
movsbl -0x11(%rbp), %edx
callq 0x11310
movq %rax, %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x98(%rax)
movl -0x1c(%rbp), %edi
movsbl -0x11(%rbp), %esi
movsbl -0x12(%rbp), %edx
callq 0x11310
movq %rax, %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0xa0(%rax)
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x34bd0
movq -0x80(%rbp), %rax
movq -0x28(%rbp), %rdi
movq 0x38(%rax), %rax
movslq -0x64(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movsbl -0x11(%rbp), %edx
callq 0xc440
movq -0x80(%rbp), %rax
movq -0x30(%rbp), %rdi
movq 0x40(%rax), %rax
movslq -0x64(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movsbl -0x11(%rbp), %edx
movsbl -0x11(%rbp), %ecx
callq 0xf650
movq -0x80(%rbp), %rax
movq -0x38(%rbp), %rdi
movq 0x48(%rax), %rax
movslq -0x64(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movsbl -0x11(%rbp), %edx
movsbl -0x12(%rbp), %ecx
callq 0xf650
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x34b5e
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x34cef
movb $0x0, -0x39(%rbp)
movsbl -0x39(%rbp), %eax
movsbl -0x11(%rbp), %ecx
cmpl %ecx, %eax
jge 0x34cdf
movq -0x80(%rbp), %rax
movsbl -0x11(%rbp), %ecx
cvtsi2sd %ecx, %xmm1
movsd 0x1adfd(%rip), %xmm0    # 0x4fa08
divsd %xmm1, %xmm0
movq 0x90(%rax), %rax
movslq -0x64(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x39(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movb $0x0, -0x3a(%rbp)
movsbl -0x3a(%rbp), %eax
movsbl -0x11(%rbp), %ecx
cmpl %ecx, %eax
jge 0x34c7c
movq -0x80(%rbp), %rax
movsbl -0x11(%rbp), %ecx
cvtsi2sd %ecx, %xmm1
movsd 0x1adbc(%rip), %xmm0    # 0x4fa08
divsd %xmm1, %xmm0
movq 0x98(%rax), %rax
movslq -0x64(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x39(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x3a(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movb -0x3a(%rbp), %al
addb $0x1, %al
movb %al, -0x3a(%rbp)
jmp 0x34c2c
movb $0x0, -0x3b(%rbp)
movsbl -0x3b(%rbp), %eax
movsbl -0x11(%rbp), %ecx
cmpl %ecx, %eax
jge 0x34cd0
movq -0x80(%rbp), %rax
movsbl -0x12(%rbp), %ecx
cvtsi2sd %ecx, %xmm1
movsd 0x1ad68(%rip), %xmm0    # 0x4fa08
divsd %xmm1, %xmm0
movq 0xa0(%rax), %rax
movslq -0x64(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x39(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x3b(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movb -0x3b(%rbp), %al
addb $0x1, %al
movb %al, -0x3b(%rbp)
jmp 0x34c80
jmp 0x34cd2
movb -0x39(%rbp), %al
addb $0x1, %al
movb %al, -0x39(%rbp)
jmp 0x34be7
jmp 0x34ce1
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x34bd7
movq -0x28(%rbp), %rdi
callq 0x5380
movq -0x30(%rbp), %rdi
movsbl -0x11(%rbp), %esi
callq 0xc7f0
movq -0x38(%rbp), %rdi
movsbl -0x11(%rbp), %esi
callq 0xc7f0
movq -0x10(%rbp), %rax
movsbl 0x6c(%rax), %eax
cmpl $0x0, %eax
je 0x34d32
movq -0x80(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x6c, %rsi
xorl %edx, %edx
callq 0x1a1f0
movq -0x80(%rbp), %rdi
movq %rdi, %rsi
addq $0x50, %rsi
movq %rdi, %rdx
addq $0x58, %rdx
movq %rdi, %rcx
addq $0x60, %rcx
movb -0x11(%rbp), %al
movsbl %al, %r8d
movsbl -0x12(%rbp), %r9d
callq 0x19de0
movq -0x80(%rbp), %rdi
movq %rdi, %rsi
addq $0x68, %rsi
movq %rdi, %rdx
addq $0x70, %rdx
movq %rdi, %rcx
addq $0x78, %rcx
movb -0x11(%rbp), %al
movsbl %al, %r8d
movsbl -0x12(%rbp), %r9d
callq 0x19de0
movb $0x0, -0x39(%rbp)
movsbl -0x39(%rbp), %eax
movsbl -0x11(%rbp), %ecx
cmpl %ecx, %eax
jge 0x34dea
movq -0x80(%rbp), %rax
movq 0x88(%rax), %rcx
movq 0x18(%rcx), %rcx
movsbq -0x39(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x50(%rax), %rcx
movsbq -0x39(%rbp), %rdx
movsd %xmm0, (%rcx,%rdx,8)
movq 0x88(%rax), %rcx
movq 0x20(%rcx), %rcx
movsbq -0x39(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x68(%rax), %rax
movsbq -0x39(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movb -0x39(%rbp), %al
addb $0x1, %al
movb %al, -0x39(%rbp)
jmp 0x34d8a
movb -0x11(%rbp), %al
movb %al, -0x3d(%rbp)
movb $0x0, -0x39(%rbp)
movsbl -0x39(%rbp), %eax
movsbl -0x11(%rbp), %ecx
cmpl %ecx, %eax
jge 0x34eaa
movb $0x0, -0x3a(%rbp)
movsbl -0x3a(%rbp), %eax
movsbl -0x11(%rbp), %ecx
cmpl %ecx, %eax
jge 0x34e9b
movq -0x80(%rbp), %rax
movsbl -0x3d(%rbp), %ecx
movsbl -0x39(%rbp), %edx
movsbl -0x11(%rbp), %esi
imull %esi, %edx
addl %edx, %ecx
movsbl -0x3a(%rbp), %edx
addl %edx, %ecx
movb %cl, -0x3c(%rbp)
movq 0x88(%rax), %rcx
movq 0x18(%rcx), %rcx
movsbq -0x3c(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x58(%rax), %rcx
movsbq -0x39(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movsbq -0x3a(%rbp), %rdx
movsd %xmm0, (%rcx,%rdx,8)
movq 0x88(%rax), %rcx
movq 0x20(%rcx), %rcx
movsbq -0x3c(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x70(%rax), %rax
movsbq -0x39(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x3a(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movb -0x3a(%rbp), %al
addb $0x1, %al
movb %al, -0x3a(%rbp)
jmp 0x34e08
jmp 0x34e9d
movb -0x39(%rbp), %al
addb $0x1, %al
movb %al, -0x39(%rbp)
jmp 0x34df4
movsbl -0x11(%rbp), %eax
movsbl -0x11(%rbp), %ecx
movsbl -0x11(%rbp), %edx
imull %edx, %ecx
addl %ecx, %eax
movb %al, -0x3d(%rbp)
movb $0x0, -0x39(%rbp)
movsbl -0x39(%rbp), %eax
movsbl -0x11(%rbp), %ecx
cmpl %ecx, %eax
jge 0x34f78
movb $0x0, -0x3a(%rbp)
movsbl -0x3a(%rbp), %eax
movsbl -0x12(%rbp), %ecx
cmpl %ecx, %eax
jge 0x34f69
movq -0x80(%rbp), %rax
movsbl -0x3d(%rbp), %ecx
movsbl -0x39(%rbp), %edx
movsbl -0x11(%rbp), %esi
imull %esi, %edx
addl %edx, %ecx
movsbl -0x3a(%rbp), %edx
addl %edx, %ecx
movb %cl, -0x3c(%rbp)
movq 0x88(%rax), %rcx
movq 0x18(%rcx), %rcx
movsbq -0x3c(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x60(%rax), %rcx
movsbq -0x39(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movsbq -0x3a(%rbp), %rdx
movsd %xmm0, (%rcx,%rdx,8)
movq 0x88(%rax), %rcx
movq 0x20(%rcx), %rcx
movsbq -0x3c(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x78(%rax), %rax
movsbq -0x39(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x3a(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movb -0x3a(%rbp), %al
addb $0x1, %al
movb %al, -0x3a(%rbp)
jmp 0x34ed6
jmp 0x34f6b
movb -0x39(%rbp), %al
addb $0x1, %al
movb %al, -0x39(%rbp)
jmp 0x34ec2
movq -0x50(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)