// File: /workspace/github_cpp_makefile_star2_O1/MichaelXanth[P]RPG_Game/Main.cpp
// Function: main
int main(void)
{
    srand(time(NULL));
    Grid grid;
    Market market;
    Names name;
    vector<Hero*> heroes;

    grid.BuildGrid();

    heroes.push_back(new Paladin(name.names[rand() % name.names.size()],
                                 Hero::GetBaseHealth() , 1 , Hero::GetBaseMagicPower(),
                                 Hero::GetBaseDexterity() + (float(rand()) / RAND_MAX * 600), Hero::GetBaseStrength() + 2,
                                 Hero::GetBaseAgility(), 50));

    heroes.push_back(new Sorcerer(name.names[rand() % name.names.size()],
                                  Hero::GetBaseHealth() , 1 , Hero::GetBaseMagicPower(),
                                  Hero::GetBaseDexterity() + (float(rand()) / RAND_MAX * 800), Hero::GetBaseStrength(),
                                  Hero::GetBaseAgility() + (float(rand()) / RAND_MAX * 0.7), 50));

    heroes.push_back(new Warrior(name.names[rand() % name.names.size()],
                                 Hero::GetBaseHealth() , 1 , Hero::GetBaseMagicPower(),
                                 Hero::GetBaseDexterity() , Hero::GetBaseStrength() + 3,
                                 Hero::GetBaseAgility() + (float(rand()) / RAND_MAX * 0.8), 50));
    
    Game game(heroes , grid , market);
    game.Play();

    delete heroes[0];
    delete heroes[1];
    delete heroes[2];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x328, %rsp            # imm = 0x328
xorl %edi, %edi
callq 0x3160
movl %eax, %edi
callq 0x3180
leaq -0xb0(%rbp), %rdi
callq 0xf130
leaq -0x350(%rbp), %rdi
callq 0x1943c
leaq -0x158(%rbp), %rdi
callq 0x3e30
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
movq $0x0, -0x60(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0xf236
movl $0x128, %edi            # imm = 0x128
callq 0x31a0
movq %rax, %r14
callq 0x3060
cltq
movq -0x158(%rbp), %rbx
movq -0x150(%rbp), %rcx
subq %rbx, %rcx
sarq $0x5, %rcx
xorl %edx, %edx
divq %rcx
movq %rdx, %r15
callq 0x10aa0
movl %eax, -0x3c(%rbp)
movl $0x1, -0x38(%rbp)
callq 0x10a88
movl %eax, -0x34(%rbp)
callq 0x10a90
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
movss %xmm0, -0x48(%rbp)
callq 0x3060
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x1f857(%rip), %xmm0    # 0x23004
mulss 0x1f853(%rip), %xmm0    # 0x23008
addss -0x48(%rbp), %xmm0
cvttss2si %xmm0, %rax
movl %eax, -0x30(%rbp)
callq 0x10a98
addl $0x2, %eax
movl %eax, -0x2c(%rbp)
callq 0x10aa8
shlq $0x5, %r15
addq %r15, %rbx
leaq -0x50(%rbp), %r12
movss %xmm0, (%r12)
leaq -0x4c(%rbp), %r13
movl $0x32, (%r13)
movb $0x1, %r15b
subq $0x8, %rsp
leaq -0x2c(%rbp), %rax
leaq -0x3c(%rbp), %rdx
leaq -0x38(%rbp), %rcx
leaq -0x34(%rbp), %r8
leaq -0x30(%rbp), %r9
movq %r14, %rdi
movq %rbx, %rsi
pushq %r13
pushq %r12
pushq %rax
callq 0x185bc
addq $0x20, %rsp
leaq -0x88(%rbp), %rsi
movq %r14, (%rsi)
xorl %r15d, %r15d
leaq -0x70(%rbp), %rdi
callq 0x3cb6
movl $0x128, %edi            # imm = 0x128
callq 0x31a0
movq %rax, %r14
callq 0x3060
cltq
movq -0x158(%rbp), %rbx
movq -0x150(%rbp), %rcx
subq %rbx, %rcx
sarq $0x5, %rcx
xorl %edx, %edx
divq %rcx
movq %rdx, %r15
callq 0x10aa0
movl %eax, -0x3c(%rbp)
movl $0x1, -0x38(%rbp)
callq 0x10a88
movl %eax, -0x34(%rbp)
callq 0x10a90
movl %eax, %eax
cvtsi2ss %rax, %xmm0
movss %xmm0, -0x48(%rbp)
callq 0x3060
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x1f763(%rip), %xmm0    # 0x23004
mulss 0x1f763(%rip), %xmm0    # 0x2300c
addss -0x48(%rbp), %xmm0
cvttss2si %xmm0, %rax
movl %eax, -0x30(%rbp)
callq 0x10a98
movl %eax, -0x2c(%rbp)
callq 0x10aa8
shlq $0x5, %r15
addq %r15, %rbx
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
callq 0x3060
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x1f71d(%rip), %xmm0    # 0x23004
cvtss2sd %xmm0, %xmm0
mulsd 0x1f71d(%rip), %xmm0    # 0x23010
addsd -0x48(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x50(%rbp)
movl $0x32, -0x4c(%rbp)
movb $0x1, %r15b
subq $0x8, %rsp
leaq -0x3c(%rbp), %rdx
leaq -0x38(%rbp), %rcx
leaq -0x34(%rbp), %r8
leaq -0x30(%rbp), %r9
movq %r14, %rdi
movq %rbx, %rsi
pushq %r13
pushq %r12
leaq -0x2c(%rbp), %rax
pushq %rax
callq 0x18968
addq $0x20, %rsp
leaq -0x88(%rbp), %rsi
movq %r14, (%rsi)
xorl %r15d, %r15d
leaq -0x70(%rbp), %rdi
callq 0x3cb6
movl $0x128, %edi            # imm = 0x128
callq 0x31a0
movq %rax, %r14
callq 0x3060
cltq
movq -0x158(%rbp), %rbx
movq -0x150(%rbp), %rcx
subq %rbx, %rcx
sarq $0x5, %rcx
xorl %edx, %edx
divq %rcx
movq %rdx, %r15
callq 0x10aa0
movl %eax, -0x3c(%rbp)
movl $0x1, -0x38(%rbp)
callq 0x10a88
movl %eax, -0x34(%rbp)
callq 0x10a90
movl %eax, -0x30(%rbp)
callq 0x10a98
addl $0x3, %eax
movl %eax, -0x2c(%rbp)
callq 0x10aa8
shlq $0x5, %r15
addq %r15, %rbx
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
callq 0x3060
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x1f633(%rip), %xmm0    # 0x23004
cvtss2sd %xmm0, %xmm0
mulsd 0x1f63b(%rip), %xmm0    # 0x23018
addsd -0x48(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x50(%rbp)
movl $0x32, -0x4c(%rbp)
movb $0x1, %r15b
subq $0x8, %rsp
leaq -0x3c(%rbp), %rdx
leaq -0x38(%rbp), %rcx
leaq -0x34(%rbp), %r8
leaq -0x30(%rbp), %r9
movq %r14, %rdi
movq %rbx, %rsi
pushq %r13
pushq %r12
leaq -0x2c(%rbp), %rax
pushq %rax
callq 0x18210
addq $0x20, %rsp
leaq -0x88(%rbp), %rsi
movq %r14, (%rsi)
xorl %r15d, %r15d
leaq -0x70(%rbp), %rdi
callq 0x3cb6
leaq -0x88(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
leaq -0x350(%rbp), %rcx
callq 0xb73c
leaq -0x88(%rbp), %rdi
callq 0xb768
movq -0x70(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x3a73
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0x3a86
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x70(%rbp), %rax
movq 0x10(%rax), %rdi
testq %rdi, %rdi
je 0x3a99
movq (%rdi), %rax
callq *0x18(%rax)
leaq -0x88(%rbp), %rdi
callq 0xb748
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x3aba
movq -0x60(%rbp), %rsi
subq %rdi, %rsi
callq 0x31b0
leaq -0xc8(%rbp), %rdi
callq 0x3c4c
leaq -0xe0(%rbp), %rdi
callq 0x3c4c
leaq -0xf8(%rbp), %rdi
callq 0x3c4c
leaq -0x110(%rbp), %rdi
callq 0x3c4c
leaq -0x128(%rbp), %rdi
callq 0x3c4c
leaq -0x140(%rbp), %rdi
callq 0x3c4c
leaq -0x158(%rbp), %rdi
callq 0x3c4c
leaq -0x350(%rbp), %rdi
callq 0x1a696
leaq -0xb0(%rbp), %rdi
callq 0xf1e0
xorl %eax, %eax
addq $0x328, %rsp            # imm = 0x328
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0xb748
jmp 0x3bbb
jmp 0x3b83
jmp 0x3b55
jmp 0x3b55
jmp 0x3b55
jmp 0x3b55
movq %rax, %rbx
movb $0x1, %r15b
jmp 0x3b95
jmp 0x3b83
jmp 0x3b67
jmp 0x3b67
jmp 0x3b67
jmp 0x3b67
movq %rax, %rbx
movb $0x1, %r15b
jmp 0x3b9f
jmp 0x3b83
jmp 0x3b79
jmp 0x3b79
jmp 0x3b79
jmp 0x3b79
movq %rax, %rbx
movb $0x1, %r15b
jmp 0x3ba9
jmp 0x3b83
movq %rax, %rbx
jmp 0x3bbb
movq %rax, %rbx
jmp 0x3bdc
movq %rax, %rbx
jmp 0x3be8
movq %rax, %rbx
testb %r15b, %r15b
je 0x3bbb
jmp 0x3bae
movq %rax, %rbx
testb %r15b, %r15b
je 0x3bbb
jmp 0x3bae
movq %rax, %rbx
testb %r15b, %r15b
je 0x3bbb
movl $0x128, %esi            # imm = 0x128
movq %r14, %rdi
callq 0x31b0
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x3bd0
movq -0x60(%rbp), %rsi
subq %rdi, %rsi
callq 0x31b0
leaq -0x158(%rbp), %rdi
callq 0x3bfc
leaq -0x350(%rbp), %rdi
callq 0x1a696
leaq -0xb0(%rbp), %rdi
callq 0xf1e0
movq %rbx, %rdi
callq 0x32f0