// File: myudelson[P]hmm-scalable/HMMProblem.cpp
// Function: HMMProblem::checkConvergenceBig0(FitBit**, int, double, double*)
bool HMMProblem::checkConvergenceBig0(FitBit** fbs, NCAT nfbs, NUMBER tol, NUMBER *criterion) {
    for(NCAT x=0; x<nfbs; x++)
    {
        for(NPAR i=0; i<fbs[x]->nS; i++)
        {
            if(fbs[x]->pi != NULL) *criterion += pow( fbs[x]->pi[i]-fbs[x]->PIm1[i], 2 )/*:0*/;
            for(NPAR j=0; (fbs[x]->A != NULL) && j<fbs[x]->nS; j++) {
                *criterion += pow(fbs[x]->A[i][j] - fbs[x]->Am1[i][j],2);
            }
            for(NPAR k=0; (fbs[x]->B != NULL) && k<fbs[x]->nO; k++) {
                *criterion += pow(fbs[x]->B[i][k] - fbs[x]->Bm1[i][k],2);
            }
        }
    }
    *criterion = sqrt(*criterion);
	return (*criterion) < tol; // double the truth or false
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movsd %xmm0, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x27b5e
movb $0x0, -0x2d(%rbp)
movsbl -0x2d(%rbp), %eax
movq -0x10(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movsbl 0x1(%rcx), %ecx
cmpl %ecx, %eax
jge 0x27b4e
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x10(%rax)
je 0x279ec
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movsbq -0x2d(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x28(%rax), %rax
movsbq -0x2d(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm0
movl $0x2, %edi
callq 0xf6b0
movq -0x28(%rbp), %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movb $0x0, -0x2e(%rbp)
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
xorl %eax, %eax
cmpq $0x0, 0x18(%rcx)
movb %al, -0x30(%rbp)
je 0x27a24
movsbl -0x2e(%rbp), %eax
movq -0x10(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movsbl 0x1(%rcx), %ecx
cmpl %ecx, %eax
setl %al
movb %al, -0x30(%rbp)
movb -0x30(%rbp), %al
testb $0x1, %al
jne 0x27a2d
jmp 0x27a96
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movsbq -0x2d(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x2e(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x30(%rax), %rax
movsbq -0x2d(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x2e(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm0
movl $0x2, %edi
callq 0xf6b0
movq -0x28(%rbp), %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movb -0x2e(%rbp), %al
addb $0x1, %al
movb %al, -0x2e(%rbp)
jmp 0x279f0
movb $0x0, -0x2f(%rbp)
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
xorl %eax, %eax
cmpq $0x0, 0x20(%rcx)
movb %al, -0x31(%rbp)
je 0x27acd
movsbl -0x2f(%rbp), %eax
movq -0x10(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
setl %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x27ad6
jmp 0x27b3f
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x20(%rax), %rax
movsbq -0x2d(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x2f(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x38(%rax), %rax
movsbq -0x2d(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x2f(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm0
movl $0x2, %edi
callq 0xf6b0
movq -0x28(%rbp), %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movb -0x2f(%rbp), %al
addb $0x1, %al
movb %al, -0x2f(%rbp)
jmp 0x27a9a
jmp 0x27b41
movb -0x2d(%rbp), %al
addb $0x1, %al
movb %al, -0x2d(%rbp)
jmp 0x27973
jmp 0x27b50
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x27963
movq -0x28(%rbp), %rax
movsd (%rax), %xmm0
callq 0x5220
movq -0x28(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x28(%rbp), %rax
movsd (%rax), %xmm1
movsd -0x20(%rbp), %xmm0
ucomisd %xmm1, %xmm0
seta %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nop