// File: /workspace/github_cpp_makefile_star2_O3/MichaelXanth[P]RPG_Game/Market/Market.cpp
// Function: Market::AddPotions(int const&)
void Market::AddPotions(const int& num)
{
    string potionName;
    Potion* tmpPotion;

    for (int i = 0; i < num; i++)
    {
        unsigned int level;
        float posibility;

        if ( ((double)rand() / RAND_MAX) < 0.7 )
            level = rand() % 30 + 1;
        else
            level = rand() % 70 + 31;

        potionName = name.potionsNames[rand() % name.potionsNames.size()];

        if ((double)(posibility = rand() % 100) < 100.0 / 3)
            tmpPotion = new Potion(potionName , ((rand() % 2) + 2) * level , level , (unsigned int)(((rand() % 6) + 1.0) * (level / 10.0) + 1) , 0 , 0);
        else if ((double)posibility < 200.0 / 3)
            tmpPotion = new Potion(potionName , ((rand() % 2) + 2) * level , level , 0 , (unsigned int)(((rand() % 6) + 1.0) * (level / 10.0) + 1) , 0);
        else
            tmpPotion = new Potion(potionName , ((rand() % 2) + 2) * level , level , 0 , 0 , (float)(3.0 * ((level / 25.0) + 1)) / 100.0);

        potionsArray.push_back(tmpPotion);

        if (minItemPrice > tmpPotion->GetPrice())
            minItemPrice = tmpPotion->GetPrice();
    }

    if (mostItems < potionsArray.size())
        mostItems = potionsArray.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 -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
cmpl $0x0, (%rsi)
jle 0x1a43c
movq %rsi, %r14
leaq 0x108(%rbx), %rax
movq %rax, -0x70(%rbp)
movl $0x1e, %r12d
xorl %r15d, %r15d
callq 0x3060
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0xa129(%rip), %xmm0     # 0x24260
movsd %xmm0, -0x78(%rbp)
callq 0x3060
movsd 0x8ec7(%rip), %xmm0     # 0x23010
movsd -0x78(%rbp), %xmm1
ucomisd %xmm1, %xmm0
movl $0x46, %ecx
cmoval %r12d, %ecx
cltd
idivl %ecx
leal 0x1(%rdx), %eax
addl $0x1f, %edx
ucomisd %xmm1, %xmm0
cmoval %eax, %edx
movl %edx, -0x2c(%rbp)
callq 0x3060
cltq
movq 0x48(%rbx), %rsi
movq 0x50(%rbx), %rcx
subq %rsi, %rcx
sarq $0x5, %rcx
xorl %edx, %edx
divq %rcx
shlq $0x5, %rdx
addq %rdx, %rsi
leaq -0x68(%rbp), %rdi
callq 0x30c0
callq 0x3060
cltq
imulq $0x51eb851f, %rax, %rcx # imm = 0x51EB851F
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rcx
addl %edx, %ecx
imull $0x64, %ecx, %ecx
subl %ecx, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xcf64(%rip), %xmm1     # 0x27130
ucomisd %xmm0, %xmm1
jbe 0x1a285
movl $0x40, %edi
callq 0x31a0
movq %rax, %r13
callq 0x3060
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
andl $-0x2, %ecx
negl %ecx
addl %ecx, %eax
addl $0x2, %eax
imull -0x2c(%rbp), %eax
movl %eax, -0x3c(%rbp)
callq 0x3060
cltq
imulq $0x2aaaaaab, %rax, %rcx # imm = 0x2AAAAAAB
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,2), %ecx
negl %ecx
addl %ecx, %eax
incl %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movl -0x2c(%rbp), %eax
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
divsd 0xa0b0(%rip), %xmm1     # 0x242f0
mulsd %xmm0, %xmm1
addsd 0xcefc(%rip), %xmm1     # 0x27148
cvttsd2si %xmm1, %rax
movl %eax, -0x38(%rbp)
xorl %eax, %eax
movl %eax, -0x34(%rbp)
movl %eax, -0x30(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, (%rsp)
movq %r13, %rdi
leaq -0x68(%rbp), %rsi
leaq -0x3c(%rbp), %rdx
leaq -0x2c(%rbp), %rcx
leaq -0x38(%rbp), %r8
leaq -0x34(%rbp), %r9
callq 0x1060c
jmp 0x1a3dc
movsd 0xceab(%rip), %xmm1     # 0x27138
ucomisd %xmm0, %xmm1
jbe 0x1a353
movl $0x40, %edi
callq 0x31a0
movq %rax, %r13
callq 0x3060
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
andl $-0x2, %ecx
negl %ecx
addl %ecx, %eax
addl $0x2, %eax
imull -0x2c(%rbp), %eax
movl %eax, -0x3c(%rbp)
xorl %r12d, %r12d
movl %r12d, -0x38(%rbp)
callq 0x3060
cltq
imulq $0x2aaaaaab, %rax, %rcx # imm = 0x2AAAAAAB
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,2), %ecx
negl %ecx
addl %ecx, %eax
incl %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movl -0x2c(%rbp), %eax
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
divsd 0x9fe8(%rip), %xmm1     # 0x242f0
mulsd %xmm0, %xmm1
addsd 0xce34(%rip), %xmm1     # 0x27148
cvttsd2si %xmm1, %rax
movl %eax, -0x34(%rbp)
movl %r12d, -0x30(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, (%rsp)
movq %r13, %rdi
leaq -0x68(%rbp), %rsi
leaq -0x3c(%rbp), %rdx
leaq -0x2c(%rbp), %rcx
leaq -0x38(%rbp), %r8
leaq -0x34(%rbp), %r9
callq 0x1060c
movq %r13, -0x48(%rbp)
movl $0x1e, %r12d
jmp 0x1a3e0
movl $0x40, %edi
callq 0x31a0
movq %rax, %r13
callq 0x3060
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
andl $-0x2, %ecx
negl %ecx
addl %ecx, %eax
addl $0x2, %eax
movl -0x2c(%rbp), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
imull %eax, %ecx
movl %ecx, -0x3c(%rbp)
xorl %eax, %eax
movl %eax, -0x38(%rbp)
movl %eax, -0x34(%rbp)
divsd 0xcda9(%rip), %xmm0     # 0x27140
addsd 0xcda9(%rip), %xmm0     # 0x27148
mulsd 0xcda9(%rip), %xmm0     # 0x27150
cvtsd2ss %xmm0, %xmm0
divss 0xcda5(%rip), %xmm0     # 0x27158
movss %xmm0, -0x30(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, (%rsp)
movq %r13, %rdi
leaq -0x68(%rbp), %rsi
leaq -0x3c(%rbp), %rdx
leaq -0x2c(%rbp), %rcx
leaq -0x38(%rbp), %r8
leaq -0x34(%rbp), %r9
callq 0x1060c
movq %r13, -0x48(%rbp)
movq 0x110(%rbx), %rsi
cmpq 0x118(%rbx), %rsi
je 0x1a3fd
movq %r13, (%rsi)
addq $0x8, 0x110(%rbx)
jmp 0x1a40a
movq -0x70(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x180bc
movl 0x1e4(%rbx), %r13d
movq -0x48(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
cmpl %eax, %r13d
jbe 0x1a430
movq -0x48(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movl %eax, 0x1e4(%rbx)
incl %r15d
cmpl (%r14), %r15d
jl 0x1a123
movl 0x1ec(%rbx), %ecx
movq 0x110(%rbx), %rax
subq 0x108(%rbx), %rax
sarq $0x3, %rax
cmpq %rcx, %rax
jbe 0x1a45f
movl %eax, 0x1ec(%rbx)
movl 0x1e4(%rbx), %eax
cmpl %eax, 0x1e8(%rbx)
jbe 0x1a473
movl %eax, 0x1e8(%rbx)
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x1a485
callq 0x3170
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1a498
jmp 0x1a498
movq %rax, %rbx
movq %r13, %rdi
callq 0x3170
jmp 0x1a4a8
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x1a4ba
callq 0x3170
movq %rbx, %rdi
callq 0x32f0