// File: /workspace/github_cpp_makefile_star2_O2/WShabti-Team[P]WShabtiPict/wshabtilib/api/model.cpp
// Function: pictcore::Model::generateMixedOrder()
void Model::generateMixedOrder()
{
    GlobalZerosCount = 0;
    // turn each submodel's output into a PseudoParameter and add to model
    for( SubmodelCollection::iterator im = m_submodels.begin(); im != m_submodels.end(); ++im )
    {
        // make a pseudo-parameter from the submodel, add to this model
        // ignore first arg (order) - it'll be reset below
        Parameter *pseudo = new PseudoParameter( m_order, ++m_lastParamId, *im );
        AddParameter( pseudo );
    }

    // initialize combinations based on contents of m_parameters
    vector<Combination*> vecCombo;

    // sort parameter vector by order to generate parameter combinations
    sort( m_parameters.begin(), m_parameters.end(), GreaterThanByOrder() );

    bool r1 = mapExclusionsToPseudoParameters();
    bool r2 = excludeConflictingParamValues();
    // TODO: do we realy need to derive if the real exclusions were mapped?
    //       exclusions for conflicting param values don't conflict with one another
    if( r1 || r2 ) deriveSubmodelExclusions();

    mapRowSeedsToPseudoParameters();

    // for (each order, from highest to lowest)
    //   for every N-way combinations of these and higher-order parameters
    for( ParamCollection::iterator lastOrder = m_parameters.begin(); lastOrder != m_parameters.end(); /*increment in mid-loop*/ )
    {
        int order = ( *lastOrder )->GetOrder();
        // Get the range of each order
        while( lastOrder != m_parameters.end() && ( *lastOrder )->GetOrder() == order )
            ++lastOrder;
        Combination baseCombo( this );
        choose( m_parameters.begin(), lastOrder, order, order, baseCombo, vecCombo );
    }

    gcd( vecCombo );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rdi, %rbx
andl $0x0, (%rdi)
leaq 0x50(%rdi), %r15
movq %r15, %r12
movq (%r12), %r12
cmpq %r15, %r12
je 0xb1c9
movl $0xd8, %edi
callq 0x6440
movq %rax, %r14
movl 0x108(%rbx), %esi
movl 0x130(%rbx), %edx
incl %edx
movl %edx, 0x130(%rbx)
movq 0x10(%r12), %rcx
movq %rax, %rdi
callq 0xfc02
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc5c2
jmp 0xb185
andq $0x0, 0x20(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rsi
callq 0xf02f
movq %rbx, %rdi
callq 0xbbce
movl %eax, %ebp
movq %rbx, %rdi
callq 0xadee
orb %al, %bpl
cmpb $0x1, %bpl
jne 0xb207
movq %rbx, %rdi
callq 0xbee2
movq %rbx, %rdi
callq 0xbfe4
movq 0x8(%rbx), %r14
leaq 0x30(%rsp), %r15
leaq 0x10(%rsp), %r12
movq 0x10(%rbx), %rax
cmpq %rax, %r14
je 0xb26f
movq (%r14), %rcx
movl 0x28(%rcx), %ebp
cmpq %rax, %r14
je 0xb23f
movq (%r14), %rcx
cmpl %ebp, 0x28(%rcx)
jne 0xb23f
addq $0x8, %r14
jmp 0xb22c
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6fa6
movq 0x8(%rbx), %rsi
movq %r12, (%rsp)
movq %rbx, %rdi
movq %r14, %rdx
movl %ebp, %ecx
movl %ebp, %r8d
movq %r15, %r9
callq 0x9b4c
movq %r15, %rdi
callq 0x6fca
jmp 0xb21d
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x9ce0
leaq 0x10(%rsp), %rdi
callq 0xd978
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb299
jmp 0xb299
jmp 0xb299
movq %rax, %rbx
jmp 0xb2ab
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x6fca
leaq 0x10(%rsp), %rdi
callq 0xd978
jmp 0xb2c7
movq %rax, %rbx
movl $0xd8, %esi
movq %r14, %rdi
callq 0x6460
movq %rbx, %rdi
callq 0x66e0
nop