// File: /workspace/github_cpp_makefile_star2_O2/WShabti-Team[P]WShabtiPict/wshabtilib/api/model.cpp
// Function: pictcore::Model::excludeConflictingParamValues()
bool Model::excludeConflictingParamValues()
{
    bool ret = false;
    // for each pair of submodels (pseudoparams)
    for( size_t pseudo1 = 0; pseudo1 < GetParameters().size(); ++pseudo1 )
    {
        Parameter* s1 = GetParameters()[ pseudo1 ];
        assert( s1 );
        if( NULL == s1 || NULL == s1->GetComponents() ) continue;

        for( size_t pseudo2 = pseudo1 + 1; pseudo2 < GetParameters().size(); ++pseudo2 )
        {
            Parameter* s2 = GetParameters()[ pseudo2 ];
            assert( s2 );
            if( NULL == s2 || NULL == s2->GetComponents() ) continue;

            // for each param p1 in s1
            ParamCollection::iterator p1;
            ParamCollection::iterator p2;
            for( p1 = s1->GetComponents()->begin(); p1 != s1->GetComponents()->end(); ++p1 )
            {
                // find corresponsing param p2 in s2 by name
                for( p2 = s2->GetComponents()->begin(); p2 != s2->GetComponents()->end(); ++p2 )
                {
                    // compare by name, names are unique
                    if( *p1 == *p2 ) break;
                }

                // if p2 does not exist, continue
                if( p2 == s2->GetComponents()->end() ) continue;

                int np1 = static_cast<int>( distance( s1->GetComponents()->begin(), p1 ) );
                int np2 = static_cast<int>( distance( s2->GetComponents()->begin(), p2 ) );

                // for each row r1 in s1
                //     for each row r2 in s2
                for( int v1 = 0; v1 < s1->GetValueCount(); ++v1 )
                {
                    for( int v2 = 0; v2 < s2->GetValueCount(); ++v2 )
                    {
                        // if r1.p1 != r2.p2
                        //     add r1, r2 to exlusions  
                        if( s1->GetModel()->GetResults()[ v1 ][ np1 ] !=
                            s2->GetModel()->GetResults()[ v2 ][ np2 ] )
                        {
                            Exclusion excl;
                            excl.insert( make_pair( s1, v1 ) );
                            excl.insert( make_pair( s2, v2 ) );
                            m_exclusions.insert( excl );

                            ret = true;
                        }
                    }
                }
            }
        }
    }

    DOUT( L"-- exclusions for submodels -- size: " << (int) m_exclusions.size() << endl );
    for( auto & exclusion : m_exclusions )
    {
        exclusion.Print();
    }
    DOUT( L"------------------------------ " << endl );

    return( ret );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, 0x10(%rsp)
leaq 0x20(%rdi), %rax
movq %rax, 0x50(%rsp)
xorl %ebx, %ebx
leaq 0x68(%rsp), %r13
leaq 0x30(%rsp), %rbp
movq $0x0, 0x28(%rsp)
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rax
movq 0x10(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %rbx
jae 0xb09e
movq (%rax,%rbx,8), %r15
testq %r15, %r15
je 0xb0fe
movq (%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
testq %rax, %rax
je 0xb096
movq %rbx, 0x40(%rsp)
movq %rbx, %r14
movq %r14, %rcx
leaq 0x1(%rcx), %r14
movq 0x10(%rsp), %rdx
movq 0x8(%rdx), %rax
movq 0x10(%rdx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rdx, %r14
jae 0xb091
movq 0x8(%rax,%rcx,8), %rbx
testq %rbx, %rbx
je 0xb0df
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq %r14, %rcx
testq %rax, %rax
je 0xae69
movq (%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
movq (%rax), %r12
movq %r15, 0x18(%rsp)
movq %r14, 0x48(%rsp)
movq (%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
cmpq 0x8(%rax), %r12
je 0xae66
movq %r12, 0x8(%rsp)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq (%rax), %r15
movq %r15, %r14
shlq $0x1d, %r14
negq %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
cmpq 0x8(%rax), %r15
je 0xaf18
movq 0x8(%rsp), %rax
movq (%rax), %rax
cmpq (%r15), %rax
je 0xaf18
addq $0x8, %r15
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rax, %r14
jmp 0xaee9
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
cmpq 0x8(%rax), %r15
je 0xb079
movq 0x18(%rsp), %r15
movq (%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
movq 0x8(%rsp), %r12
subq (%rax), %r12
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq (%rax), %rax
shlq $0x1d, %r12
sarq $0x1d, %r12
movq %r12, 0x60(%rsp)
shlq $0x1d, %rax
addq %r14, %rax
negq %rax
sarq $0x1d, %rax
movq %rax, 0x58(%rsp)
xorl %ecx, %ecx
movslq 0x38(%r15), %rax
cmpq %rax, %rcx
jge 0xb07e
movq %rcx, 0x20(%rsp)
xorl %r14d, %r14d
xorl %r12d, %r12d
movslq 0x38(%rbx), %rax
cmpq %rax, %r12
jge 0xb06c
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
movq 0xd0(%rax), %rax
imulq $0x18, 0x20(%rsp), %rcx
movq (%rax,%rcx), %rax
movq %rbp, %r15
movq %r13, %rbp
movq 0x60(%rsp), %rcx
movq (%rax,%rcx), %r13
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0xd0(%rax), %rax
movq (%rax,%r14), %rax
movq 0x58(%rsp), %rcx
cmpq (%rax,%rcx), %r13
movq %rbp, %r13
movq %r15, %rbp
movq 0x18(%rsp), %r15
je 0xb060
andl $0x0, 0x70(%rsp)
andq $0x0, 0x78(%rsp)
leaq 0x70(%rsp), %rax
movq %rax, 0x80(%rsp)
movq %rax, 0x88(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movb $0x0, 0x40(%rax)
movq %r15, 0x30(%rsp)
movq 0x20(%rsp), %rax
movl %eax, 0x38(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x7fda
movq %rbx, 0x30(%rsp)
movl %r12d, 0x38(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x7fda
movq 0x50(%rsp), %rdi
movq %r13, %rsi
callq 0x8af8
movq %r13, %rdi
callq 0x7b50
movb $0x1, %al
movq %rax, 0x28(%rsp)
incq %r12
addq $0x18, %r14
jmp 0xaf87
movq 0x20(%rsp), %rcx
incq %rcx
jmp 0xaf6f
movq 0x18(%rsp), %r15
movq 0x8(%rsp), %r12
addq $0x8, %r12
movq 0x48(%rsp), %r14
jmp 0xaebf
movq 0x40(%rsp), %rbx
incq %rbx
jmp 0xae22
movq 0x10(%rsp), %r14
movq 0x38(%r14), %rbx
addq $0x28, %r14
cmpq %r14, %rbx
je 0xb0c6
leaq 0x20(%rbx), %rdi
callq 0x9ac2
movq %rbx, %rdi
callq 0x6500
movq %rax, %rbx
jmp 0xb0ab
movq 0x28(%rsp), %rax
andb $0x1, %al
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x176d9(%rip), %rdi     # 0x227bf
leaq 0x17548(%rip), %rsi     # 0x22635
leaq 0x17695(%rip), %rcx     # 0x22789
movl $0x25e, %edx            # imm = 0x25E
callq 0x6310
leaq 0x17681(%rip), %rdi     # 0x22786
leaq 0x17529(%rip), %rsi     # 0x22635
leaq 0x17676(%rip), %rcx     # 0x22789
movl $0x258, %edx            # imm = 0x258
callq 0x6310
jmp 0xb121
jmp 0xb121
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x7b50
movq %rbx, %rdi
callq 0x66e0