// File: /workspace/github_cpp_makefile_star2_O3/WShabti-Team[P]WShabtiPict/wshabtilib/api/pictapi.cpp
// Function: PictAddParameter
PICT_HANDLE
API_SPEC
PictAddParameter
    (
    IN     const PICT_HANDLE model,
    IN           size_t      valueCount,
    IN OPT unsigned int      order,
    IN OPT unsigned int      valueWeights[]
    )
{
    Model* modelObj = static_cast<Model*>( NO_CONST_HANDLE( model ));

    Parameter* param = new Parameter( order,
                                      static_cast<int>( modelObj->GetParameters().size() + 1 ),
                                      static_cast<int>( valueCount ),
                                      L"",
                                      false );
    try
    {
        if( NULL != param )
        {
            if( NULL != valueWeights )
            {
                std::vector<int> weights;
                weights.reserve( valueCount );
                weights.insert( weights.begin(), valueWeights, valueWeights + valueCount );
                param->SetWeights( move( weights ));
            }

            modelObj->AddParameter( param );
        }
    }
    catch( ... )
    {
        param = NULL;
    }

    return( param );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %r15
movl %edx, %ebp
movq %rsi, %r12
movq %rdi, %r13
movl $0xd0, %edi
callq 0x53c0
movq %rax, %rbx
movq 0x8(%r13), %r14
movq %r13, 0x38(%rsp)
movq 0x10(%r13), %r13
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x17166(%rip), %rdx     # 0x269f8
leaq 0x18(%rsp), %rdi
movq %rdx, %rsi
callq 0xfe1a
leaq 0x25222(%rip), %rax     # 0x34ac8
movq %rax, (%rbx)
leaq 0x8(%rbx), %rdi
leaq 0x18(%rbx), %rax
movq %rax, 0x8(%rbx)
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rax
leaq (%rsi,%rax,4), %rdx
callq 0xe46e
subq %r14, %r13
shrq $0x3, %r13
incl %r13d
movl %ebp, 0x28(%rbx)
movl %r13d, 0x2c(%rbx)
movl %r12d, 0x38(%rbx)
movb $0x0, 0x3c(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rbx)
xorl %eax, %eax
movq %rax, 0x50(%rbx)
leaq 0x60(%rbx), %rcx
movl $0x0, 0x60(%rbx)
movq %rax, 0x68(%rbx)
movq %rcx, 0x70(%rbx)
movq %rcx, 0x78(%rbx)
movq %rbx, %rax
addq $0x90, %rax
movups %xmm0, 0x80(%rbx)
movq %rax, 0x98(%rbx)
movq %rax, 0x90(%rbx)
movups %xmm0, 0xa0(%rbx)
movups %xmm0, 0xb0(%rbx)
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0xf952
movq 0x28(%rsp), %rax
leaq 0x4(,%rax,4), %rsi
callq 0x53e0
testq %r15, %r15
je 0xf9e0
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq %r12, %rsi
callq 0xfcec
movq %rsp, %rdi
movq (%rdi), %rsi
leaq (%r15,%r12,4), %rcx
movq %r15, %rdx
callq 0xfeba
movaps (%rsp), %xmm0
leaq 0x40(%rsp), %rsi
movaps %xmm0, (%rsi)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq %rbx, %rdi
callq 0xf01c
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xf9ca
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x53e0
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xf9e0
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x53e0
movq 0x38(%rsp), %rdi
movq %rbx, %rsi
callq 0xc0a4
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xfa20
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x53e0
jmp 0xfa20
jmp 0xfa1d
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xfa3b
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x53e0
jmp 0xfa3b
movq %rax, %rbx
movq %rbx, %rdi
callq 0x5190
callq 0x5650
xorl %ebx, %ebx
jmp 0xf9ed
movq %rax, %r14
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0xfa75
movq 0x28(%rsp), %rax
leaq 0x4(,%rax,4), %rsi
callq 0x53e0
jmp 0xfa75
movq %rax, %r14
movl $0xd0, %esi
movq %rbx, %rdi
callq 0x53e0
movq %r14, %rdi
callq 0x56a0