// File: /workspace/github_cpp_makefile_star2_O2/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 %rsi, -0x50(%rbp)
movq %rdi, %rbx
leaq -0x70(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0xf0(%rdi), %rax
movq %rax, -0x48(%rbp)
xorl %ecx, %ecx
movq -0x50(%rbp), %rax
cmpl (%rax), %ecx
jge 0x137c6
movq %rcx, -0x58(%rbp)
callq 0x3060
andb $0x1, %al
movb %al, -0x29(%rbp)
callq 0x3060
cvtsi2sd %eax, %xmm0
divsd 0x7bcc(%rip), %xmm0     # 0x1b260
movsd %xmm0, -0x60(%rbp)
callq 0x3060
movsd -0x60(%rbp), %xmm1
movsd 0x6965(%rip), %xmm0     # 0x1a010
ucomisd %xmm1, %xmm0
pushq $0x1e
popq %rcx
ja 0x136b7
pushq $0x46
popq %rcx
cltd
idivl %ecx
leal 0x1(%rdx), %eax
addl $0x1f, %edx
movsd 0x6948(%rip), %xmm0     # 0x1a010
ucomisd %xmm1, %xmm0
cmoval %eax, %edx
movl %edx, -0x30(%rbp)
callq 0x3060
cltq
movq 0x18(%rbx), %rsi
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 0x30f0
movb -0x29(%rbp), %r14b
movl -0x30(%rbp), %r12d
callq 0x3060
movl %eax, %r15d
pushq $0x38
popq %rdi
callq 0x31e0
movq %rax, %r13
incb %r14b
movzbl %r14b, %eax
cvtsi2sd %eax, %xmm0
movl %r12d, %eax
cvtsi2sd %rax, %xmm1
mulsd %xmm0, %xmm1
movl %r15d, %eax
cltd
pushq $0x2
popq %r15
idivl %r15d
incl %edx
cvtsi2sd %edx, %xmm0
mulsd %xmm1, %xmm0
mulsd 0xa9dc(%rip), %xmm0     # 0x1e128
cvttsd2si %xmm0, %r14
callq 0x3060
cltd
idivl %r15d
addl $0x3, %edx
imull -0x30(%rbp), %edx
movl %edx, -0x40(%rbp)
movl %r14d, -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 0xcc64
movq %r13, -0x38(%rbp)
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x1140a
movl 0x1e4(%rbx), %r14d
movq -0x38(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
cmpl %eax, %r14d
jbe 0x137bb
movq -0x38(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movl %eax, 0x1e4(%rbx)
movq -0x58(%rbp), %rcx
incl %ecx
jmp 0x13669
movl 0x1ec(%rbx), %ecx
movq 0xf8(%rbx), %rax
subq 0xf0(%rbx), %rax
sarq $0x3, %rax
cmpq %rcx, %rax
jbe 0x137e9
movl %eax, 0x1ec(%rbx)
movl 0x1e4(%rbx), %eax
cmpl %eax, 0x1e8(%rbx)
jbe 0x137fd
movl %eax, 0x1e8(%rbx)
leaq -0x80(%rbp), %rdi
callq 0x30c0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r13, %rdi
callq 0x31b0
jmp 0x13825
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x3330