// File: /workspace/github_cpp_makefile_star2_O3/MichaelXanth[P]RPG_Game/Market/Market.cpp
// Function: Market::AddArmors(int const&)
void Market::AddArmors(const int& num)
{
    string armorName;
    Armor* tmpArmor;

    for (int i = 0; i < num; i++)
    {
        unsigned int level;

        if ( ((double)rand() / RAND_MAX) < 0.7 )
            level = rand() % 30 + 1;
        else
            level = rand() % 70 + 31;

        armorName = name.armorsNames[rand() % name.armorsNames.size()];

        tmpArmor = new Armor(armorName , ((rand() % 2) + 3) * level , level , (unsigned int)(level * (4.0 / 2.0)));

        armorsArray.push_back(tmpArmor);

        if (minItemPrice > tmpArmor->GetPrice())
            minItemPrice = tmpArmor->GetPrice();
    }

    if (mostItems < armorsArray.size())
        mostItems = armorsArray.size();

    if (minPrice > minItemPrice)
        minPrice = minItemPrice;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
cmpl $0x0, (%rsi)
jle 0x1a62f
movq %rsi, %r14
leaq 0x120(%rbx), %rax
movq %rax, -0x48(%rbp)
xorl %r13d, %r13d
leaq -0x70(%rbp), %r12
callq 0x3060
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x9d45(%rip), %xmm0     # 0x24260
movsd %xmm0, -0x50(%rbp)
callq 0x3060
movsd -0x50(%rbp), %xmm1
movsd 0x8ade(%rip), %xmm0     # 0x23010
ucomisd %xmm1, %xmm0
movl $0x1e, %ecx
ja 0x1a542
movl $0x46, %ecx
cltd
idivl %ecx
leal 0x1(%rdx), %eax
addl $0x1f, %edx
movsd 0x8abd(%rip), %xmm0     # 0x23010
ucomisd %xmm1, %xmm0
cmoval %eax, %edx
movl %edx, -0x2c(%rbp)
callq 0x3060
cltq
movq 0x30(%rbx), %rsi
movq 0x38(%rbx), %rcx
subq %rsi, %rcx
sarq $0x5, %rcx
xorl %edx, %edx
divq %rcx
shlq $0x5, %rdx
addq %rdx, %rsi
movq %r12, %rdi
callq 0x30c0
movl $0x38, %edi
callq 0x31a0
movq %rax, %r15
callq 0x3060
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
andl $-0x2, %ecx
negl %ecx
addl %ecx, %eax
addl $0x3, %eax
movl -0x2c(%rbp), %ecx
imull %ecx, %eax
movl %eax, -0x40(%rbp)
addl %ecx, %ecx
movl %ecx, -0x3c(%rbp)
movq %r15, %rdi
movq %r12, %rsi
leaq -0x40(%rbp), %rdx
leaq -0x2c(%rbp), %rcx
leaq -0x3c(%rbp), %r8
callq 0x105c0
movq %r15, -0x38(%rbp)
movq 0x128(%rbx), %rsi
cmpq 0x130(%rbx), %rsi
je 0x1a5f0
movq %r15, (%rsi)
addq $0x8, 0x128(%rbx)
jmp 0x1a5fd
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rdx
callq 0x17f80
movl 0x1e4(%rbx), %r15d
movq -0x38(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
cmpl %eax, %r15d
jbe 0x1a623
movq -0x38(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movl %eax, 0x1e4(%rbx)
incl %r13d
cmpl (%r14), %r13d
jl 0x1a507
movl 0x1ec(%rbx), %ecx
movq 0x128(%rbx), %rax
subq 0x120(%rbx), %rax
sarq $0x3, %rax
cmpq %rcx, %rax
jbe 0x1a652
movl %eax, 0x1ec(%rbx)
movl 0x1e4(%rbx), %eax
cmpl %eax, 0x1e8(%rbx)
jbe 0x1a666
movl %eax, 0x1e8(%rbx)
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x1a678
callq 0x3170
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r15, %rdi
callq 0x3170
jmp 0x1a697
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x1a6a9
callq 0x3170
movq %rbx, %rdi
callq 0x32f0
nop