// File: /workspace/github_cpp_makefile_star2_O3/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 0xf0a0
leaq -0x350(%rbp), %rdi
callq 0x1945c
leaq -0x158(%rbp), %rdi
callq 0x3e0c
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
movq $0x0, -0x60(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0xf1a8
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 0x109f0
movl %eax, -0x3c(%rbp)
movl $0x1, -0x38(%rbp)
callq 0x109d8
movl %eax, -0x34(%rbp)
callq 0x109e0
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 0x109e8
addl $0x2, %eax
movl %eax, -0x2c(%rbp)
callq 0x109f8
shlq $0x5, %r15
addq %r15, %rbx
leaq -0x50(%rbp), %r12
movss %xmm0, (%r12)
leaq -0x4c(%rbp), %r13
movl $0x32, (%r13)
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)
leaq -0x70(%rbp), %rdi
callq 0x3c8a
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 0x109f0
movl %eax, -0x3c(%rbp)
movl $0x1, -0x38(%rbp)
callq 0x109d8
movl %eax, -0x34(%rbp)
callq 0x109e0
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
movss %xmm0, -0x48(%rbp)
callq 0x3060
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x1f766(%rip), %xmm0    # 0x23004
mulss 0x1f766(%rip), %xmm0    # 0x2300c
addss -0x48(%rbp), %xmm0
cvttss2si %xmm0, %rax
movl %eax, -0x30(%rbp)
callq 0x109e8
movl %eax, -0x2c(%rbp)
callq 0x109f8
shlq $0x5, %r15
addq %r15, %rbx
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
callq 0x3060
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x1f720(%rip), %xmm0    # 0x23004
cvtss2sd %xmm0, %xmm0
mulsd 0x1f720(%rip), %xmm0    # 0x23010
addsd -0x48(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x50(%rbp)
movl $0x32, -0x4c(%rbp)
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 0x18980
addq $0x20, %rsp
leaq -0x88(%rbp), %rsi
movq %r14, (%rsi)
leaq -0x70(%rbp), %rdi
callq 0x3c8a
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 0x109f0
movl %eax, -0x3c(%rbp)
movl $0x1, -0x38(%rbp)
callq 0x109d8
movl %eax, -0x34(%rbp)
callq 0x109e0
movl %eax, -0x30(%rbp)
callq 0x109e8
addl $0x3, %eax
movl %eax, -0x2c(%rbp)
callq 0x109f8
shlq $0x5, %r15
addq %r15, %rbx
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
callq 0x3060
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x1f63c(%rip), %xmm0    # 0x23004
cvtss2sd %xmm0, %xmm0
mulsd 0x1f644(%rip), %xmm0    # 0x23018
addsd -0x48(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x50(%rbp)
movl $0x32, -0x4c(%rbp)
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 0x181f8
addq $0x20, %rsp
leaq -0x88(%rbp), %rsi
movq %r14, (%rsi)
leaq -0x70(%rbp), %rdi
callq 0x3c8a
leaq -0x88(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
leaq -0x350(%rbp), %rcx
callq 0xb724
leaq -0x88(%rbp), %rdi
callq 0xb750
movq -0x70(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x3a68
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0x3a7b
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x70(%rbp), %rax
movq 0x10(%rax), %rdi
testq %rdi, %rdi
je 0x3a8a
movq (%rdi), %rax
callq *0x18(%rax)
leaq -0x88(%rbp), %rdi
callq 0xb730
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x3aab
movq -0x60(%rbp), %rsi
subq %rdi, %rsi
callq 0x31b0
leaq -0xc8(%rbp), %rdi
callq 0x3c1c
leaq -0xe0(%rbp), %rdi
callq 0x3c1c
leaq -0xf8(%rbp), %rdi
callq 0x3c1c
leaq -0x110(%rbp), %rdi
callq 0x3c1c
leaq -0x128(%rbp), %rdi
callq 0x3c1c
leaq -0x140(%rbp), %rdi
callq 0x3c1c
leaq -0x158(%rbp), %rdi
callq 0x3c1c
leaq -0x350(%rbp), %rdi
callq 0x1a6b2
leaq -0xb0(%rbp), %rdi
callq 0xf150
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 0xb730
jmp 0x3b81
jmp 0x3b7e
jmp 0x3b7e
jmp 0x3b6a
jmp 0x3b6a
jmp 0x3b6a
jmp 0x3b6a
jmp 0x3b6a
jmp 0x3b6a
jmp 0x3b7e
jmp 0x3b7e
jmp 0x3b6a
jmp 0x3b6a
jmp 0x3b6a
jmp 0x3b6a
jmp 0x3b6a
jmp 0x3b6a
jmp 0x3b7e
jmp 0x3b7e
jmp 0x3b6a
jmp 0x3b6a
jmp 0x3b6a
jmp 0x3b6a
jmp 0x3b6a
movq %rax, %rbx
movl $0x128, %esi            # imm = 0x128
movq %r14, %rdi
callq 0x31b0
jmp 0x3b81
jmp 0x3b7e
movq %rax, %rbx
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x3b96
movq -0x60(%rbp), %rsi
subq %rdi, %rsi
callq 0x31b0
leaq -0x158(%rbp), %rdi
callq 0x3bcc
leaq -0x350(%rbp), %rdi
callq 0x1a6b2
leaq -0xb0(%rbp), %rdi
callq 0xf150
movq %rbx, %rdi
callq 0x32f0
movq %rax, %rbx
jmp 0x3ba2
movq %rax, %rbx
jmp 0x3bae