// File: WShabti-Team[P]WShabtiPict/wshabtilib/api/model.cpp
// Function: pictcore::Model::generateRandomRow()
Exclusion Model::generateRandomRow()
{
    Exclusion row;
    for( ParamCollection::iterator ip = m_parameters.begin(); ip != m_parameters.end(); ++ip )
    {
        int sum = 0;
        for( int i = 0; i < ( *ip )->GetValueCount(); ++i )
        {
            sum += ( *ip )->GetWeight( i );
        }
        int idx = rand() % sum;

        int n;
        int val = 0;
        for( n = 0; n < ( *ip )->GetValueCount(); ++n )
        {
            if( val < idx )
            {
                val += ( *ip )->GetWeight( n );
            }
            else
            {
                break;
            }
        }

        row.insert( make_pair( *ip, n ) );
    }
    return( row );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x90(%rbp)
movq %rdi, %rax
movq %rax, -0x88(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movb $0x0, -0x11(%rbp)
callq 0xb6c0
movq -0x80(%rbp), %rdi
addq $0x8, %rdi
callq 0x8c90
movq %rax, -0x20(%rbp)
movq -0x80(%rbp), %rdi
addq $0x8, %rdi
callq 0x8cc0
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x8cf0
testb $0x1, %al
jne 0x174fd
jmp 0x176a1
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x98(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x8d30
movq (%rax), %rdi
callq 0x8eb0
movl %eax, -0x94(%rbp)
jmp 0x1752d
movl -0x98(%rbp), %eax
movl -0x94(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1758d
leaq -0x20(%rbp), %rdi
callq 0x8d30
movq (%rax), %rdi
movl -0x30(%rbp), %esi
callq 0x8f60
movl %eax, -0x9c(%rbp)
jmp 0x17559
movl -0x9c(%rbp), %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x1750b
movq -0x90(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0xbc70
jmp 0x176c7
callq 0x7170
cltd
idivl -0x2c(%rbp)
movl %edx, -0x40(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0xa4(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x8d30
movq (%rax), %rdi
callq 0x8eb0
movl %eax, -0xa0(%rbp)
jmp 0x175c9
movl -0xa4(%rbp), %eax
movl -0xa0(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1761a
movl -0x48(%rbp), %eax
cmpl -0x40(%rbp), %eax
jge 0x1760b
leaq -0x20(%rbp), %rdi
callq 0x8d30
movq (%rax), %rdi
movl -0x44(%rbp), %esi
callq 0x8f60
movl %eax, -0xa8(%rbp)
jmp 0x175fd
movl -0xa8(%rbp), %eax
addl -0x48(%rbp), %eax
movl %eax, -0x48(%rbp)
jmp 0x1760d
jmp 0x1761a
jmp 0x1760f
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x175a7
leaq -0x20(%rbp), %rdi
callq 0x8d30
movq %rax, %rdi
leaq -0x44(%rbp), %rsi
callq 0x1ca40
movl %edx, -0xb4(%rbp)
movq %rax, -0xb0(%rbp)
jmp 0x1763e
movq -0x90(%rbp), %rdi
movl -0xb4(%rbp), %eax
movq -0xb0(%rbp), %rcx
movq %rcx, -0x68(%rbp)
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
movl %eax, -0x50(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x58(%rbp), %rsi
callq 0xd9b0
movb %dl, -0xc1(%rbp)
movq %rax, -0xc0(%rbp)
jmp 0x1767f
movb -0xc1(%rbp), %al
movq -0xc0(%rbp), %rcx
movq %rcx, -0x78(%rbp)
movb %al, -0x70(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x8d70
jmp 0x174d6
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x176b7
movq -0x90(%rbp), %rdi
callq 0xbc70
movq -0x88(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x79d0