// File: WShabti-Team[P]WShabtiPict/wshabtilib/api/model.cpp
// Function: pictcore::Model::generateRandom()
void Model::generateRandom()
{
    // no support for result rows in this generation mode
    assert( 0 == GetResultParameterCount() );

    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
        Parameter *pseudo = new PseudoParameter( 1, ++m_lastParamId, *im );
        AddParameter( pseudo );
    }

    // Initialize combinations based on contents of m_parameters
    vector<Combination*> vecCombo;
    for( vector<Parameter*>::iterator ip = m_parameters.begin(); ip != m_parameters.end(); ++ip )
    {
        ( *ip )->SetOrder( 1 );
    }
    bool r1 = mapExclusionsToPseudoParameters();
    bool r2 = excludeConflictingParamValues();
    if( r1 || r2 ) deriveSubmodelExclusions();

    mapRowSeedsToPseudoParameters();

    Combination baseCombo( this );
    choose( m_parameters.begin(), m_parameters.end(), 1, 1, baseCombo, vecCombo );
    gcd( vecCombo );
    if( m_maxRows > 0 && m_maxRows < static_cast<long>( m_results.size() ) )
    {
        m_results.erase( m_results.begin() + m_maxRows, m_results.end() );
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x1bf50
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x1985b
jmp 0x1987a
leaq 0x4af6c(%rip), %rdi     # 0x647ce
leaq 0x4add8(%rip), %rsi     # 0x64641
movl $0x380, %edx            # imm = 0x380
leaq 0x4afc9(%rip), %rcx     # 0x6483e
callq 0x7450
movq -0xe8(%rbp), %rdi
movl $0x0, (%rdi)
addq $0x50, %rdi
callq 0x1ca90
movq %rax, -0x10(%rbp)
movq -0xe8(%rbp), %rdi
addq $0x50, %rdi
callq 0x1caf0
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x1cac0
testb $0x1, %al
jne 0x198be
jmp 0x19964
movl $0xd8, %edi
callq 0x75e0
movq %rax, %rcx
movq -0xe8(%rbp), %rax
movq %rcx, -0xf8(%rbp)
movq %rcx, -0x100(%rbp)
movl 0x130(%rax), %ecx
incl %ecx
movl %ecx, -0xec(%rbp)
movl %ecx, 0x130(%rax)
leaq -0x10(%rbp), %rdi
callq 0x1cb20
movq -0xf8(%rbp), %rdi
movl -0xec(%rbp), %edx
movq (%rax), %rcx
movl $0x1, %esi
callq 0x2d8b0
jmp 0x19919
movq -0xe8(%rbp), %rdi
movq -0x100(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rsi
callq 0x1c940
leaq -0x10(%rbp), %rdi
callq 0x1cc90
jmp 0x19894
movq -0x100(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl $0xd8, %esi
callq 0x7600
jmp 0x19c0f
leaq -0x48(%rbp), %rdi
callq 0x1ccd0
movq -0xe8(%rbp), %rdi
addq $0x8, %rdi
callq 0x8c90
movq %rax, -0x50(%rbp)
movq -0xe8(%rbp), %rdi
addq $0x8, %rdi
callq 0x8cc0
movq %rax, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x8cf0
testb $0x1, %al
jne 0x199a8
jmp 0x199de
leaq -0x50(%rbp), %rdi
callq 0x8d30
movq (%rax), %rdi
movl $0x1, %esi
callq 0x1ce00
jmp 0x199c0
jmp 0x199c2
leaq -0x50(%rbp), %rdi
callq 0x8d70
jmp 0x19981
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x19c06
movq -0xe8(%rbp), %rdi
callq 0x1a270
movb %al, -0x101(%rbp)
jmp 0x199f2
movq -0xe8(%rbp), %rdi
movb -0x101(%rbp), %al
andb $0x1, %al
movb %al, -0x59(%rbp)
callq 0x18300
movb %al, -0x102(%rbp)
jmp 0x19a11
movb -0x102(%rbp), %al
andb $0x1, %al
movb %al, -0x5a(%rbp)
testb $0x1, -0x59(%rbp)
jne 0x19a28
testb $0x1, -0x5a(%rbp)
je 0x19a38
movq -0xe8(%rbp), %rdi
callq 0x1aa10
jmp 0x19a36
jmp 0x19a38
movq -0xe8(%rbp), %rdi
callq 0x1ac90
jmp 0x19a46
movq -0xe8(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x8b60
jmp 0x19a5b
movq -0xe8(%rbp), %rdi
addq $0x8, %rdi
movq %rdi, -0x110(%rbp)
callq 0x8c90
movq -0x110(%rbp), %rdi
movq %rax, -0xa8(%rbp)
callq 0x8cc0
movq -0xe8(%rbp), %rdi
movq %rax, -0xb0(%rbp)
movq -0xa8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
movq %rsp, %rax
leaq -0x48(%rbp), %rcx
movq %rcx, (%rax)
movl $0x1, %r8d
leaq -0xa0(%rbp), %r9
movl %r8d, %ecx
callq 0x15100
jmp 0x19ac2
movq -0xe8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x15380
jmp 0x19ad4
movq -0xe8(%rbp), %rax
cmpq $0x0, 0x118(%rax)
jle 0x19be8
movq -0xe8(%rbp), %rdi
movq 0x118(%rdi), %rax
movq %rax, -0x118(%rbp)
addq $0xd0, %rdi
callq 0x1c0b0
movq %rax, %rcx
movq -0x118(%rbp), %rax
cmpq %rcx, %rax
jge 0x19be8
movq -0xe8(%rbp), %rdi
addq $0xd0, %rdi
movq %rdi, -0x128(%rbp)
callq 0x1c180
movq %rax, %rcx
movq -0xe8(%rbp), %rax
movq %rcx, -0xc8(%rbp)
movq 0x118(%rax), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x1ceb0
movq %rax, -0xc0(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x1cef0
movq -0x128(%rbp), %rdi
callq 0x1c1f0
movq %rax, -0xd8(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x1cef0
movq -0x128(%rbp), %rdi
movq -0xb8(%rbp), %rsi
movq -0xd0(%rbp), %rdx
callq 0x1ce20
movq %rax, -0x120(%rbp)
jmp 0x19bbe
movq -0x120(%rbp), %rax
movq %rax, -0xe0(%rbp)
jmp 0x19be8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x8bd0
jmp 0x19c06
leaq -0xa0(%rbp), %rdi
callq 0x8bd0
leaq -0x48(%rbp), %rdi
callq 0x1cd40
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
leaq -0x48(%rbp), %rdi
callq 0x1cd40
movq -0x28(%rbp), %rdi
callq 0x79d0
nopl (%rax,%rax)