// File: kaiming[P]Chamber-Crawler-3k/Board/board.cc
// Function: Board::generateFloor()
void Board::generateFloor() {
    // Begin RNG piece generation


    // Generate player
    int pChamber = std::rand() % static_cast<int>(chambers.size());
    int tile = std::rand() % static_cast<int>(chambers[pChamber].size());

    // Insert Player
    chambers[pChamber][tile]->setOccupant(playerPtr);
    player = chambers[pChamber][tile];


    // Generate exit stairs
    int chamber;

    // Ensure exit stairs are not in the same chamber as the player
    do {
        chamber = std::rand() % static_cast<int>(chambers.size());
    } while (chamber == pChamber);

    tile = std::rand() % static_cast<int>(chambers[chamber].size());

        // Insert exit stairs
    chambers[chamber][tile]->setExit(true);


    // Generate 10 Potions
    for (int i = 0; i < 10; i++) {
        // Generate type
        int type = std::rand() % 6;
        std::shared_ptr<Potion> temp;

        if (type == 0) {
            temp = std::make_shared<RH>();
        } else if (type == 1) {
            temp = std::make_shared<BA>();
        } else if (type == 2) {
            temp = std::make_shared<BD>();
        } else if (type == 3) {
            temp = std::make_shared<PH>();
        } else if (type == 4) {
            temp = std::make_shared<WA>();
        } else if (type == 5) {
            temp = std::make_shared<WD>();
        }

        // Generate location (make sure not occupied)
        do {
            chamber = std::rand() % static_cast<int>(chambers.size());
            tile = std::rand() % static_cast<int>(chambers[chamber].size());
        } while (chambers[chamber][tile]->getPotion() || chambers[chamber][tile]->isExit() || chambers[chamber][tile]->getOccupant());

        // Place type at location
        chambers[chamber][tile]->setPotion(temp);
    }


    // Generate 10 Gold
    for (int i = 0; i < 10; i++) {
        // Generate type
        int type = std::rand() % 8;
        std::shared_ptr<Gold> temp;

        if (type >= 0 && type <= 4) {
            temp = std::make_shared<Gold>("Normal Hoard", 2);
        } else if (type == 5 || type == 6) {
            temp = std::make_shared<Gold>("Small Hoard", 1);
        } else if (type == 7) {
            temp = std::make_shared<DragonHoard>();
        }

        // Generate location (make sure not occupied)
        do {
            chamber = std::rand() % static_cast<int>(chambers.size());
            tile = std::rand() % static_cast<int>(chambers[chamber].size());
        } while (chambers[chamber][tile]->getPotion() || chambers[chamber][tile]->getGold() || chambers[chamber][tile]->isExit() || chambers[chamber][tile]->getOccupant()); // DLC EXTENSION HERE: if gold can stack, remove second if clause
        

        // Place type at location
        chambers[chamber][tile]->setGold(temp);

        // If dragonHoard type, place Dragon around it
        if (type == 7) {
            // Add to dragonHoards
            dragonHoards[floorNum-1].emplace_back(std::dynamic_pointer_cast<WalkableTile>(chambers[chamber][tile])); 

            // Allocate dragon spawn destination
            std::shared_ptr<WalkableTile> destination = nullptr;

            // Generate direction around DragonHoard
            std::vector<std::string> directions;
            directions.push_back("no");
            directions.push_back("ea");
            directions.push_back("so");
            directions.push_back("we");
            directions.push_back("ne");
            directions.push_back("nw");
            directions.push_back("se");
            directions.push_back("sw");
            int i = 0;

            do {
                // Exit case in event that no suitable location found
                if (i > 80) {
                    break;
                } else {
                    i++;
                }
                
                int rng = std::rand() % 8;

                destination = validDest(chambers[chamber][tile], directions[rng]);

            } while (!destination || !isUnoccupied(destination)); 


            // Place dragon at location and store in DragonHoard
            destination->setOccupant(std::dynamic_pointer_cast<DragonHoard>(temp)->getDragon());
            std::dynamic_pointer_cast<DragonHoard>(temp)->setDragonTile(destination);
        }
    }


    // Generate 20 Enemies
    for (int i = 0; i < 20; i++) {
        // Generate type
        int type = std::rand() % 18;
        std::shared_ptr<Enemy> temp;

        if (type >= 0 && type <= 3) {
            temp = std::make_shared<Human>();
        } else if (type >= 4 && type <= 6) {
            temp = std::make_shared<Dwarf>();
        } else if (type >= 7 && type <= 11) {
            temp = std::make_shared<Halfling>();
        } else if (type >= 12 && type <= 13) {
            temp = std::make_shared<Elf>();
        } else if (type >= 14 && type <= 15) {
            temp = std::make_shared<Orc>();
        } else if (type >= 16 && type <= 17) {
            temp = std::make_shared<Merchant>();
        }

        // Generate location (make sure not occupied)
        do {
            chamber = std::rand() % static_cast<int>(chambers.size());
            tile = std::rand() % static_cast<int>(chambers[chamber].size());
        } while (chambers[chamber][tile]->getPotion() || chambers[chamber][tile]->getGold() || chambers[chamber][tile]->getOccupant() || chambers[chamber][tile]->isExit());

        // Place type at location
        chambers[chamber][tile]->setOccupant(temp);
        enemies[floorNum-1].emplace_back(chambers[chamber][tile]);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x5b0, %rsp            # imm = 0x5B0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x490(%rbp)
callq 0x60c0
movq -0x490(%rbp), %rdi
movl %eax, -0x4a4(%rbp)
addq $0xe0, %rdi
movq %rdi, -0x4a0(%rbp)
callq 0xd5e0
movq %rax, %rcx
movl -0x4a4(%rbp), %eax
cltd
idivl %ecx
movl %edx, -0xc(%rbp)
callq 0x60c0
movq -0x4a0(%rbp), %rdi
movl %eax, -0x494(%rbp)
movslq -0xc(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
callq 0xd010
movq -0x4a0(%rbp), %rdi
movq %rax, %rcx
movl -0x494(%rbp), %eax
cltd
idivl %ecx
movl %edx, -0x10(%rbp)
movslq -0xc(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x2dc70
movq %rax, %rdi
callq 0x2e040
movq -0x490(%rbp), %rsi
movq %rax, -0x488(%rbp)
addq $0xf8, %rsi
leaq -0x20(%rbp), %rdi
movq %rdi, -0x480(%rbp)
callq 0x2e060
movq -0x488(%rbp), %rdi
movq -0x480(%rbp), %rsi
callq 0x3bf90
jmp 0x2388e
leaq -0x20(%rbp), %rdi
callq 0x11fa0
movq -0x490(%rbp), %rdi
addq $0xe0, %rdi
movslq -0xc(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x2dc70
movq -0x490(%rbp), %rdi
movq %rax, %rsi
addq $0xb8, %rdi
callq 0x2e390
callq 0x60c0
movq -0x490(%rbp), %rdi
movl %eax, -0x4a8(%rbp)
addq $0xe0, %rdi
callq 0xd5e0
movq %rax, %rcx
movl -0x4a8(%rbp), %eax
cltd
idivl %ecx
movl %edx, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0xc(%rbp), %eax
je 0x238d0
callq 0x60c0
movq -0x490(%rbp), %rdi
movl %eax, -0x4ac(%rbp)
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
callq 0xd010
movq -0x490(%rbp), %rdi
movq %rax, %rcx
movl -0x4ac(%rbp), %eax
cltd
idivl %ecx
movl %edx, -0x10(%rbp)
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x2dc70
movq %rax, %rdi
callq 0x2e040
movq %rax, %rdi
movl $0x1, %esi
callq 0x3c0a0
movl $0x0, -0x34(%rbp)
cmpl $0xa, -0x34(%rbp)
jge 0x23d5a
callq 0x60c0
movl $0x6, %ecx
cltd
idivl %ecx
movl %edx, -0x38(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x133c0
cmpl $0x0, -0x38(%rbp)
jne 0x239f7
leaq -0x58(%rbp), %rdi
callq 0x12080
jmp 0x239b1
leaq -0x48(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x2efd0
leaq -0x58(%rbp), %rdi
callq 0x12180
jmp 0x23aed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x11fa0
jmp 0x25044
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x23d4c
cmpl $0x1, -0x38(%rbp)
jne 0x23a23
leaq -0x68(%rbp), %rdi
callq 0x121a0
jmp 0x23a08
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x2f000
leaq -0x68(%rbp), %rdi
callq 0x12240
jmp 0x23aeb
cmpl $0x2, -0x38(%rbp)
jne 0x23a4f
leaq -0x78(%rbp), %rdi
callq 0x12260
jmp 0x23a34
leaq -0x48(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x2f030
leaq -0x78(%rbp), %rdi
callq 0x12300
jmp 0x23ae9
cmpl $0x3, -0x38(%rbp)
jne 0x23a81
leaq -0x88(%rbp), %rdi
callq 0x12320
jmp 0x23a63
leaq -0x48(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x2f060
leaq -0x88(%rbp), %rdi
callq 0x123c0
jmp 0x23ae7
cmpl $0x4, -0x38(%rbp)
jne 0x23ab3
leaq -0x98(%rbp), %rdi
callq 0x123e0
jmp 0x23a95
leaq -0x48(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x2f090
leaq -0x98(%rbp), %rdi
callq 0x12480
jmp 0x23ae5
cmpl $0x5, -0x38(%rbp)
jne 0x23ae3
leaq -0xa8(%rbp), %rdi
callq 0x124a0
jmp 0x23ac7
leaq -0x48(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x2f0c0
leaq -0xa8(%rbp), %rdi
callq 0x12540
jmp 0x23ae5
jmp 0x23ae7
jmp 0x23ae9
jmp 0x23aeb
jmp 0x23aed
jmp 0x23aef
callq 0x60c0
movq -0x490(%rbp), %rdi
movl %eax, -0x4b4(%rbp)
addq $0xe0, %rdi
callq 0xd5e0
movq %rax, %rcx
movl -0x4b4(%rbp), %eax
cltd
idivl %ecx
movl %edx, -0x30(%rbp)
callq 0x60c0
movq -0x490(%rbp), %rdi
movl %eax, -0x4b0(%rbp)
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
callq 0xd010
movq %rax, %rcx
movl -0x4b0(%rbp), %eax
cltd
idivl %ecx
movl %edx, -0x10(%rbp)
movq -0x490(%rbp), %rdi
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x2dc70
movq %rax, %rdi
callq 0x2e040
movq %rax, %rsi
movb $0x0, -0xc9(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x3bfc0
jmp 0x23b98
leaq -0xb8(%rbp), %rdi
callq 0x2e370
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x4b5(%rbp)
jne 0x23c5c
movq -0x490(%rbp), %rdi
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x2dc70
movq %rax, %rdi
callq 0x2e040
movq %rax, %rdi
callq 0x3c080
movb %al, -0x4b6(%rbp)
jmp 0x23bf2
movb -0x4b6(%rbp), %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x4b5(%rbp)
jne 0x23c5c
jmp 0x23c07
movq -0x490(%rbp), %rdi
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x2dc70
movq %rax, %rdi
callq 0x2e040
movq %rax, %rsi
leaq -0xc8(%rbp), %rdi
callq 0x3bf60
jmp 0x23c43
movb $0x1, -0xc9(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x2e330
movb %al, -0x4b5(%rbp)
movb -0x4b5(%rbp), %al
movb %al, -0x4b7(%rbp)
testb $0x1, -0xc9(%rbp)
jne 0x23c73
jmp 0x23c7f
leaq -0xc8(%rbp), %rdi
callq 0x11fa0
leaq -0xb8(%rbp), %rdi
callq 0x11f80
movb -0x4b7(%rbp), %al
testb $0x1, %al
jne 0x23aef
movq -0x490(%rbp), %rdi
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x2dc70
movq %rax, %rdi
callq 0x2e040
movq %rax, -0x4c8(%rbp)
leaq -0xe0(%rbp), %rdi
movq %rdi, -0x4c0(%rbp)
leaq -0x48(%rbp), %rsi
callq 0x2f0f0
movq -0x4c8(%rbp), %rdi
movq -0x4c0(%rbp), %rsi
callq 0x3bff0
jmp 0x23cf7
leaq -0xe0(%rbp), %rdi
callq 0x11f80
leaq -0x48(%rbp), %rdi
callq 0x11f80
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x2397d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x11f80
jmp 0x23d4c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x11f80
leaq -0x48(%rbp), %rdi
callq 0x11f80
jmp 0x25044
movl $0x0, -0xe4(%rbp)
cmpl $0xa, -0xe4(%rbp)
jge 0x24ab8
callq 0x60c0
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, -0xe8(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x13090
cmpl $0x0, -0xe8(%rbp)
jl 0x23dfd
cmpl $0x4, -0xe8(%rbp)
jg 0x23dfd
movl $0x2, -0x10c(%rbp)
leaq 0x1981f(%rip), %rsi     # 0x3d5d2
leaq -0x108(%rbp), %rdi
leaq -0x10c(%rbp), %rdx
callq 0x12560
jmp 0x23dc8
leaq -0xf8(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x2f120
leaq -0x108(%rbp), %rdi
callq 0x11f60
jmp 0x23e90
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x24aa7
cmpl $0x5, -0xe8(%rbp)
je 0x23e0f
cmpl $0x6, -0xe8(%rbp)
jne 0x23e56
movl $0x1, -0x124(%rbp)
leaq 0x197bf(%rip), %rsi     # 0x3d5df
leaq -0x120(%rbp), %rdi
leaq -0x124(%rbp), %rdx
callq 0x12610
jmp 0x23e35
leaq -0xf8(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x2f120
leaq -0x120(%rbp), %rdi
callq 0x11f60
jmp 0x23e8e
cmpl $0x7, -0xe8(%rbp)
jne 0x23e8c
leaq -0x138(%rbp), %rdi
callq 0x12710
jmp 0x23e6d
leaq -0xf8(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x2f150
leaq -0x138(%rbp), %rdi
callq 0x12910
jmp 0x23e8e
jmp 0x23e90
jmp 0x23e92
callq 0x60c0
movq -0x490(%rbp), %rdi
movl %eax, -0x4d0(%rbp)
addq $0xe0, %rdi
callq 0xd5e0
movq %rax, %rcx
movl -0x4d0(%rbp), %eax
cltd
idivl %ecx
movl %edx, -0x30(%rbp)
callq 0x60c0
movq -0x490(%rbp), %rdi
movl %eax, -0x4cc(%rbp)
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
callq 0xd010
movq %rax, %rcx
movl -0x4cc(%rbp), %eax
cltd
idivl %ecx
movl %edx, -0x10(%rbp)
movq -0x490(%rbp), %rdi
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x2dc70
movq %rax, %rdi
callq 0x2e040
movq %rax, %rsi
movb $0x0, -0x159(%rbp)
movb $0x0, -0x171(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x3bfc0
jmp 0x23f42
leaq -0x148(%rbp), %rdi
callq 0x2e370
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x4d1(%rbp)
jne 0x24068
movq -0x490(%rbp), %rdi
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x2dc70
movq %rax, %rdi
callq 0x2e040
movq %rax, %rsi
leaq -0x158(%rbp), %rdi
callq 0x3c020
jmp 0x23f9d
movb $0x1, -0x159(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x2e350
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x4d1(%rbp)
jne 0x24068
movq -0x490(%rbp), %rdi
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x2dc70
movq %rax, %rdi
callq 0x2e040
movq %rax, %rdi
callq 0x3c080
movb %al, -0x4d2(%rbp)
jmp 0x23ffe
movb -0x4d2(%rbp), %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x4d1(%rbp)
jne 0x24068
jmp 0x24013
movq -0x490(%rbp), %rdi
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x2dc70
movq %rax, %rdi
callq 0x2e040
movq %rax, %rsi
leaq -0x170(%rbp), %rdi
callq 0x3bf60
jmp 0x2404f
movb $0x1, -0x171(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x2e330
movb %al, -0x4d1(%rbp)
movb -0x4d1(%rbp), %al
movb %al, -0x4d3(%rbp)
testb $0x1, -0x171(%rbp)
jne 0x2407f
jmp 0x2408b
leaq -0x170(%rbp), %rdi
callq 0x11fa0
testb $0x1, -0x159(%rbp)
jne 0x24096
jmp 0x240a2
leaq -0x158(%rbp), %rdi
callq 0x11f60
leaq -0x148(%rbp), %rdi
callq 0x11f80
movb -0x4d3(%rbp), %al
testb $0x1, %al
jne 0x23e92
movq -0x490(%rbp), %rdi
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x2dc70
movq %rax, %rdi
callq 0x2e040
movq %rax, -0x4e8(%rbp)
leaq -0x188(%rbp), %rdi
movq %rdi, -0x4e0(%rbp)
leaq -0xf8(%rbp), %rsi
callq 0x125e0
movq -0x4e8(%rbp), %rdi
movq -0x4e0(%rbp), %rsi
callq 0x3c050
jmp 0x2411d
leaq -0x188(%rbp), %rdi
callq 0x11f60
cmpl $0x7, -0xe8(%rbp)
jne 0x24a87
movq -0x490(%rbp), %rax
movq %rax, %rdi
addq $0x70, %rdi
movl 0x108(%rax), %eax
decl %eax
movslq %eax, %rsi
callq 0x12870
movq -0x490(%rbp), %rdi
movq %rax, -0x4f8(%rbp)
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x2dc70
movq %rax, %rsi
leaq -0x198(%rbp), %rdi
movq %rdi, -0x4f0(%rbp)
callq 0x2f180
movq -0x4f8(%rbp), %rdi
movq -0x4f0(%rbp), %rsi
callq 0x1dba0
jmp 0x241a9
leaq -0x198(%rbp), %rdi
callq 0x99e0
xorl %eax, %eax
movl %eax, %esi
leaq -0x1a8(%rbp), %rdi
callq 0x2dc90
leaq -0x1c0(%rbp), %rdi
callq 0x2dcb0
leaq -0x1e1(%rbp), %rdi
movq %rdi, -0x500(%rbp)
callq 0x6550
movq -0x500(%rbp), %rdx
leaq 0x1910f(%rip), %rsi     # 0x3d301
leaq -0x1e0(%rbp), %rdi
callq 0x8a00
jmp 0x24200
leaq -0x1c0(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x2e970
jmp 0x24215
leaq -0x1e0(%rbp), %rdi
callq 0x61c0
leaq -0x1e1(%rbp), %rdi
callq 0x6340
leaq -0x209(%rbp), %rdi
movq %rdi, -0x508(%rbp)
callq 0x6550
movq -0x508(%rbp), %rdx
leaq 0x190b9(%rip), %rsi     # 0x3d307
leaq -0x208(%rbp), %rdi
callq 0x8a00
jmp 0x2425c
leaq -0x1c0(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0x2e970
jmp 0x24271
leaq -0x208(%rbp), %rdi
callq 0x61c0
leaq -0x209(%rbp), %rdi
callq 0x6340
leaq -0x231(%rbp), %rdi
movq %rdi, -0x510(%rbp)
callq 0x6550
movq -0x510(%rbp), %rdx
leaq 0x1905a(%rip), %rsi     # 0x3d304
leaq -0x230(%rbp), %rdi
callq 0x8a00
jmp 0x242b8
leaq -0x1c0(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x2e970
jmp 0x242cd
leaq -0x230(%rbp), %rdi
callq 0x61c0
leaq -0x231(%rbp), %rdi
callq 0x6340
leaq -0x259(%rbp), %rdi
movq %rdi, -0x518(%rbp)
callq 0x6550
movq -0x518(%rbp), %rdx
leaq 0x19004(%rip), %rsi     # 0x3d30a
leaq -0x258(%rbp), %rdi
callq 0x8a00
jmp 0x24314
leaq -0x1c0(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x2e970
jmp 0x24329
leaq -0x258(%rbp), %rdi
callq 0x61c0
leaq -0x259(%rbp), %rdi
callq 0x6340
leaq -0x281(%rbp), %rdi
movq %rdi, -0x520(%rbp)
callq 0x6550
movq -0x520(%rbp), %rdx
leaq 0x18fab(%rip), %rsi     # 0x3d30d
leaq -0x280(%rbp), %rdi
callq 0x8a00
jmp 0x24370
leaq -0x1c0(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x2e970
jmp 0x24385
leaq -0x280(%rbp), %rdi
callq 0x61c0
leaq -0x281(%rbp), %rdi
callq 0x6340
leaq -0x2a9(%rbp), %rdi
movq %rdi, -0x528(%rbp)
callq 0x6550
movq -0x528(%rbp), %rdx
leaq 0x18f52(%rip), %rsi     # 0x3d310
leaq -0x2a8(%rbp), %rdi
callq 0x8a00
jmp 0x243cc
leaq -0x1c0(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x2e970
jmp 0x243e1
leaq -0x2a8(%rbp), %rdi
callq 0x61c0
leaq -0x2a9(%rbp), %rdi
callq 0x6340
leaq -0x2d1(%rbp), %rdi
movq %rdi, -0x530(%rbp)
callq 0x6550
movq -0x530(%rbp), %rdx
leaq 0x18ef9(%rip), %rsi     # 0x3d313
leaq -0x2d0(%rbp), %rdi
callq 0x8a00
jmp 0x24428
leaq -0x1c0(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x2e970
jmp 0x2443d
leaq -0x2d0(%rbp), %rdi
callq 0x61c0
leaq -0x2d1(%rbp), %rdi
callq 0x6340
leaq -0x2f9(%rbp), %rdi
movq %rdi, -0x538(%rbp)
callq 0x6550
movq -0x538(%rbp), %rdx
leaq 0x18ea0(%rip), %rsi     # 0x3d316
leaq -0x2f8(%rbp), %rdi
callq 0x8a00
jmp 0x24484
leaq -0x1c0(%rbp), %rdi
leaq -0x2f8(%rbp), %rsi
callq 0x2e970
jmp 0x24499
leaq -0x2f8(%rbp), %rdi
callq 0x61c0
leaq -0x2f9(%rbp), %rdi
callq 0x6340
movl $0x0, -0x300(%rbp)
cmpl $0x50, -0x300(%rbp)
jle 0x24703
jmp 0x2487f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x24500
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
testb $0x1, -0x159(%rbp)
jne 0x244f2
jmp 0x244fe
leaq -0x158(%rbp), %rdi
callq 0x11f60
jmp 0x24500
leaq -0x148(%rbp), %rdi
callq 0x11f80
jmp 0x24aa7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x11f60
jmp 0x24aa7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x99e0
jmp 0x24aa7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x24571
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x61c0
leaq -0x1e1(%rbp), %rdi
callq 0x6340
jmp 0x24a6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x245a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x61c0
leaq -0x209(%rbp), %rdi
callq 0x6340
jmp 0x24a6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x245df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x230(%rbp), %rdi
callq 0x61c0
leaq -0x231(%rbp), %rdi
callq 0x6340
jmp 0x24a6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x24616
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x61c0
leaq -0x259(%rbp), %rdi
callq 0x6340
jmp 0x24a6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x2464d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x61c0
leaq -0x281(%rbp), %rdi
callq 0x6340
jmp 0x24a6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x24684
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x2a8(%rbp), %rdi
callq 0x61c0
leaq -0x2a9(%rbp), %rdi
callq 0x6340
jmp 0x24a6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x246bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x2d0(%rbp), %rdi
callq 0x61c0
leaq -0x2d1(%rbp), %rdi
callq 0x6340
jmp 0x24a6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x246f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x2f8(%rbp), %rdi
callq 0x61c0
leaq -0x2f9(%rbp), %rdi
callq 0x6340
jmp 0x24a6d
movl -0x300(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x300(%rbp)
callq 0x60c0
movq -0x490(%rbp), %rdi
movl %eax, %edx
addl $0x7, %edx
testl %eax, %eax
movl %eax, %ecx
cmovsl %edx, %ecx
andl $-0x8, %ecx
subl %ecx, %eax
movl %eax, -0x304(%rbp)
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x2dc70
movq %rax, %rsi
leaq -0x328(%rbp), %rdi
callq 0xd550
movslq -0x304(%rbp), %rsi
leaq -0x1c0(%rbp), %rdi
callq 0x2e9c0
movq %rax, %rsi
leaq -0x348(%rbp), %rdi
callq 0x6130
jmp 0x24784
movq -0x490(%rbp), %rsi
leaq -0x318(%rbp), %rdi
leaq -0x328(%rbp), %rdx
leaq -0x348(%rbp), %rcx
callq 0x250e0
jmp 0x247a7
leaq -0x1a8(%rbp), %rdi
leaq -0x318(%rbp), %rsi
callq 0x2e8f0
leaq -0x318(%rbp), %rdi
callq 0x99e0
leaq -0x348(%rbp), %rdi
callq 0x61c0
leaq -0x328(%rbp), %rdi
callq 0x99e0
leaq -0x1a8(%rbp), %rdi
callq 0x1ed00
movb %al, %cl
movb $0x0, -0x359(%rbp)
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x539(%rbp)
jne 0x24802
jmp 0x2484c
leaq -0x358(%rbp), %rdi
movq %rdi, -0x548(%rbp)
leaq -0x1a8(%rbp), %rsi
callq 0xd550
movq -0x490(%rbp), %rdi
movq -0x548(%rbp), %rsi
movb $0x1, -0x359(%rbp)
callq 0x26090
movb %al, -0x53a(%rbp)
jmp 0x2483e
movb -0x53a(%rbp), %al
xorb $-0x1, %al
movb %al, -0x539(%rbp)
movb -0x539(%rbp), %al
movb %al, -0x549(%rbp)
testb $0x1, -0x359(%rbp)
jne 0x24863
jmp 0x2486f
leaq -0x358(%rbp), %rdi
callq 0x99e0
movb -0x549(%rbp), %al
testb $0x1, %al
jne 0x244bb
jmp 0x2487f
leaq -0x1a8(%rbp), %rdi
callq 0x2e040
movq %rax, -0x560(%rbp)
leaq -0x390(%rbp), %rdi
movq %rdi, -0x558(%rbp)
leaq -0xf8(%rbp), %rsi
callq 0x2e530
movq -0x558(%rbp), %rdi
callq 0x12af0
movq %rax, %rsi
leaq -0x380(%rbp), %rdi
callq 0x38670
jmp 0x248c9
leaq -0x370(%rbp), %rdi
movq %rdi, -0x568(%rbp)
leaq -0x380(%rbp), %rsi
callq 0x2f1e0
movq -0x560(%rbp), %rdi
movq -0x568(%rbp), %rsi
callq 0x3bf90
jmp 0x248f8
leaq -0x370(%rbp), %rdi
callq 0x11fa0
leaq -0x380(%rbp), %rdi
callq 0x12b30
leaq -0x390(%rbp), %rdi
callq 0x12910
leaq -0x3a0(%rbp), %rdi
movq %rdi, -0x580(%rbp)
leaq -0xf8(%rbp), %rsi
callq 0x2e530
movq -0x580(%rbp), %rdi
callq 0x12af0
movq %rax, -0x578(%rbp)
leaq -0x3b0(%rbp), %rdi
movq %rdi, -0x570(%rbp)
leaq -0x1a8(%rbp), %rsi
callq 0xd550
movq -0x578(%rbp), %rdi
movq -0x570(%rbp), %rsi
callq 0x386d0
jmp 0x24978
leaq -0x3b0(%rbp), %rdi
callq 0x99e0
leaq -0x3a0(%rbp), %rdi
callq 0x12910
leaq -0x1c0(%rbp), %rdi
callq 0x9980
leaq -0x1a8(%rbp), %rdi
callq 0x99e0
jmp 0x24a87
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x249d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x348(%rbp), %rdi
callq 0x61c0
leaq -0x328(%rbp), %rdi
callq 0x99e0
jmp 0x24a6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
testb $0x1, -0x359(%rbp)
jne 0x249fb
jmp 0x24a07
leaq -0x358(%rbp), %rdi
callq 0x99e0
jmp 0x24a6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x24a3b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x370(%rbp), %rdi
callq 0x11fa0
leaq -0x380(%rbp), %rdi
callq 0x12b30
leaq -0x390(%rbp), %rdi
callq 0x12910
jmp 0x24a6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x3b0(%rbp), %rdi
callq 0x99e0
leaq -0x3a0(%rbp), %rdi
callq 0x12910
leaq -0x1c0(%rbp), %rdi
callq 0x9980
leaq -0x1a8(%rbp), %rdi
callq 0x99e0
jmp 0x24aa7
leaq -0xf8(%rbp), %rdi
callq 0x11f60
movl -0xe4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe4(%rbp)
jmp 0x23d64
leaq -0xf8(%rbp), %rdi
callq 0x11f60
jmp 0x25044
movl $0x0, -0x3b4(%rbp)
cmpl $0x14, -0x3b4(%rbp)
jge 0x2503b
callq 0x60c0
movl $0x12, %ecx
cltd
idivl %ecx
movl %edx, -0x3b8(%rbp)
leaq -0x3c8(%rbp), %rdi
callq 0x2f210
cmpl $0x0, -0x3b8(%rbp)
jl 0x24b43
cmpl $0x3, -0x3b8(%rbp)
jg 0x24b43
leaq -0x3d8(%rbp), %rdi
callq 0x12b50
jmp 0x24b0e
leaq -0x3c8(%rbp), %rdi
leaq -0x3d8(%rbp), %rsi
callq 0x2f230
leaq -0x3d8(%rbp), %rdi
callq 0x12bf0
jmp 0x24c99
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x2502d
cmpl $0x4, -0x3b8(%rbp)
jl 0x24b87
cmpl $0x6, -0x3b8(%rbp)
jg 0x24b87
leaq -0x3e8(%rbp), %rdi
callq 0x12c10
jmp 0x24b63
leaq -0x3c8(%rbp), %rdi
leaq -0x3e8(%rbp), %rsi
callq 0x2f260
leaq -0x3e8(%rbp), %rdi
callq 0x12cb0
jmp 0x24c97
cmpl $0x7, -0x3b8(%rbp)
jl 0x24bcb
cmpl $0xb, -0x3b8(%rbp)
jg 0x24bcb
leaq -0x3f8(%rbp), %rdi
callq 0x12f10
jmp 0x24ba7
leaq -0x3c8(%rbp), %rdi
leaq -0x3f8(%rbp), %rsi
callq 0x2f290
leaq -0x3f8(%rbp), %rdi
callq 0x12fb0
jmp 0x24c95
cmpl $0xc, -0x3b8(%rbp)
jl 0x24c0f
cmpl $0xd, -0x3b8(%rbp)
jg 0x24c0f
leaq -0x408(%rbp), %rdi
callq 0x12cd0
jmp 0x24beb
leaq -0x3c8(%rbp), %rdi
leaq -0x408(%rbp), %rsi
callq 0x2f2c0
leaq -0x408(%rbp), %rdi
callq 0x12d70
jmp 0x24c93
cmpl $0xe, -0x3b8(%rbp)
jl 0x24c50
cmpl $0xf, -0x3b8(%rbp)
jg 0x24c50
leaq -0x418(%rbp), %rdi
callq 0x12d90
jmp 0x24c2f
leaq -0x3c8(%rbp), %rdi
leaq -0x418(%rbp), %rsi
callq 0x2f2f0
leaq -0x418(%rbp), %rdi
callq 0x12e30
jmp 0x24c91
cmpl $0x10, -0x3b8(%rbp)
jl 0x24c8f
cmpl $0x11, -0x3b8(%rbp)
jg 0x24c8f
leaq -0x428(%rbp), %rdi
callq 0x12e50
jmp 0x24c70
leaq -0x3c8(%rbp), %rdi
leaq -0x428(%rbp), %rsi
callq 0x2f320
leaq -0x428(%rbp), %rdi
callq 0x12ef0
jmp 0x24c91
jmp 0x24c93
jmp 0x24c95
jmp 0x24c97
jmp 0x24c99
jmp 0x24c9b
callq 0x60c0
movq -0x490(%rbp), %rdi
movl %eax, -0x588(%rbp)
addq $0xe0, %rdi
callq 0xd5e0
movq %rax, %rcx
movl -0x588(%rbp), %eax
cltd
idivl %ecx
movl %edx, -0x30(%rbp)
callq 0x60c0
movq -0x490(%rbp), %rdi
movl %eax, -0x584(%rbp)
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
callq 0xd010
movq %rax, %rcx
movl -0x584(%rbp), %eax
cltd
idivl %ecx
movl %edx, -0x10(%rbp)
movq -0x490(%rbp), %rdi
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x2dc70
movq %rax, %rdi
callq 0x2e040
movq %rax, %rsi
movb $0x0, -0x449(%rbp)
movb $0x0, -0x461(%rbp)
leaq -0x438(%rbp), %rdi
callq 0x3bfc0
jmp 0x24d4b
leaq -0x438(%rbp), %rdi
callq 0x2e370
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x589(%rbp)
jne 0x24e73
movq -0x490(%rbp), %rdi
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x2dc70
movq %rax, %rdi
callq 0x2e040
movq %rax, %rsi
leaq -0x448(%rbp), %rdi
callq 0x3c020
jmp 0x24da6
movb $0x1, -0x449(%rbp)
leaq -0x448(%rbp), %rdi
callq 0x2e350
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x589(%rbp)
jne 0x24e73
movq -0x490(%rbp), %rdi
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x2dc70
movq %rax, %rdi
callq 0x2e040
movq %rax, %rsi
leaq -0x460(%rbp), %rdi
callq 0x3bf60
jmp 0x24e08
movb $0x1, -0x461(%rbp)
leaq -0x460(%rbp), %rdi
callq 0x2e330
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x589(%rbp)
jne 0x24e73
movq -0x490(%rbp), %rdi
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x2dc70
movq %rax, %rdi
callq 0x2e040
movq %rax, %rdi
callq 0x3c080
movb %al, -0x58a(%rbp)
jmp 0x24e65
movb -0x58a(%rbp), %al
movb %al, -0x589(%rbp)
jmp 0x24e73
movb -0x589(%rbp), %al
movb %al, -0x58b(%rbp)
testb $0x1, -0x461(%rbp)
jne 0x24e8a
jmp 0x24e96
leaq -0x460(%rbp), %rdi
callq 0x11fa0
testb $0x1, -0x449(%rbp)
jne 0x24ea1
jmp 0x24ead
leaq -0x448(%rbp), %rdi
callq 0x11f60
leaq -0x438(%rbp), %rdi
callq 0x11f80
movb -0x58b(%rbp), %al
testb $0x1, %al
jne 0x24c9b
movq -0x490(%rbp), %rdi
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x2dc70
movq %rax, %rdi
callq 0x2e040
movq %rax, -0x5a0(%rbp)
leaq -0x478(%rbp), %rdi
movq %rdi, -0x598(%rbp)
leaq -0x3c8(%rbp), %rsi
callq 0x2f350
movq -0x5a0(%rbp), %rdi
movq -0x598(%rbp), %rsi
callq 0x3bf90
jmp 0x24f28
leaq -0x478(%rbp), %rdi
callq 0x11fa0
movq -0x490(%rbp), %rax
movq %rax, %rdi
addq $0x58, %rdi
movl 0x108(%rax), %eax
decl %eax
movslq %eax, %rsi
callq 0x12870
movq -0x490(%rbp), %rdi
movq %rax, -0x5a8(%rbp)
addq $0xe0, %rdi
movslq -0x30(%rbp), %rsi
callq 0x12870
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x2dc70
movq -0x5a8(%rbp), %rdi
movq %rax, %rsi
callq 0x2f380
jmp 0x24f8d
leaq -0x3c8(%rbp), %rdi
callq 0x2ec80
movl -0x3b4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3b4(%rbp)
jmp 0x24ac2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x25007
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x24fee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
testb $0x1, -0x461(%rbp)
jne 0x24fe0
jmp 0x24fec
leaq -0x460(%rbp), %rdi
callq 0x11fa0
jmp 0x24fee
testb $0x1, -0x449(%rbp)
jne 0x24ff9
jmp 0x25005
leaq -0x448(%rbp), %rdi
callq 0x11f60
jmp 0x25007
leaq -0x438(%rbp), %rdi
callq 0x11f80
jmp 0x2502d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x478(%rbp), %rdi
callq 0x11fa0
leaq -0x3c8(%rbp), %rdi
callq 0x2ec80
jmp 0x25044
addq $0x5b0, %rsp            # imm = 0x5B0
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x6540
nopl (%rax)