// File: 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
movq %rsp, %rbp
subq $0x210, %rsp            # imm = 0x210
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x198(%rbp)
movb $0x0, -0x9(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x198(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x1a0(%rbp)
callq 0x1c780
movq %rax, %rdi
callq 0x8fd0
movq %rax, %rcx
movq -0x1a0(%rbp), %rax
cmpq %rcx, %rax
jae 0x188b5
movq -0x198(%rbp), %rdi
callq 0x1c780
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x1c7a0
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x18380
jmp 0x1839f
leaq 0x4c40b(%rip), %rdi     # 0x64792
leaq 0x4c2b3(%rip), %rsi     # 0x64641
movl $0x258, %edx            # imm = 0x258
leaq 0x4c3fb(%rip), %rcx     # 0x64795
callq 0x7450
xorl %eax, %eax
cmpq -0x20(%rbp), %rax
je 0x183bb
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x183c0
jmp 0x188a4
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x198(%rbp), %rdi
movq -0x28(%rbp), %rax
movq %rax, -0x1a8(%rbp)
callq 0x1c780
movq %rax, %rdi
callq 0x8fd0
movq %rax, %rcx
movq -0x1a8(%rbp), %rax
cmpq %rcx, %rax
jae 0x188a2
movq -0x198(%rbp), %rdi
callq 0x1c780
movq %rax, %rdi
movq -0x28(%rbp), %rsi
callq 0x1c7a0
movq (%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x18426
jmp 0x18445
leaq 0x4c39e(%rip), %rdi     # 0x647cb
leaq 0x4c20d(%rip), %rsi     # 0x64641
movl $0x25e, %edx            # imm = 0x25E
leaq 0x4c355(%rip), %rcx     # 0x64795
callq 0x7450
xorl %eax, %eax
cmpq -0x30(%rbp), %rax
je 0x18461
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x18466
jmp 0x18891
leaq -0x38(%rbp), %rdi
callq 0x1c7c0
leaq -0x40(%rbp), %rdi
callq 0x1c7c0
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %rax, %rdi
callq 0x8c90
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %rax, %rdi
callq 0x8cc0
movq %rax, -0x50(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x8cf0
testb $0x1, %al
jne 0x184c2
jmp 0x1888f
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %rax, %rdi
callq 0x8c90
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %rax, %rdi
callq 0x8cc0
movq %rax, -0x60(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x8cf0
testb $0x1, %al
jne 0x18509
jmp 0x18543
leaq -0x38(%rbp), %rdi
callq 0x8d30
movq (%rax), %rax
movq %rax, -0x1b0(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x8d30
movq %rax, %rcx
movq -0x1b0(%rbp), %rax
cmpq (%rcx), %rax
jne 0x18536
jmp 0x18543
jmp 0x18538
leaq -0x40(%rbp), %rdi
callq 0x8d70
jmp 0x184e0
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %rax, %rdi
callq 0x8cc0
movq %rax, -0x68(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x8ff0
testb $0x1, %al
jne 0x1856c
jmp 0x18571
jmp 0x18881
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %rax, %rdi
callq 0x8c90
movq %rax, -0x78(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x1b770
movl %eax, -0x6c(%rbp)
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %rax, %rdi
callq 0x8c90
movq %rax, -0x90(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0x1b770
movl %eax, -0x84(%rbp)
movl $0x0, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
movl %eax, -0x1b4(%rbp)
movq -0x20(%rbp), %rdi
callq 0x8eb0
movl %eax, %ecx
movl -0x1b4(%rbp), %eax
cmpl %ecx, %eax
jge 0x1887f
movl $0x0, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
movl %eax, -0x1b8(%rbp)
movq -0x30(%rbp), %rdi
callq 0x8eb0
movl %eax, %ecx
movl -0x1b8(%rbp), %eax
cmpl %ecx, %eax
jge 0x18869
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, %rdi
callq 0x1c890
movq %rax, %rdi
movslq -0x9c(%rbp), %rsi
callq 0x1c6c0
movq %rax, %rdi
movslq -0x6c(%rbp), %rsi
callq 0x1c6e0
movq (%rax), %rax
movq %rax, -0x1c0(%rbp)
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, %rdi
callq 0x1c890
movq %rax, %rdi
movslq -0xa0(%rbp), %rsi
callq 0x1c6c0
movq %rax, %rdi
movslq -0x84(%rbp), %rsi
callq 0x1c6e0
movq %rax, %rcx
movq -0x1c0(%rbp), %rax
cmpq (%rcx), %rax
je 0x18853
leaq -0xf0(%rbp), %rdi
callq 0xb6c0
leaq -0x20(%rbp), %rdi
leaq -0x9c(%rbp), %rsi
callq 0x1ca40
movl %edx, -0x1cc(%rbp)
movq %rax, -0x1c8(%rbp)
jmp 0x186df
movl -0x1cc(%rbp), %eax
movq -0x1c8(%rbp), %rcx
movq %rcx, -0x120(%rbp)
movl %eax, -0x118(%rbp)
movl -0x118(%rbp), %eax
movl %eax, -0xf8(%rbp)
movq -0x120(%rbp), %rax
movq %rax, -0x100(%rbp)
leaq -0xf0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xd9b0
movb %dl, -0x1d9(%rbp)
movq %rax, -0x1d8(%rbp)
jmp 0x18735
movb -0x1d9(%rbp), %al
movq -0x1d8(%rbp), %rcx
movq %rcx, -0x130(%rbp)
movb %al, -0x128(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x1ca40
movl %edx, -0x1ec(%rbp)
movq %rax, -0x1e8(%rbp)
jmp 0x1876e
movl -0x1ec(%rbp), %eax
movq -0x1e8(%rbp), %rcx
movq %rcx, -0x150(%rbp)
movl %eax, -0x148(%rbp)
movl -0x148(%rbp), %eax
movl %eax, -0x138(%rbp)
movq -0x150(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq -0xf0(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0xd9b0
movb %dl, -0x1f9(%rbp)
movq %rax, -0x1f8(%rbp)
jmp 0x187c4
movq -0x198(%rbp), %rdi
movb -0x1f9(%rbp), %al
movq -0x1f8(%rbp), %rcx
movq %rcx, -0x160(%rbp)
movb %al, -0x158(%rbp)
addq $0x20, %rdi
leaq -0xf0(%rbp), %rsi
callq 0xaba0
movb %dl, -0x209(%rbp)
movq %rax, -0x208(%rbp)
jmp 0x18804
movb -0x209(%rbp), %al
movq -0x208(%rbp), %rcx
movq %rcx, -0x170(%rbp)
movb %al, -0x168(%rbp)
movb $0x1, -0x9(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0xbc70
jmp 0x18853
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0xbc70
jmp 0x18941
jmp 0x18855
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
jmp 0x18615
jmp 0x1886b
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x185e6
jmp 0x18881
leaq -0x38(%rbp), %rdi
callq 0x8d70
jmp 0x18496
jmp 0x18891
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x183cc
jmp 0x188a4
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x18326
movq -0x198(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x178(%rbp)
movq -0x178(%rbp), %rdi
callq 0xaf20
movq %rax, -0x180(%rbp)
movq -0x178(%rbp), %rdi
callq 0xab70
movq %rax, -0x188(%rbp)
leaq -0x180(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0xaf50
testb $0x1, %al
jne 0x18906
jmp 0x18933
leaq -0x180(%rbp), %rdi
callq 0xafa0
movq %rax, -0x190(%rbp)
movq -0x190(%rbp), %rdi
callq 0x14ec0
leaq -0x180(%rbp), %rdi
callq 0xb000
jmp 0x188ed
movb -0x9(%rbp), %al
andb $0x1, %al
addq $0x210, %rsp            # imm = 0x210
popq %rbp
retq
movq -0x108(%rbp), %rdi
callq 0x79d0
nopl (%rax)