// File: /workspace/github_cpp_makefile_star2_O1/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 $0xa8, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rax
cmpq %rax, 0x10(%rdi)
je 0xa8a3
leaq 0x20(%rbx), %rcx
movq %rcx, 0x40(%rsp)
xorl %ebp, %ebp
xorl %edx, %edx
movq %rbx, 0x28(%rsp)
movq %rdx, 0x10(%rsp)
movq (%rax,%rdx,8), %r13
testq %r13, %r13
je 0xa905
movq (%r13), %rax
movq %r13, %rdi
callq *0x18(%rax)
testq %rax, %rax
je 0xa881
movq 0x10(%rsp), %rax
leaq 0x1(%rax), %rdx
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %rdx
jae 0xa881
movq %rdx, 0x30(%rsp)
movq (%rax,%rdx,8), %rbx
testq %rbx, %rbx
je 0xa8e6
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
testq %rax, %rax
je 0xa86f
movq (%r13), %rax
movq %r13, %rdi
callq *0x18(%rax)
movq (%rax), %r15
movq (%r13), %rax
movq %r13, %rdi
callq *0x18(%rax)
cmpq 0x8(%rax), %r15
je 0xa86f
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq (%rax), %r12
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
cmpq 0x8(%rax), %r12
je 0xa6d5
movq (%r15), %rax
cmpq (%r12), %rax
je 0xa6d5
addq $0x8, %r12
jmp 0xa6b7
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
cmpq 0x8(%rax), %r12
movq %r15, 0x38(%rsp)
je 0xa861
movq (%r13), %rax
movq %r13, %rdi
callq *0x18(%rax)
movq (%rax), %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
cmpl $0x0, 0x38(%r13)
jle 0xa861
subq (%rax), %r12
subq %r14, %r15
shlq $0x1d, %r15
sarq $0x1d, %r15
movq %r15, 0x48(%rsp)
shlq $0x1d, %r12
sarq $0x1d, %r12
movq %r12, 0x50(%rsp)
movq $0x0, 0x8(%rsp)
cmpl $0x0, 0x38(%rbx)
jle 0xa847
xorl %r14d, %r14d
xorl %r12d, %r12d
movq (%r13), %rax
movq %r13, %r15
movq %r13, %rdi
callq *0x10(%rax)
movq 0xd0(%rax), %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %rax
movq 0x48(%rsp), %rcx
movq (%rax,%rcx), %r13
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0xd0(%rax), %rax
movq (%rax,%r14), %rax
movq 0x50(%rsp), %rcx
cmpq (%rax,%rcx), %r13
je 0xa830
movl $0x0, 0x60(%rsp)
movq $0x0, 0x68(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, 0x70(%rsp)
movq %rax, 0x78(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movb $0x0, 0x40(%rax)
movq %r15, 0x18(%rsp)
movq 0x8(%rsp), %rax
movl %eax, 0x20(%rsp)
leaq 0x58(%rsp), %r13
movq %r13, %rdi
leaq 0x18(%rsp), %rbp
movq %rbp, %rsi
callq 0x7510
movq %rbx, 0x18(%rsp)
movl %r12d, 0x20(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x7510
movq 0x40(%rsp), %rdi
movq %r13, %rsi
callq 0x8066
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0xa825
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x53e0
movq %r13, %rdi
callq 0x791a
movb $0x1, %bpl
incq %r12
movslq 0x38(%rbx), %rax
addq $0x18, %r14
cmpq %rax, %r12
movq %r15, %r13
jl 0xa747
movq 0x8(%rsp), %rdx
incq %rdx
movslq 0x38(%r13), %rax
movq %rdx, 0x8(%rsp)
cmpq %rax, %rdx
jl 0xa737
movq 0x38(%rsp), %r15
addq $0x8, %r15
jmp 0xa697
movq 0x30(%rsp), %rdx
incq %rdx
movq 0x28(%rsp), %rbx
jmp 0xa64e
movq 0x10(%rsp), %rdx
incq %rdx
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %rdx
jb 0xa620
jmp 0xa8a5
xorl %ebp, %ebp
movq %rbx, %r14
movq 0x38(%rbx), %rbx
addq $0x28, %r14
cmpq %r14, %rbx
je 0xa8ce
leaq 0x20(%rbx), %rdi
callq 0x8cca
movq %rbx, %rdi
callq 0x54b0
movq %rax, %rbx
cmpq %r14, %rax
jne 0xa8b5
andb $0x1, %bpl
movl %ebp, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1beda(%rip), %rdi     # 0x267c7
leaq 0x1bd49(%rip), %rsi     # 0x2663d
leaq 0x1be96(%rip), %rcx     # 0x26791
movl $0x25e, %edx            # imm = 0x25E
callq 0x52c0
leaq 0x1be82(%rip), %rdi     # 0x2678e
leaq 0x1bd2a(%rip), %rsi     # 0x2663d
leaq 0x1be77(%rip), %rcx     # 0x26791
movl $0x258, %edx            # imm = 0x258
callq 0x52c0
jmp 0xa928
jmp 0xa928
movq %rax, %rbx
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0xa948
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x53e0
leaq 0x58(%rsp), %rdi
callq 0x791a
movq %rbx, %rdi
callq 0x56a0