// File: /workspace/github_cpp_makefile_star2_O2/myudelson[P]hmm-scalable/HMMProblemSt.cpp
// Function: HMMProblemSt::toFileGroup(char const*)
void HMMProblemSt::toFileGroup(const char *filename) {
    NPAR nS = this->task->nS, nO = this->task->nO;
    NCAT nG = this->task->nG;
	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->task);
    
	fprintf(fid,"Null skill ratios\t");
	for(NPAR m=0; m<nO; m++)
		fprintf(fid," %10.7f%s",this->null_obs_ratios[m],(m==(nO-1))?"\n":"\t");
	NCAT g;
	std::map<NCAT,std::string>::iterator it;
	for(g=0;g<nG;g++) {
		it = this->task->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<=nS; i++)
            fprintf(fid,"%12.10f%s",this->param_skill[PI(g,i)],(i==(nS-1))?"\n":"\t");
        fprintf(fid,"A\t");
        for(i=0; i<=nS; i++)
            for(j=0; j<=nS; j++)
                fprintf(fid,"%12.10f%s",this->param_skill[A(g,i,j)],(i==(nS-1) && j==(nS-1))?"\n":"\t");
        fprintf(fid,"B\t");
        for(i=0; i<=nS; i++)
            for(m=0; m<=nO; m++)
                fprintf(fid,"%12.10f%s",this->param_skill[B(g,i,m)],(i==(nS-1) && m==(nO-1))?"\n":"\t");
	}
	fclose(fid);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r12
movq %rdi, %rbx
movq 0x68(%rdi), %rax
movsbl 0x900(%rax), %ecx
movq %rcx, 0x20(%rsp)
movsbl 0x901(%rax), %r14d
movl 0x904(%rax), %eax
movl %eax, 0x1c(%rsp)
leaq 0x529f(%rip), %rsi      # 0x112de
movq %r12, %rdi
callq 0x3220
testq %rax, %rax
je 0xc2ee
movq %rax, %r15
movq 0x68(%rbx), %rsi
movq %rax, %rdi
callq 0x66a1
leaq 0x529c(%rip), %rdi      # 0x11302
pushq $0x12
popq %rsi
pushq $0x1
popq %rdx
movq %r15, 0x10(%rsp)
movq %r15, %rcx
callq 0x3400
leal -0x1(%r14), %eax
movq %rax, 0x28(%rsp)
xorl %r15d, %r15d
testb %r14b, %r14b
movl $0x0, %eax
movq %r14, 0x30(%rsp)
cmovgl %r14d, %eax
movslq %eax, %r13
leaq 0x5275(%rip), %r12      # 0x11315
cmpq %r15, %r13
je 0xc0da
movq 0x10(%rbx), %rax
movsd (%rax,%r15,8), %xmm0
cmpq %r15, 0x28(%rsp)
leaq 0x527a(%rip), %rdx      # 0x11335
leaq 0x41b8(%rip), %rax      # 0x1027a
cmoveq %rax, %rdx
movq 0x10(%rsp), %rdi
movq %r12, %rsi
movb $0x1, %al
callq 0x32d0
incq %r15
jmp 0xc0a0
movq 0x20(%rsp), %r14
leal -0x1(%r14), %eax
movl %eax, 0x8(%rsp)
xorl %eax, %eax
movq 0x10(%rsp), %r12
movl %eax, 0x4(%rsp)
cmpl 0x1c(%rsp), %eax
jge 0xc2d7
movq 0x68(%rbx), %rax
movq 0x930(%rax), %rdi
leaq 0x4(%rsp), %rsi
callq 0xefb8
movl 0x4(%rsp), %edx
movq 0x28(%rax), %rcx
xorl %ebp, %ebp
movq %r12, %rdi
leaq 0x51fa(%rip), %rsi      # 0x1131f
xorl %eax, %eax
callq 0x32d0
leaq 0x51f3(%rip), %rdi      # 0x11326
pushq $0x3
popq %rsi
pushq $0x1
popq %rdx
movq %r12, %rcx
callq 0x3400
cmpb %r14b, %bpl
jg 0xc18c
movsbl %bpl, %eax
movl 0x38(%rbx), %ecx
imull 0x4(%rsp), %ecx
movq 0x28(%rbx), %rdx
addl %eax, %ecx
movslq %ecx, %rcx
movsd (%rdx,%rcx,8), %xmm0
cmpl %eax, 0x8(%rsp)
leaq 0x51ca(%rip), %rdx      # 0x11335
leaq 0x4108(%rip), %rax      # 0x1027a
cmoveq %rax, %rdx
movq %r12, %rdi
leaq 0x51aa(%rip), %rsi      # 0x1132a
movb $0x1, %al
callq 0x32d0
incb %bpl
jmp 0xc141
leaq 0x51a1(%rip), %rdi      # 0x11334
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %r12, %rcx
callq 0x3400
xorl %eax, %eax
cmpb %r14b, %al
jg 0xc223
movl %eax, 0xc(%rsp)
movsbl %al, %r13d
xorl %ebp, %ebp
movl 0x8(%rsp), %r15d
xorl %r13d, %r15d
cmpb %r14b, %bpl
jg 0xc21b
movsbl %bpl, %eax
movq 0x28(%rbx), %rcx
movq 0x68(%rbx), %rdx
movsbl 0x900(%rdx), %edx
movl 0x38(%rbx), %esi
imull 0x4(%rsp), %esi
addl %eax, %esi
addl %edx, %esi
imull %r13d, %edx
addl %edx, %esi
movslq %esi, %rdx
movsd (%rcx,%rdx,8), %xmm0
xorl 0x8(%rsp), %eax
orl %r15d, %eax
leaq 0x513b(%rip), %rdx      # 0x11335
leaq 0x4079(%rip), %rax      # 0x1027a
cmoveq %rax, %rdx
movq %r12, %rdi
leaq 0x511b(%rip), %rsi      # 0x1132a
movb $0x1, %al
callq 0x32d0
incb %bpl
jmp 0xc1ba
movl 0xc(%rsp), %eax
incb %al
jmp 0xc1a3
leaq 0x510d(%rip), %rdi      # 0x11337
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %r12, %rcx
callq 0x3400
xorl %ecx, %ecx
movq 0x30(%rsp), %rax
cmpb %r14b, %cl
jg 0xc2cc
movl %ecx, 0xc(%rsp)
movsbl %cl, %ebp
xorl %r15d, %r15d
movl 0x8(%rsp), %r12d
xorl %ebp, %r12d
cmpb %al, %r15b
jg 0xc2b7
movsbl %r15b, %r13d
movq 0x28(%rbx), %r14
movl 0x4(%rsp), %esi
movq %rbx, %rdi
movl %ebp, %edx
movl %r13d, %ecx
callq 0xa35c
cltq
movsd (%r14,%rax,8), %xmm0
xorl 0x28(%rsp), %r13d
orl %r12d, %r13d
leaq 0x50a6(%rip), %rdx      # 0x11335
leaq 0x3fe4(%rip), %rax      # 0x1027a
cmoveq %rax, %rdx
movq 0x10(%rsp), %rdi
leaq 0x5084(%rip), %rsi      # 0x1132a
movb $0x1, %al
callq 0x32d0
movq 0x30(%rsp), %rax
incb %r15b
jmp 0xc25a
movl 0xc(%rsp), %ecx
incb %cl
movq 0x20(%rsp), %r14
movq 0x10(%rsp), %r12
jmp 0xc23f
movl 0x4(%rsp), %eax
incl %eax
jmp 0xc0ee
movq %r12, %rdi
callq 0x31b0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x9ce3(%rip), %rax      # 0x15fd8
movq (%rax), %rdi
leaq 0x4fe1(%rip), %rsi      # 0x112e0
movq %r12, %rdx
xorl %eax, %eax
callq 0x32d0
pushq $0x1
popq %rdi
callq 0x3240
nop