// File: /workspace/github_cpp_makefile_star2_O3/MichaelXanth[P]RPG_Game/Market/Market.cpp
// Function: Market::AddWeapons(int const&)
void Market::AddWeapons(const int& num)
{
    string weaponName;
    Weapon* tmpWeapon;

    for (int i = 0; i < num; i++)
    {
        unsigned int level;
        bool hand = rand() % 2;
        int wdamage;

        if ( ((double)rand() / RAND_MAX) < 0.7 )
            level = rand() % 30 + 1;
        else
            level = rand() % 70 + 31;

        weaponName = name.weaponsNames[rand() % name.weaponsNames.size()];

        wdamage = (unsigned int)((hand + 1.0) * level * ((double)(rand() % 2) + 1) / 2.0);

        tmpWeapon = new Weapon(weaponName , ((rand() % 2) + 3) * level , level , wdamage , hand);

        weaponsArray.push_back(tmpWeapon);

        if (minItemPrice > tmpWeapon->GetPrice())
            minItemPrice = tmpWeapon->GetPrice();
    }

    if (mostItems < weaponsArray.size())
        mostItems = weaponsArray.size();

    if (minPrice > minItemPrice)
        minPrice = minItemPrice;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
leaq -0x70(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq %rsi, -0x58(%rbp)
cmpl $0x0, (%rsi)
jle 0x1a05a
leaq 0xf0(%rbx), %rax
movq %rax, -0x50(%rbp)
xorl %eax, %eax
movq %rax, -0x48(%rbp)
callq 0x3060
andb $0x1, %al
movb %al, -0x29(%rbp)
callq 0x3060
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0xa389(%rip), %xmm0     # 0x24260
movsd %xmm0, -0x60(%rbp)
callq 0x3060
movsd -0x60(%rbp), %xmm1
movsd 0x9122(%rip), %xmm0     # 0x23010
ucomisd %xmm1, %xmm0
movl $0x1e, %ecx
ja 0x19efe
movl $0x46, %ecx
cltd
idivl %ecx
leal 0x1(%rdx), %eax
addl $0x1f, %edx
movsd 0x9101(%rip), %xmm0     # 0x23010
ucomisd %xmm1, %xmm0
cmoval %eax, %edx
movl %edx, -0x30(%rbp)
callq 0x3060
cltq
movq 0x18(%rbx), %rsi
movq %rbx, %r12
movq 0x20(%rbx), %rcx
subq %rsi, %rcx
sarq $0x5, %rcx
xorl %edx, %edx
divq %rcx
shlq $0x5, %rdx
addq %rdx, %rsi
leaq -0x80(%rbp), %rdi
callq 0x30c0
movb -0x29(%rbp), %bl
movl -0x30(%rbp), %r14d
callq 0x3060
movl %eax, %r15d
movl $0x38, %edi
callq 0x31a0
movq %rax, %r13
incb %bl
movzbl %bl, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movl %r14d, %eax
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
mulsd %xmm0, %xmm1
movl %r15d, %eax
shrl $0x1f, %eax
addl %r15d, %eax
andl $-0x2, %eax
negl %eax
addl %r15d, %eax
incl %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd %xmm1, %xmm0
mulsd 0xd184(%rip), %xmm0     # 0x27128
cvttsd2si %xmm0, %rbx
callq 0x3060
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
andl $-0x2, %ecx
negl %ecx
addl %ecx, %eax
addl $0x3, %eax
imull -0x30(%rbp), %eax
movl %eax, -0x40(%rbp)
movl %ebx, -0x3c(%rbp)
movq %r13, %rdi
leaq -0x80(%rbp), %rsi
leaq -0x40(%rbp), %rdx
leaq -0x30(%rbp), %rcx
leaq -0x3c(%rbp), %r8
leaq -0x29(%rbp), %r9
callq 0x10568
movq %r13, -0x38(%rbp)
movq 0xf8(%r12), %rsi
cmpq 0x100(%r12), %rsi
je 0x1a009
movq %r13, (%rsi)
addq $0x8, 0xf8(%r12)
jmp 0x1a016
movq -0x50(%rbp), %rdi
leaq -0x38(%rbp), %rdx
callq 0x17e44
movl 0x1e4(%r12), %ebx
movq -0x38(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
cmpl %eax, %ebx
movq -0x48(%rbp), %rcx
jbe 0x1a046
movq -0x38(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movl %eax, 0x1e4(%r12)
movq -0x48(%rbp), %rcx
incl %ecx
movq -0x58(%rbp), %rax
cmpl (%rax), %ecx
movq %r12, %rbx
movq %rcx, %rax
jl 0x19eb5
movl 0x1ec(%rbx), %ecx
movq 0xf8(%rbx), %rax
subq 0xf0(%rbx), %rax
sarq $0x3, %rax
cmpq %rcx, %rax
jbe 0x1a07d
movl %eax, 0x1ec(%rbx)
movl 0x1e4(%rbx), %eax
cmpl %eax, 0x1e8(%rbx)
jbe 0x1a091
movl %eax, 0x1e8(%rbx)
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x1a0a3
callq 0x3170
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r13, %rdi
callq 0x3170
jmp 0x1a0c2
movq %rax, %rbx
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x1a0d4
callq 0x3170
movq %rbx, %rdi
callq 0x32f0