// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemSt.cpp
// Function: HMMProblemSt::toFileSkill(char const*)
void HMMProblemSt::toFileSkill(const char *filename) {
    NPAR nS = this->task->nS, nO = this->task->nO;
    NCAT nK = this->task->nK;
	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==(this->task->nO-1))?"\n":"\t");
    
	NCAT k;
	std::map<NCAT,std::string>::iterator it;
	for(k=0;k<nK;k++) {
		it = this->task->map_skill_bwd->find(k);
		fprintf(fid,"%d\t%s\n",k,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(k,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(k,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(k,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 $0x58, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x68(%rdi), %rax
movsbl 0x900(%rax), %ecx
movl %ecx, 0x18(%rsp)
movzbl 0x901(%rax), %r14d
movl 0x908(%rax), %eax
movl %eax, 0x1c(%rsp)
leaq 0x6226(%rip), %rsi      # 0x1332a
movq %r15, %rdi
callq 0x2230
testq %rax, %rax
je 0xd4e1
movq %rax, %r13
movq 0x68(%rbx), %rsi
movq %rax, %rdi
callq 0x7418
leaq 0x6223(%rip), %rdi      # 0x1334e
movl $0x12, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x23d0
leaq 0x5136(%rip), %r12      # 0x1227a
leaq 0x6236(%rip), %rbp      # 0x13381
testb %r14b, %r14b
movq %r14, %r15
jle 0xd190
xorl %r14d, %r14d
movq 0x10(%rbx), %rax
movq 0x68(%rbx), %rcx
movsd (%rax,%r14,8), %xmm0
movsbl 0x901(%rcx), %eax
decl %eax
cmpl %eax, %r14d
movq %rbp, %rdx
cmoveq %r12, %rdx
movq %r13, %rdi
leaq 0x61e0(%rip), %rsi      # 0x13361
movb $0x1, %al
callq 0x22b0
incq %r14
cmpq %r14, %r15
jne 0xd156
cmpl $0x0, 0x1c(%rsp)
movq %r15, 0x28(%rsp)
jle 0xd4cb
movl 0x18(%rsp), %eax
movzbl %al, %ecx
movl %ecx, 0xc(%rsp)
cltq
movsbl 0x28(%rsp), %ecx
leal -0x1(%rax), %edx
leal -0x1(%rcx), %esi
movl %esi, 0x20(%rsp)
movl $0xff, %esi
andl %esi, %ecx
leaq -0x1(%rax), %rdi
movq %rdi, 0x38(%rsp)
movq %rax, 0x30(%rsp)
andl %eax, %esi
movq %rsi, 0x40(%rsp)
xorl %ebp, %ebp
movq %r13, 0x10(%rsp)
movq %rcx, 0x50(%rsp)
movl %edx, 0x8(%rsp)
movq %rbx, 0x48(%rsp)
movq 0x68(%rbx), %rax
movq 0x950(%rax), %rax
movq 0x10(%rax), %rcx
addq $0x8, %rax
testq %rcx, %rcx
je 0xd22b
movq %rax, %rdx
xorl %esi, %esi
cmpl %ebp, 0x20(%rcx)
setl %sil
cmovgeq %rcx, %rdx
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0xd208
cmpq %rax, %rdx
je 0xd22b
cmpl 0x20(%rdx), %ebp
cmovgeq %rdx, %rax
movq 0x28(%rax), %rcx
movq %r13, %rdi
leaq 0x6132(%rip), %rsi      # 0x1336b
movl %ebp, %edx
xorl %eax, %eax
callq 0x22b0
movl $0x3, %esi
movl $0x1, %edx
leaq 0x611f(%rip), %rdi      # 0x13372
movq %r13, %rcx
callq 0x23d0
cmpb $0x0, 0xc(%rsp)
movl %ebp, 0x4(%rsp)
jle 0xd484
movslq %ebp, %r14
xorl %r15d, %r15d
movq 0x40(%rsp), %r13
movq 0x38(%rsp), %r12
leaq 0x60f5(%rip), %rbp      # 0x13376
movq 0x28(%rbx), %rax
movslq 0x38(%rbx), %rcx
imulq %r14, %rcx
addq %r15, %rcx
movsd (%rax,%rcx,8), %xmm0
cmpl %r15d, %r12d
leaq 0x60e2(%rip), %rdx      # 0x13381
leaq 0x4fd4(%rip), %rax      # 0x1227a
cmoveq %rax, %rdx
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
movb $0x1, %al
callq 0x22b0
incq %r15
cmpl %r15d, %r13d
jne 0xd281
movl $0x2, %esi
movl $0x1, %edx
leaq 0x60ae(%rip), %rdi      # 0x13380
movq 0x10(%rsp), %r13
movq %r13, %rcx
callq 0x23d0
cmpb $0x0, 0x18(%rsp)
jle 0xd49d
xorl %ecx, %ecx
movl $0x1, %r13d
movl 0x8(%rsp), %esi
movl %esi, %r15d
movl %ecx, 0x24(%rsp)
xorl %ecx, %r15d
xorl %r14d, %r14d
movq 0x10(%rsp), %rbp
movl 0x4(%rsp), %r12d
movq 0x28(%rbx), %rax
movq 0x68(%rbx), %rcx
movsbl 0x900(%rcx), %ecx
movl 0x38(%rbx), %edx
imull %r12d, %edx
imull %r13d, %ecx
addl %r14d, %edx
addl %ecx, %edx
movslq %edx, %rcx
movsd (%rax,%rcx,8), %xmm0
movl %esi, %eax
xorl %r14d, %eax
orl %r15d, %eax
leaq 0x603e(%rip), %rdx      # 0x13381
leaq 0x4f30(%rip), %rax      # 0x1227a
cmoveq %rax, %rdx
movq %rbp, %rdi
leaq 0x601e(%rip), %rsi      # 0x13376
movb $0x1, %al
callq 0x22b0
movl 0x8(%rsp), %esi
movl 0xc(%rsp), %eax
incl %r14d
cmpl %r14d, %eax
jne 0xd30d
movl 0x24(%rsp), %ecx
incl %ecx
incl %r13d
cmpl %eax, %ecx
jne 0xd2f6
movl $0x2, %esi
movl $0x1, %edx
leaq 0x5ff2(%rip), %rdi      # 0x13383
movq 0x10(%rsp), %rcx
callq 0x23d0
movl 0x8(%rsp), %edx
cmpb $0x0, 0x30(%rsp)
leaq 0x5fd6(%rip), %r8       # 0x13381
jle 0xd4b6
xorl %r14d, %r14d
cmpb $0x0, 0x28(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x4eb5(%rip), %r10      # 0x1227a
movl 0x20(%rsp), %r13d
leaq 0x5fa5(%rip), %rbp      # 0x13376
movl 0x4(%rsp), %r12d
jle 0xd474
xorl %r15d, %r15d
movl %edx, %eax
xorl %r14d, %eax
movq 0x28(%rbx), %rcx
movq 0x68(%rbx), %rdx
movsbl 0x900(%rdx), %esi
movsbl 0x901(%rdx), %edx
leal 0x1(%rsi), %r9d
imull %esi, %r9d
movl 0x38(%rbx), %esi
imull %r12d, %esi
imull %r14d, %edx
addl %esi, %edx
addl %r9d, %edx
addl %r15d, %edx
movslq %edx, %rdx
movsd (%rcx,%rdx,8), %xmm0
movl %r13d, %ecx
xorl %r15d, %ecx
orl %eax, %ecx
movq %r8, %rdx
cmoveq %r10, %rdx
movq %rbp, %rsi
movb $0x1, %al
movl %r14d, %ebx
movq %r8, %r14
movq %rdi, %r12
movq %r10, %rbp
callq 0x22b0
movq %rbp, %r10
movq %r12, %rdi
movl 0x4(%rsp), %r12d
leaq 0x5f22(%rip), %rbp      # 0x13376
movq %r14, %r8
movl %ebx, %r14d
movq 0x48(%rsp), %rbx
movl 0x8(%rsp), %edx
movq 0x50(%rsp), %rcx
incl %r15d
cmpl %r15d, %ecx
jne 0xd3df
incl %r14d
cmpl 0xc(%rsp), %r14d
jne 0xd3b4
jmp 0xd4b6
movl $0x2, %esi
movl $0x1, %edx
leaq 0x5eeb(%rip), %rdi      # 0x13380
movq %r13, %rcx
callq 0x23d0
movl $0x2, %esi
movl $0x1, %edx
leaq 0x5ed5(%rip), %rdi      # 0x13383
movq %r13, %rcx
callq 0x23d0
movl 0x4(%rsp), %ebp
incl %ebp
cmpl 0x1c(%rsp), %ebp
movq 0x10(%rsp), %r13
jne 0xd1ed
movq %r13, %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21b0
movq %r15, %rdi
callq 0x2b04
nop