// File: /workspace/github_cpp_makefile_star2_O1/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 $0x48, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x68(%rdi), %rax
movsbl 0x900(%rax), %ecx
movq %rcx, 0x38(%rsp)
movsbl 0x901(%rax), %r12d
movl 0x904(%rax), %eax
movl %eax, 0x2c(%rsp)
leaq 0x4e8b(%rip), %rsi      # 0x1223e
movq %r15, %rdi
callq 0x2230
testq %rax, %rax
je 0xd778
movq %rax, %r14
movq 0x68(%rbx), %rsi
movq %rax, %rdi
callq 0x7362
leaq 0x4e88(%rip), %rdi      # 0x12262
movl $0x12, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x23d0
movq %r12, 0x30(%rsp)
testb %r12b, %r12b
jle 0xd43e
movq 0x30(%rsp), %rax
leal -0x1(%rax), %r12d
movslq %eax, %r13
xorl %ebp, %ebp
leaq 0x4e6a(%rip), %r15      # 0x12275
movq 0x10(%rbx), %rax
movsd (%rax,%rbp,8), %xmm0
cmpq %rbp, %r12
leaq 0x4e77(%rip), %rdx      # 0x12295
leaq 0x3e55(%rip), %rax      # 0x1127a
cmoveq %rax, %rdx
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x22b0
incq %rbp
cmpq %rbp, %r13
jne 0xd40b
movq %rbx, 0x10(%rsp)
movq %r14, 0x20(%rsp)
cmpl $0x0, 0x2c(%rsp)
movq 0x38(%rsp), %r15
jle 0xd760
leal -0x1(%r15), %ebp
movq 0x30(%rsp), %rax
decl %eax
movl %eax, 0x44(%rsp)
xorl %edx, %edx
movl %ebp, 0xc(%rsp)
movq 0x10(%rsp), %rax
movq 0x68(%rax), %rax
movq 0x930(%rax), %rax
movq 0x10(%rax), %rdi
addq $0x8, %rax
movq %rax, %rcx
testq %rdi, %rdi
je 0xd4a7
movq %rax, %rcx
xorl %esi, %esi
cmpl %edx, 0x20(%rdi)
setl %sil
cmovgeq %rdi, %rcx
movq 0x10(%rdi,%rsi,8), %rdi
testq %rdi, %rdi
jne 0xd490
cmpq %rax, %rcx
je 0xd4b3
cmpl 0x20(%rcx), %edx
cmovgeq %rcx, %rax
movq 0x20(%rsp), %r12
movq 0x28(%rax), %rcx
movq %r12, %rdi
leaq 0x4db9(%rip), %rsi      # 0x1227f
xorl %eax, %eax
movl %edx, 0x4(%rsp)
callq 0x22b0
movl $0x3, %esi
movl $0x1, %edx
leaq 0x4da4(%rip), %rdi      # 0x12286
movq %r12, %rcx
callq 0x23d0
testb %r15b, %r15b
movq 0x10(%rsp), %rax
movq %r12, %r8
leaq 0x4d99(%rip), %r12      # 0x12295
leaq 0x4d87(%rip), %rsi      # 0x1228a
leaq 0x3d70(%rip), %r13      # 0x1127a
js 0xd565
movl %ebp, %edi
xorl %ebp, %ebp
movsbl %bpl, %ebp
movq 0x28(%rax), %rax
movq 0x10(%rsp), %rcx
movl 0x38(%rcx), %ecx
imull 0x4(%rsp), %ecx
addl %ebp, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
cmpl %ebp, %edi
movq %r12, %rdx
cmoveq %r13, %rdx
movq %r8, %rdi
movb $0x1, %al
movq %r8, %rbx
movq %r15, %r14
movq %rsi, %r15
callq 0x22b0
movq 0x10(%rsp), %rax
movq %r15, %rsi
movq %r14, %r15
movl 0xc(%rsp), %edi
movq %rbx, %r8
incb %bpl
cmpb %r15b, %bpl
jle 0xd510
movl $0x2, %esi
movl $0x1, %edx
leaq 0x4d1e(%rip), %rdi      # 0x12294
movq %r8, %rcx
callq 0x23d0
testb %r15b, %r15b
js 0xd631
movl $0x0, 0x8(%rsp)
xorl %eax, %eax
movl %eax, 0x1c(%rsp)
xorl %ebp, %ebp
movl 0xc(%rsp), %r13d
xorl 0x8(%rsp), %r13d
movq 0x20(%rsp), %r12
movq 0x10(%rsp), %r15
leaq 0x3cc8(%rip), %r14      # 0x1127a
movl 0x4(%rsp), %ebx
movsbl %bpl, %ebp
movq 0x28(%r15), %rax
movq 0x68(%r15), %rcx
movsbl 0x900(%rcx), %ecx
movl 0x38(%r15), %edx
imull %ebx, %edx
movl 0x8(%rsp), %esi
imull %ecx, %esi
addl %ebp, %edx
addl %ecx, %edx
addl %esi, %edx
movslq %edx, %rcx
movsd (%rax,%rcx,8), %xmm0
movl 0xc(%rsp), %eax
xorl %ebp, %eax
orl %r13d, %eax
leaq 0x4ca0(%rip), %rdx      # 0x12295
cmoveq %r14, %rdx
movq %r12, %rdi
leaq 0x4c87(%rip), %rsi      # 0x1228a
movb $0x1, %al
callq 0x22b0
incb %bpl
cmpb 0x38(%rsp), %bpl
jle 0xd5b6
movl 0x1c(%rsp), %eax
incb %al
movsbl %al, %ecx
movl %ecx, 0x8(%rsp)
movq 0x38(%rsp), %rdx
cmpb %dl, %cl
movq %rdx, %r15
jle 0xd591
movl $0x2, %esi
movl $0x1, %edx
leaq 0x4c55(%rip), %rdi      # 0x12297
movq 0x20(%rsp), %rcx
callq 0x23d0
testb %r15b, %r15b
movq 0x30(%rsp), %rcx
movq 0x10(%rsp), %rdx
js 0xd74c
xorl %r8d, %r8d
xorl %eax, %eax
movl %eax, 0x1c(%rsp)
testb %cl, %cl
movq 0x20(%rsp), %r12
movl 0x44(%rsp), %ebp
leaq 0x3c00(%rip), %r11      # 0x1127a
leaq 0x4c14(%rip), %rbx      # 0x12295
leaq 0x4c02(%rip), %r14      # 0x1228a
movl 0x4(%rsp), %r9d
js 0xd734
xorl %r13d, %r13d
movl 0xc(%rsp), %eax
xorl %r8d, %eax
movl %eax, 0x8(%rsp)
movsbl %r13b, %r13d
movq 0x28(%rdx), %rax
movq 0x68(%rdx), %rcx
movsbl 0x900(%rcx), %edx
movsbl 0x901(%rcx), %ecx
movq 0x10(%rsp), %rsi
movl 0x38(%rsi), %esi
imull %r9d, %esi
leal 0x1(%rdx), %r9d
imull %edx, %r9d
imull %r8d, %ecx
addl %r13d, %esi
addl %ecx, %esi
addl %r9d, %esi
movslq %esi, %rcx
movsd (%rax,%rcx,8), %xmm0
movl %ebp, %eax
xorl %r13d, %eax
orl 0x8(%rsp), %eax
movq %rbx, %rdx
cmoveq %r11, %rdx
movq %r12, %rdi
movq %r14, %rsi
movb $0x1, %al
movl %r8d, %r15d
movq %rbx, %r14
movq %r11, %rbx
callq 0x22b0
movl 0x4(%rsp), %r9d
movq 0x10(%rsp), %rdx
movq %rbx, %r11
movq %r14, %rbx
leaq 0x4b6a(%rip), %r14      # 0x1228a
movl %r15d, %r8d
movq 0x30(%rsp), %rcx
incb %r13b
cmpb %cl, %r13b
jle 0xd6a1
movl 0x1c(%rsp), %eax
incb %al
movsbl %al, %r8d
movq 0x38(%rsp), %r15
cmpb %r15b, %r8b
jle 0xd664
movl 0x4(%rsp), %edx
incl %edx
cmpl 0x2c(%rsp), %edx
movl 0xc(%rsp), %ebp
jne 0xd46d
movq 0x20(%rsp), %rdi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21b0
movq %r15, %rdi
callq 0x2ada