// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemSlicedAB.cpp
// Function: HMMProblemSlicedAB::toFileGroup(char const*)
void HMMProblemSlicedAB::toFileGroup(const char *filename) {
	FILE *fid = fopen(filename,"w");
	if(fid == NULL) {
		fprintf(stderr,"Can't write output model file %s\n",filename);
		exit(1);
	}
    
    // write solved id
    writeSolverInfo(fid, this->p);
    
	fprintf(fid,"Null skill ratios\t");
	for(NPAR m=0; m<this->p->nO; m++)
		fprintf(fid," %12.10f%s",this->null_obs_ratio[m],(m==(this->p->nO-1))?"\n":"\t");
	NCAT g;
    NPAR z;
	std::map<NCAT,std::string>::iterator it;
	for(g=0;g<this->p->nG;g++) {
		it = this->p->map_group_bwd->find(g);
		fprintf(fid,"%d\t%s\n",g,it->second.c_str());
		NPAR i,j,m;
		fprintf(fid,"PI\t");
		for(i=0; i<this->p->nS; i++)
			fprintf(fid,"%12.10f%s",this->pi[g][i],(i==(this->p->nS-1))?"\n":"\t");
        for(z=0; z<this->p->nZ; z++){
            fprintf(fid,"A - slice %d\t",z);
            for(i=0; i<this->p->nS; i++)
                for(j=0; j<this->p->nS; j++)
                    fprintf(fid,"%12.10f%s",this->A[g][z][i][j],(i==(this->p->nS-1) && j==(this->p->nS-1))?"\n":"\t");
        }
        for(z=0; z<this->p->nZ; z++){
            fprintf(fid,"B - slice %d \t",z);
            for(i=0; i<this->p->nS; i++)
                for(m=0; m<this->p->nO; m++)
                    fprintf(fid,"%12.10f%s",this->B[g][z][i][m],(i==(this->p->nS-1) && m==(this->p->nO-1))?"\n":"\t");
        }
	}
	fclose(fid);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xe533(%rip), %rsi      # 0x354b6
movq %r15, %rdi
callq 0x4290
testq %rax, %rax
je 0x273d7
movq %rax, %r14
movq 0x88(%rbx), %rsi
movq %rax, %rdi
callq 0xa118
leaq 0xe52d(%rip), %rdi      # 0x354da
movl $0x12, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x4480
movq 0x88(%rbx), %rax
movb 0x8b9(%rax), %al
leaq 0xd28a(%rip), %r13      # 0x3425d
leaq 0xebcc(%rip), %rbp      # 0x35ba6
testb %al, %al
movq %rbx, (%rsp)
jle 0x2702e
xorl %r15d, %r15d
leaq 0xe8a2(%rip), %r12      # 0x3588e
movsbl %al, %eax
decl %eax
movq %r13, %rdx
cmpl %eax, %r15d
je 0x26ffc
movq %rbp, %rdx
movq 0x18(%rbx), %rax
movsd (%rax,%r15,8), %xmm0
movq %r14, %rdi
movq %r12, %rsi
movb $0x1, %al
callq 0x4330
movq (%rsp), %rbx
incq %r15
movq 0x88(%rbx), %rax
movsbq 0x8b9(%rax), %rax
cmpq %rax, %r15
jl 0x26fec
movq 0x88(%rbx), %rax
cmpl $0x0, 0x8bc(%rax)
jle 0x273c1
leaq 0xe846(%rip), %rbx      # 0x3588f
xorl %r12d, %r12d
movq %r14, 0x10(%rsp)
movq 0x928(%rax), %rax
movq 0x10(%rax), %rdx
addq $0x8, %rax
movq %rax, %rcx
testq %rdx, %rdx
je 0x27086
movq %rax, %rcx
movslq 0x20(%rdx), %rsi
xorl %edi, %edi
cmpq %rsi, %r12
setg %dil
cmovleq %rdx, %rcx
movq 0x10(%rdx,%rdi,8), %rdx
testq %rdx, %rdx
jne 0x2706b
cmpq %rax, %rcx
je 0x27096
movslq 0x20(%rcx), %rdx
cmpq %rdx, %r12
cmovgeq %rcx, %rax
movq 0x28(%rax), %rcx
movq %r14, %rdi
leaq 0xe453(%rip), %rsi      # 0x354f7
movl %r12d, %edx
xorl %eax, %eax
callq 0x4330
movl $0x3, %esi
movl $0x1, %edx
leaq 0xe43f(%rip), %rdi      # 0x354fe
movq %r14, %rcx
callq 0x4480
movq (%rsp), %r10
movq 0x88(%r10), %rax
movb 0x8b8(%rax), %al
testb %al, %al
jle 0x27124
xorl %r15d, %r15d
movsbl %al, %eax
movq 0x38(%r10), %rcx
movq (%rcx,%r12,8), %rcx
movsd (%rcx,%r15,8), %xmm0
decl %eax
cmpl %eax, %r15d
movq %rbp, %rdx
cmoveq %r13, %rdx
movq %r14, %rdi
movq %rbx, %rsi
movb $0x1, %al
callq 0x4330
movq (%rsp), %r10
incq %r15
movq 0x88(%r10), %rax
movsbq 0x8b8(%rax), %rax
cmpq %rax, %r15
jl 0x270df
movq %r12, 0x18(%rsp)
movq 0x88(%r10), %rax
cmpb $0x0, 0x8c8(%rax)
jle 0x2724c
xorl %edx, %edx
movq %r14, %rdi
leaq 0xea6e(%rip), %rsi      # 0x35bb7
movq %rdx, 0x8(%rsp)
xorl %eax, %eax
callq 0x4330
movq (%rsp), %r10
movq 0x88(%r10), %rax
cmpb $0x0, 0x8b8(%rax)
jle 0x27227
xorl %ebp, %ebp
movq 0x88(%r10), %rax
movb 0x8b8(%rax), %al
testb %al, %al
leaq 0xd0d8(%rip), %r8       # 0x3425d
movq 0x10(%rsp), %rdi
leaq 0xea15(%rip), %r14      # 0x35ba6
leaq 0xe6f7(%rip), %r12      # 0x3588f
movq 0x18(%rsp), %r15
movq 0x8(%rsp), %rbx
jle 0x2720c
xorl %r13d, %r13d
movsbl %al, %eax
movq 0x90(%r10), %rcx
movq (%rcx,%r15,8), %rcx
movq (%rcx,%rbx,8), %rcx
movq (%rcx,%rbp,8), %rcx
movsd (%rcx,%r13,8), %xmm0
decl %eax
movl %r13d, %ecx
xorl %eax, %ecx
xorl %ebp, %eax
orl %ecx, %eax
movq %r14, %rdx
cmoveq %r8, %rdx
movq %rdi, %rbx
movq %r12, %rsi
movb $0x1, %al
callq 0x4330
movq %rbx, %rdi
movq 0x8(%rsp), %rbx
leaq 0xd06c(%rip), %r8       # 0x3425d
movq (%rsp), %r10
incq %r13
movq 0x88(%r10), %rax
movsbq 0x8b8(%rax), %rax
cmpq %rax, %r13
jl 0x271a7
incq %rbp
movq 0x88(%r10), %rax
movsbq 0x8b8(%rax), %rax
cmpq %rax, %rbp
jl 0x2716f
movq 0x8(%rsp), %rdx
incq %rdx
movq 0x88(%r10), %rax
movsbq 0x8c8(%rax), %rax
cmpq %rax, %rdx
movq 0x10(%rsp), %r14
jl 0x2713f
movq 0x88(%r10), %rax
cmpb $0x0, 0x8c8(%rax)
jle 0x2738d
xorl %edx, %edx
movq %r14, %rdi
leaq 0xe93c(%rip), %rsi      # 0x35ba8
movq %rdx, 0x20(%rsp)
xorl %eax, %eax
callq 0x4330
movq (%rsp), %r10
movq 0x88(%r10), %rax
cmpb $0x0, 0x8b8(%rax)
jle 0x27368
xorl %r15d, %r15d
movq 0x88(%r10), %rax
movb 0x8b9(%rax), %cl
testb %cl, %cl
leaq 0xcfb4(%rip), %r14      # 0x3425d
movq 0x10(%rsp), %rdi
leaq 0xe8f1(%rip), %r9       # 0x35ba6
leaq 0xe5d3(%rip), %r12      # 0x3588f
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %rbp
jle 0x2734d
xorl %r13d, %r13d
movq %r15, 0x8(%rsp)
movsbl %cl, %ecx
movq 0x98(%r10), %rdx
movq (%rdx,%r11,8), %rdx
movq (%rdx,%rbp,8), %rdx
movq (%rdx,%r15,8), %rdx
movsd (%rdx,%r13,8), %xmm0
movsbl 0x8b8(%rax), %eax
decl %eax
xorl %r15d, %eax
decl %ecx
xorl %r13d, %ecx
orl %eax, %ecx
movq %r9, %rdx
cmoveq %r14, %rdx
movq %r12, %rsi
movb $0x1, %al
movq %rdi, %rbx
movq %r9, %r14
movq %r11, %r15
callq 0x4330
movq %r15, %r11
movq 0x8(%rsp), %r15
movq %r14, %r9
movq %rbx, %rdi
leaq 0xcf2b(%rip), %r14      # 0x3425d
movq (%rsp), %r10
incq %r13
movq 0x88(%r10), %rax
movsbq 0x8b9(%rax), %rcx
cmpq %rcx, %r13
jl 0x272d4
incq %r15
movq 0x88(%r10), %rax
movsbq 0x8b8(%rax), %rax
cmpq %rax, %r15
jl 0x27293
movq 0x20(%rsp), %rdx
incq %rdx
movq 0x88(%r10), %rax
movsbq 0x8c8(%rax), %rax
cmpq %rax, %rdx
movq 0x10(%rsp), %r14
jl 0x27262
movq 0x18(%rsp), %r12
incq %r12
movq 0x88(%r10), %rax
movslq 0x8bc(%rax), %rcx
cmpq %rcx, %r12
leaq 0xceb0(%rip), %r13      # 0x3425d
leaq 0xe7f2(%rip), %rbp      # 0x35ba6
leaq 0xe4d4(%rip), %rbx      # 0x3588f
jl 0x27051
movq %r14, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4200
movq %r15, %rdi
callq 0x53d6
nop