// File: /workspace/github_cpp_makefile_star2_O2/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 0x31a0
movl %eax, %edi
callq 0x31c0
leaq -0xb0(%rbp), %rdi
callq 0xbf7c
leaq -0x350(%rbp), %rdi
callq 0x12d62
leaq -0x158(%rbp), %rdi
callq 0x3d44
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
andq $0x0, -0x60(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0xc064
movl $0x128, %edi            # imm = 0x128
callq 0x31e0
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 0xd04a
movl %eax, -0x3c(%rbp)
movl $0x1, -0x38(%rbp)
callq 0xd032
movl %eax, -0x34(%rbp)
callq 0xd03a
movl %eax, %eax
cvtsi2ss %rax, %xmm0
movss %xmm0, -0x48(%rbp)
callq 0x3060
cvtsi2ss %eax, %xmm0
mulss 0x16940(%rip), %xmm0    # 0x1a004
mulss 0x1693c(%rip), %xmm0    # 0x1a008
addss -0x48(%rbp), %xmm0
cvttss2si %xmm0, %rax
movl %eax, -0x30(%rbp)
callq 0xd042
addl $0x2, %eax
movl %eax, -0x2c(%rbp)
callq 0xd052
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 0x121b8
addq $0x20, %rsp
leaq -0x88(%rbp), %rsi
movq %r14, (%rsi)
leaq -0x70(%rbp), %rdi
callq 0x3ba4
movl $0x128, %edi            # imm = 0x128
callq 0x31e0
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 0xd04a
movl %eax, -0x3c(%rbp)
movl $0x1, -0x38(%rbp)
callq 0xd032
movl %eax, -0x34(%rbp)
callq 0xd03a
movl %eax, %eax
cvtsi2ss %rax, %xmm0
movss %xmm0, -0x48(%rbp)
callq 0x3060
cvtsi2ss %eax, %xmm0
mulss 0x16855(%rip), %xmm0    # 0x1a004
mulss 0x16855(%rip), %xmm0    # 0x1a00c
addss -0x48(%rbp), %xmm0
cvttss2si %xmm0, %rax
movl %eax, -0x30(%rbp)
callq 0xd042
movl %eax, -0x2c(%rbp)
callq 0xd052
shlq $0x5, %r15
addq %r15, %rbx
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
callq 0x3060
cvtsi2ss %eax, %xmm0
mulss 0x16812(%rip), %xmm0    # 0x1a004
cvtss2sd %xmm0, %xmm0
mulsd 0x16812(%rip), %xmm0    # 0x1a010
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 0x12464
addq $0x20, %rsp
leaq -0x88(%rbp), %rsi
movq %r14, (%rsi)
leaq -0x70(%rbp), %rdi
callq 0x3ba4
movl $0x128, %edi            # imm = 0x128
callq 0x31e0
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 0xd04a
movl %eax, -0x3c(%rbp)
movl $0x1, -0x38(%rbp)
callq 0xd032
movl %eax, -0x34(%rbp)
callq 0xd03a
movl %eax, -0x30(%rbp)
callq 0xd042
addl $0x3, %eax
movl %eax, -0x2c(%rbp)
callq 0xd052
shlq $0x5, %r15
addq %r15, %rbx
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
callq 0x3060
cvtsi2ss %eax, %xmm0
mulss 0x16731(%rip), %xmm0    # 0x1a004
cvtss2sd %xmm0, %xmm0
mulsd 0x16739(%rip), %xmm0    # 0x1a018
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 0x11f0c
addq $0x20, %rsp
leaq -0x88(%rbp), %rsi
movq %r14, (%rsi)
leaq -0x70(%rbp), %rdi
callq 0x3ba4
leaq -0x88(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
leaq -0x350(%rbp), %rcx
callq 0x97a8
leaq -0x88(%rbp), %rdi
callq 0x97d4
movq -0x70(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x3973
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0x3986
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x70(%rbp), %rax
movq 0x10(%rax), %rdi
testq %rdi, %rdi
je 0x3995
movq (%rdi), %rax
callq *0x18(%rax)
leaq -0x88(%rbp), %rdi
callq 0x97b4
leaq -0x70(%rbp), %rdi
callq 0x3b66
leaq -0x158(%rbp), %rdi
callq 0x3a78
leaq -0x350(%rbp), %rdi
callq 0x13cfe
leaq -0xb0(%rbp), %rdi
callq 0xc016
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 0x97b4
jmp 0x3a38
jmp 0x3a35
jmp 0x3a35
jmp 0x3a21
jmp 0x3a21
jmp 0x3a21
jmp 0x3a21
jmp 0x3a21
jmp 0x3a21
jmp 0x3a35
jmp 0x3a35
jmp 0x3a21
jmp 0x3a21
jmp 0x3a21
jmp 0x3a21
jmp 0x3a21
jmp 0x3a21
jmp 0x3a35
jmp 0x3a35
jmp 0x3a21
jmp 0x3a21
jmp 0x3a21
jmp 0x3a21
jmp 0x3a21
movq %rax, %rbx
movl $0x128, %esi            # imm = 0x128
movq %r14, %rdi
callq 0x31f0
jmp 0x3a38
jmp 0x3a35
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x3b66
leaq -0x158(%rbp), %rdi
callq 0x3a78
leaq -0x350(%rbp), %rdi
callq 0x13cfe
leaq -0xb0(%rbp), %rdi
callq 0xc016
movq %rbx, %rdi
callq 0x3330
movq %rax, %rbx
jmp 0x3a4d
movq %rax, %rbx
jmp 0x3a59
nop