// File: WShabti-Team[P]WShabtiPict/wshabtilib/api/model.cpp
// Function: pictcore::Model::mapRowSeedsToPseudoParameters()
void Model::mapRowSeedsToPseudoParameters()
{
    // for each pseudoparameter
    for( size_t index = 0; index < GetParameters().size(); ++index )
    {
        Parameter* param = GetParameters()[ index ];
        vector<Parameter*>* comps = param->GetComponents();
        if( comps )
        {
            // Prepare a temporary collection for all seeds being added
            RowSeedCollection newSeeds;
            // This parameter is really a pseudoparameter
            for( RowSeedCollection::iterator iseeds = m_rowSeeds.begin(); iseeds != m_rowSeeds.end(); )
            {
                // partition the seed terms into related, unrelated (to pseudoparam)
                RowSeed relatedTerms, unrelatedTerms;
                for( RowSeed::iterator iseed = iseeds->begin(); iseed != iseeds->end(); ++iseed )
                {
                    if( find( comps->begin(), comps->end(), iseed->first ) == comps->end() )
                    {
                        unrelatedTerms.insert( *iseed );
                    }
                    else
                    {
                        relatedTerms.insert( *iseed );
                    }
                }
                // if any of seed's terms relate to underlying parameters
                if( !relatedTerms.empty() )
                {
                    // Get rid of the seed, since we'll replace it
                    m_rowSeeds.erase( iseeds++ );
                    // for each value of the pseudoparameter
                    for( int vidx = 0; vidx < param->GetValueCount(); ++vidx )
                    {
                        RowSeed::iterator irel;
                        for( irel = relatedTerms.begin(); irel != relatedTerms.end(); ++irel )
                        {
                            vector<Parameter*>::iterator ip = find( comps->begin(), comps->end(), irel->first );
                            if( comps->end() == ip )
                            {
                                break;
                            }
                            int nParam = static_cast<int>( distance( comps->begin(), ip ) );
                            size_t nRealVal = param->GetModel()->GetResults()[ vidx ][ nParam ];
                            if( nRealVal != irel->second )
                            {
                                break;
                            }
                        }
                        // if value is excluded in overlapping underlying params
                        if( relatedTerms.end() == irel )
                        {
                            // generate a new seed using unrelated + this pseudo/value
                            RowSeed newSeed( unrelatedTerms );
                            newSeed.insert( make_pair( param, vidx ) );
                            // Put it into a temporary collection so we don't hit it again on this iteration
                            newSeeds.push_back( newSeed );
                        }
                    }
                }
                else
                {
                    // no new seed, just increment loop iterator
                    ++iseeds;
                }
            }

            // copy all new seeds to the main collection
            __push_back( m_rowSeeds, newSeeds.begin(), newSeeds.end() );
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2a0, %rsp            # imm = 0x2A0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x200(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x200(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x208(%rbp)
callq 0x1c780
movq %rax, %rdi
callq 0x8fd0
movq %rax, %rcx
movq -0x208(%rbp), %rax
cmpq %rcx, %rax
jae 0x1b346
movq -0x200(%rbp), %rdi
callq 0x1c780
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x1c7a0
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x1b333
leaq -0x38(%rbp), %rdi
callq 0x1d570
movq -0x200(%rbp), %rdi
addq $0x68, %rdi
callq 0x1d590
movq %rax, -0x40(%rbp)
movq -0x200(%rbp), %rdi
addq $0x68, %rdi
callq 0x1d5f0
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x1d5c0
testb $0x1, %al
jne 0x1ad63
jmp 0x1b2b3
leaq -0x78(%rbp), %rdi
callq 0x1cf70
leaq -0xa8(%rbp), %rdi
callq 0x1cf70
leaq -0x40(%rbp), %rdi
callq 0x1d620
movq %rax, %rdi
callq 0x1ba10
movq %rax, -0xb0(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x1d620
movq %rax, %rdi
callq 0x1ba40
movq %rax, -0xb8(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x9130
testb $0x1, %al
jne 0x1adc4
jmp 0x1aef7
movq -0x20(%rbp), %rdi
callq 0x8c90
movq %rax, -0xc8(%rbp)
movq -0x20(%rbp), %rdi
callq 0x8cc0
movq %rax, -0xd0(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x9160
movq %rax, %rdx
movq -0xc8(%rbp), %rdi
movq -0xd0(%rbp), %rsi
callq 0x91c0
movq %rax, -0x210(%rbp)
jmp 0x1ae0f
movq -0x210(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x20(%rbp), %rdi
callq 0x8cc0
movq %rax, -0xe8(%rbp)
leaq -0xc0(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x8ff0
testb $0x1, %al
jne 0x1ae46
jmp 0x1aea3
leaq -0xb0(%rbp), %rdi
callq 0x9910
movq %rax, %rsi
leaq -0xa8(%rbp), %rdi
callq 0x1d640
movb %dl, -0x219(%rbp)
movq %rax, -0x218(%rbp)
jmp 0x1ae70
movb -0x219(%rbp), %al
movq -0x218(%rbp), %rcx
movq %rcx, -0xf8(%rbp)
movb %al, -0xf0(%rbp)
jmp 0x1aee4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x1b29c
leaq -0xb0(%rbp), %rdi
callq 0x9910
movq %rax, %rsi
leaq -0x78(%rbp), %rdi
callq 0x1d640
movb %dl, -0x229(%rbp)
movq %rax, -0x228(%rbp)
jmp 0x1aeca
movb -0x229(%rbp), %al
movq -0x228(%rbp), %rcx
movq %rcx, -0x108(%rbp)
movb %al, -0x100(%rbp)
jmp 0x1aee6
leaq -0xb0(%rbp), %rdi
callq 0x9210
jmp 0x1ad90
leaq -0x78(%rbp), %rdi
callq 0x1d690
testb $0x1, %al
jne 0x1b279
movq -0x200(%rbp), %rax
addq $0x68, %rax
movq %rax, -0x238(%rbp)
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0x1d700
movq %rax, -0x118(%rbp)
leaq -0x110(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x1d730
movq -0x238(%rbp), %rdi
movq -0x110(%rbp), %rsi
callq 0x1d6b0
movq %rax, -0x120(%rbp)
movl $0x0, -0x124(%rbp)
movl -0x124(%rbp), %eax
movl %eax, -0x240(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8eb0
movl %eax, -0x23c(%rbp)
jmp 0x1af80
movl -0x240(%rbp), %eax
movl -0x23c(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1b277
leaq -0x130(%rbp), %rdi
callq 0x1d0a0
leaq -0x78(%rbp), %rdi
callq 0x1ba10
movq %rax, -0x138(%rbp)
movq -0x138(%rbp), %rax
movq %rax, -0x130(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x1ba40
movq %rax, -0x140(%rbp)
leaq -0x130(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x9130
testb $0x1, %al
jne 0x1afea
jmp 0x1b151
movq -0x20(%rbp), %rdi
callq 0x8c90
movq %rax, -0x150(%rbp)
movq -0x20(%rbp), %rdi
callq 0x8cc0
movq %rax, -0x158(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x9160
movq %rax, %rdx
movq -0x150(%rbp), %rdi
movq -0x158(%rbp), %rsi
callq 0x91c0
movq %rax, -0x248(%rbp)
jmp 0x1b035
movq -0x248(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x20(%rbp), %rdi
callq 0x8cc0
movq %rax, -0x160(%rbp)
leaq -0x160(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x8ff0
testb $0x1, %al
jne 0x1b06c
jmp 0x1b071
jmp 0x1b151
movq -0x20(%rbp), %rdi
callq 0x8c90
movq %rax, -0x170(%rbp)
movq -0x148(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x170(%rbp), %rdi
movq -0x178(%rbp), %rsi
callq 0x1b770
movq %rax, -0x250(%rbp)
jmp 0x1b0ab
movq -0x250(%rbp), %rax
movl %eax, -0x164(%rbp)
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq %rax, -0x258(%rbp)
jmp 0x1b0ce
movq -0x258(%rbp), %rdi
callq 0x1c890
movq %rax, -0x260(%rbp)
jmp 0x1b0e3
movq -0x260(%rbp), %rdi
movslq -0x124(%rbp), %rsi
callq 0x1c6c0
movq %rax, %rdi
movslq -0x164(%rbp), %rsi
callq 0x1c6e0
movq (%rax), %rax
movq %rax, -0x180(%rbp)
movq -0x180(%rbp), %rax
movq %rax, -0x268(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x9160
movq %rax, %rcx
movq -0x268(%rbp), %rax
movslq 0x8(%rcx), %rcx
cmpq %rcx, %rax
je 0x1b13e
jmp 0x1b151
jmp 0x1b140
leaq -0x130(%rbp), %rdi
callq 0x9210
jmp 0x1afbe
leaq -0x78(%rbp), %rdi
callq 0x1ba40
movq %rax, -0x188(%rbp)
leaq -0x188(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xaa50
testb $0x1, %al
jne 0x1b17d
jmp 0x1b261
leaq -0x1b8(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x1d750
jmp 0x1b192
leaq -0x18(%rbp), %rdi
leaq -0x124(%rbp), %rsi
callq 0x1ca40
movl %edx, -0x274(%rbp)
movq %rax, -0x270(%rbp)
jmp 0x1b1b1
movl -0x274(%rbp), %eax
movq -0x270(%rbp), %rcx
movq %rcx, -0x1d8(%rbp)
movl %eax, -0x1d0(%rbp)
movl -0x1d0(%rbp), %eax
movl %eax, -0x1c0(%rbp)
movq -0x1d8(%rbp), %rax
movq %rax, -0x1c8(%rbp)
leaq -0x1b8(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x1cf90
movb %dl, -0x281(%rbp)
movq %rax, -0x280(%rbp)
jmp 0x1b207
movb -0x281(%rbp), %al
movq -0x280(%rbp), %rcx
movq %rcx, -0x1e8(%rbp)
movb %al, -0x1e0(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x1cfe0
jmp 0x1b233
leaq -0x1b8(%rbp), %rdi
callq 0x1d020
jmp 0x1b261
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x1d020
jmp 0x1b29c
jmp 0x1b263
movl -0x124(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x124(%rbp)
jmp 0x1af63
jmp 0x1b282
leaq -0x40(%rbp), %rdi
callq 0x1d780
leaq -0xa8(%rbp), %rdi
callq 0x1d020
leaq -0x78(%rbp), %rdi
callq 0x1d020
jmp 0x1ad39
leaq -0xa8(%rbp), %rdi
callq 0x1d020
leaq -0x78(%rbp), %rdi
callq 0x1d020
jmp 0x1b328
movq -0x200(%rbp), %rax
addq $0x68, %rax
movq %rax, -0x290(%rbp)
leaq -0x38(%rbp), %rdi
movq %rdi, -0x298(%rbp)
callq 0x1d590
movq -0x298(%rbp), %rdi
movq %rax, -0x1f0(%rbp)
callq 0x1d5f0
movq -0x290(%rbp), %rdi
movq %rax, -0x1f8(%rbp)
movq -0x1f0(%rbp), %rsi
movq -0x1f8(%rbp), %rdx
callq 0x1d7a0
jmp 0x1b30b
leaq -0x38(%rbp), %rdi
callq 0x1d800
jmp 0x1b333
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x1d800
jmp 0x1b34f
jmp 0x1b335
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x1acb2
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbp
retq
movq -0xd8(%rbp), %rdi
callq 0x79d0
nopl (%rax,%rax)