// File: kaiming[P]Chamber-Crawler-3k/Board/board.cc
// Function: Board::movePlayer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string Board::movePlayer(std::string direction) {
    std::shared_ptr<WalkableTile> destination = validDest(player, direction);
    std::string message = "";

    // Check if valid destination
    if (destination == nullptr) {
        return "Invalid Move Target. ";
    }

    // Check if destination is exit
    if (destination->isExit()) {
        if (floorNum == static_cast<int>(floors.size())) {
            // Game completed
            return "Dungeon cleared. You win!";
        } else {
            // Proceed to next floor
            changeFloor();
            return "Floor " + std::to_string(floorNum - 1) + " cleared. Proceeding to next floor. ";
        }
        
    }

    // Check if destination is occupied by an enemy
    if (destination->getOccupant() != nullptr) {
        return "Target Tile occupied by Enemy. ";
    }

    // Check if destination is occupied by a potion
    if (destination->getPotion() != nullptr) {
        // DLC EXTENSION LOCATION: Change this behaviour if we want to make potions walk-over to use
        return "Target Tile occupied by Potion. ";
    }

    // Check if destination is occupied by gold
    if (destination->getGold() != nullptr) {
        
        // Get gold pointer
        std::shared_ptr<Gold> gold = destination->getGold();
        
        // Check if Dragon Hoard
        if (std::dynamic_pointer_cast<DragonHoard>(gold)) {
            // Check if dragon is dead
            if (std::dynamic_pointer_cast<DragonHoard>(gold)->getDragon()->getState() == false) {
                // Dragon is dead
                // Player picks up gold
                std::dynamic_pointer_cast<Player>(player->getOccupant())->setGold(std::dynamic_pointer_cast<Player>(player->getOccupant())->getGold() + gold->getSize());
                // Gold is consumed
                message = gold->getType() + ", value " + std::to_string(gold->getSize()) + ", picked up. ";

                // Remove from dragonHoards
                for (auto it = dragonHoards[floorNum-1].begin(); it != dragonHoards[floorNum-1].end(); it++) {
                    if ((*it)->getGold() == gold) {
                        dragonHoards[floorNum-1].erase(it);
                        break;
                    }
                }

                destination->setGold(nullptr); 
            }

            // Dragon is still alive; Else do nothing

        } else {
            // Player picks up gold
            std::dynamic_pointer_cast<Player>(player->getOccupant())->setGold(std::dynamic_pointer_cast<Player>(player->getOccupant())->getGold() + gold->getSize());
            // Gold is consumed
            message = gold->getType() + ", value " + std::to_string(gold->getSize()) + ", picked up. ";
            destination->setGold(nullptr); 
        }
    

    }

    // Move the Player
    player = player->move(destination);
    message = playerPtr->getRace() + " moved " + direction + ". " + message;

    // Potion detection
    // Check surrounding tiles for potions
    std::shared_ptr<WalkableTile> target = nullptr;
    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");

    for (int i = 0; i < static_cast<int>(directions.size()); i++) {
        // Check if the direction is a WalkableTile and has a potion
        target = validDest(player, directions[i]);
        if (target && target->getPotion()) {
            // Potion found 
            std::string type = target->getPotion()->getType();

            // Search to see if type is in potionsUsed
            if (std::find(potionsUsed.begin(), potionsUsed.end(), type) != potionsUsed.end()) {
                // Potion found
                message += playerPtr->getRace() + " sees a " + type + " potion. ";
            } else {
                // Potion not found
                message += playerPtr->getRace() + " sees an unknown potion. ";
            }
        }
    }

    // Exit not reached
    return message;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x880, %rsp            # imm = 0x880
movq %rdx, -0x708(%rbp)
movq %rdi, -0x720(%rbp)
movq %rdi, %rax
movq %rax, -0x718(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rsi
movq %rsi, -0x710(%rbp)
addq $0xb8, %rsi
leaq -0x38(%rbp), %rdi
callq 0xd550
movq -0x708(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x6130
jmp 0x264ac
movq -0x710(%rbp), %rsi
leaq -0x28(%rbp), %rdi
leaq -0x38(%rbp), %rdx
leaq -0x58(%rbp), %rcx
callq 0x250e0
jmp 0x264c6
leaq -0x58(%rbp), %rdi
callq 0x61c0
leaq -0x38(%rbp), %rdi
callq 0x99e0
leaq -0x89(%rbp), %rdi
movq %rdi, -0x728(%rbp)
callq 0x6550
movq -0x728(%rbp), %rdx
leaq 0x1793e(%rip), %rsi     # 0x3de37
leaq -0x88(%rbp), %rdi
callq 0x8a00
jmp 0x26507
leaq -0x89(%rbp), %rdi
callq 0x6340
leaq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x12ac0
testb $0x1, %al
jne 0x26529
jmp 0x265de
leaq -0x8a(%rbp), %rdi
movq %rdi, -0x730(%rbp)
callq 0x6550
movq -0x720(%rbp), %rdi
movq -0x730(%rbp), %rdx
leaq 0x1773f(%rip), %rsi     # 0x3dc90
callq 0x8a00
jmp 0x26558
leaq -0x8a(%rbp), %rdi
callq 0x6340
movl $0x1, -0x90(%rbp)
jmp 0x27db4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x26596
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x61c0
leaq -0x38(%rbp), %rdi
callq 0x99e0
jmp 0x27dee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x89(%rbp), %rdi
callq 0x6340
jmp 0x27de5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x8a(%rbp), %rdi
callq 0x6340
jmp 0x27dd9
leaq -0x28(%rbp), %rdi
callq 0x2e040
movq %rax, %rdi
callq 0x3c080
movb %al, -0x731(%rbp)
jmp 0x265f7
movb -0x731(%rbp), %al
testb $0x1, %al
jne 0x26606
jmp 0x26764
movq -0x710(%rbp), %rdi
movl 0x108(%rdi), %eax
movl %eax, -0x738(%rbp)
callq 0xad20
movq %rax, %rcx
movl -0x738(%rbp), %eax
cmpl %ecx, %eax
jne 0x266a3
leaq -0x91(%rbp), %rdi
movq %rdi, -0x740(%rbp)
callq 0x6550
movq -0x720(%rbp), %rdi
movq -0x740(%rbp), %rdx
leaq 0x16cc6(%rip), %rsi     # 0x3d319
callq 0x8a00
jmp 0x2665a
leaq -0x91(%rbp), %rdi
callq 0x6340
movl $0x1, -0x90(%rbp)
jmp 0x27db4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x27dd9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x91(%rbp), %rdi
callq 0x6340
jmp 0x27dd9
movq -0x710(%rbp), %rdi
callq 0x26250
jmp 0x266b1
movq -0x710(%rbp), %rax
movl 0x108(%rax), %esi
decl %esi
leaq -0xd8(%rbp), %rdi
callq 0x8b10
jmp 0x266ce
leaq 0x175d1(%rip), %rsi     # 0x3dca6
leaq -0xb8(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0x2e450
jmp 0x266ea
movq -0x720(%rbp), %rdi
leaq 0x175b5(%rip), %rdx     # 0x3dcad
leaq -0xb8(%rbp), %rsi
callq 0x2e400
jmp 0x26706
leaq -0xb8(%rbp), %rdi
callq 0x61c0
leaq -0xd8(%rbp), %rdi
callq 0x61c0
movl $0x1, -0x90(%rbp)
jmp 0x27db4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x26753
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x61c0
leaq -0xd8(%rbp), %rdi
callq 0x61c0
jmp 0x27dd9
leaq -0x28(%rbp), %rdi
callq 0x2e040
movq %rax, %rsi
leaq -0xe8(%rbp), %rdi
callq 0x3bf60
jmp 0x2677e
leaq -0xe8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2e4a0
movb %al, -0x741(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x11fa0
movb -0x741(%rbp), %al
testb $0x1, %al
jne 0x267ac
jmp 0x26813
leaq -0xe9(%rbp), %rdi
movq %rdi, -0x750(%rbp)
callq 0x6550
movq -0x720(%rbp), %rdi
movq -0x750(%rbp), %rdx
leaq 0x174fe(%rip), %rsi     # 0x3dcd2
callq 0x8a00
jmp 0x267db
leaq -0xe9(%rbp), %rdi
callq 0x6340
movl $0x1, -0x90(%rbp)
jmp 0x27db4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xe9(%rbp), %rdi
callq 0x6340
jmp 0x27dd9
leaq -0x28(%rbp), %rdi
callq 0x2e040
movq %rax, %rsi
leaq -0x100(%rbp), %rdi
callq 0x3bfc0
jmp 0x2682d
leaq -0x100(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2e4d0
movb %al, -0x751(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x11f80
movb -0x751(%rbp), %al
testb $0x1, %al
jne 0x2685b
jmp 0x268c2
leaq -0x101(%rbp), %rdi
movq %rdi, -0x760(%rbp)
callq 0x6550
movq -0x720(%rbp), %rdi
movq -0x760(%rbp), %rdx
leaq 0x1746f(%rip), %rsi     # 0x3dcf2
callq 0x8a00
jmp 0x2688a
leaq -0x101(%rbp), %rdi
callq 0x6340
movl $0x1, -0x90(%rbp)
jmp 0x27db4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x101(%rbp), %rdi
callq 0x6340
jmp 0x27dd9
leaq -0x28(%rbp), %rdi
callq 0x2e040
movq %rax, %rsi
leaq -0x118(%rbp), %rdi
callq 0x3c020
jmp 0x268dc
leaq -0x118(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2e500
movb %al, -0x761(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x11f60
movb -0x761(%rbp), %al
testb $0x1, %al
jne 0x2690d
jmp 0x271fe
leaq -0x28(%rbp), %rdi
callq 0x2e040
movq %rax, %rsi
leaq -0x128(%rbp), %rdi
callq 0x3c020
jmp 0x26927
leaq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x2e530
leaq -0x138(%rbp), %rdi
callq 0x2e5c0
movb %al, -0x762(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x12910
movb -0x762(%rbp), %al
testb $0x1, %al
jne 0x26967
jmp 0x26eb7
leaq -0x158(%rbp), %rdi
movq %rdi, -0x770(%rbp)
leaq -0x128(%rbp), %rsi
callq 0x2e530
movq -0x770(%rbp), %rdi
callq 0x12af0
movq %rax, %rsi
leaq -0x148(%rbp), %rdi
callq 0x38670
jmp 0x2699e
leaq -0x148(%rbp), %rdi
callq 0x2e5e0
movq %rax, %rdi
callq 0x348b0
movb %al, -0x771(%rbp)
jmp 0x269ba
movb -0x771(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x778(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x12b30
leaq -0x158(%rbp), %rdi
callq 0x12910
movl -0x778(%rbp), %eax
cmpl $0x0, %eax
jne 0x26eb2
movq -0x710(%rbp), %rdi
addq $0xb8, %rdi
callq 0x2e040
movq %rax, %rsi
leaq -0x178(%rbp), %rdi
callq 0x3bf60
jmp 0x26a16
leaq -0x168(%rbp), %rdi
movq %rdi, -0x788(%rbp)
leaq -0x178(%rbp), %rsi
callq 0x2e600
movq -0x788(%rbp), %rdi
callq 0x2e020
movq -0x710(%rbp), %rdi
movq %rax, -0x780(%rbp)
addq $0xb8, %rdi
callq 0x2e040
movq %rax, %rsi
leaq -0x198(%rbp), %rdi
callq 0x3bf60
jmp 0x26a67
leaq -0x188(%rbp), %rdi
movq %rdi, -0x798(%rbp)
leaq -0x198(%rbp), %rsi
callq 0x2e600
movq -0x798(%rbp), %rdi
callq 0x2e020
movq %rax, %rdi
callq 0x396b0
movl %eax, -0x78c(%rbp)
jmp 0x26a9d
leaq -0x128(%rbp), %rdi
callq 0x2e690
movq %rax, %rdi
callq 0x388a0
movl %eax, -0x79c(%rbp)
jmp 0x26ab9
movq -0x780(%rbp), %rdi
movl -0x79c(%rbp), %eax
movl -0x78c(%rbp), %esi
addl %eax, %esi
callq 0x396d0
jmp 0x26ad5
leaq -0x188(%rbp), %rdi
callq 0x9960
leaq -0x198(%rbp), %rdi
callq 0x11fa0
leaq -0x168(%rbp), %rdi
callq 0x9960
leaq -0x178(%rbp), %rdi
callq 0x11fa0
leaq -0x128(%rbp), %rdi
callq 0x2e690
movq %rax, %rsi
leaq -0x218(%rbp), %rdi
callq 0x388c0
jmp 0x26b22
leaq 0x171ea(%rip), %rdx     # 0x3dd13
leaq -0x1f8(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0x2e400
jmp 0x26b3e
leaq -0x128(%rbp), %rdi
callq 0x2e690
movq %rax, %rdi
callq 0x388a0
movl %eax, -0x7a0(%rbp)
jmp 0x26b5a
movl -0x7a0(%rbp), %esi
leaq -0x238(%rbp), %rdi
callq 0x8b10
jmp 0x26b6e
leaq -0x1d8(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
leaq -0x238(%rbp), %rdx
callq 0x2e6b0
jmp 0x26b8a
leaq 0x1718b(%rip), %rdx     # 0x3dd1c
leaq -0x1b8(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x2e400
jmp 0x26ba6
leaq -0x88(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x63c0
leaq -0x1b8(%rbp), %rdi
callq 0x61c0
leaq -0x1d8(%rbp), %rdi
callq 0x61c0
leaq -0x238(%rbp), %rdi
callq 0x61c0
leaq -0x1f8(%rbp), %rdi
callq 0x61c0
leaq -0x218(%rbp), %rdi
callq 0x61c0
movq -0x710(%rbp), %rax
movq %rax, %rdi
addq $0x70, %rdi
movl 0x108(%rax), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x12870
movq %rax, %rdi
callq 0x1e020
movq %rax, -0x240(%rbp)
movq -0x710(%rbp), %rax
movq %rax, %rdi
addq $0x70, %rdi
movl 0x108(%rax), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x12870
movq %rax, %rdi
callq 0x1ddd0
movq %rax, -0x248(%rbp)
leaq -0x240(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x2e780
testb $0x1, %al
jne 0x26c6d
jmp 0x26e4b
leaq -0x240(%rbp), %rdi
callq 0x1e350
movq %rax, %rdi
callq 0x2e040
movq %rax, %rsi
leaq -0x258(%rbp), %rdi
callq 0x3c020
jmp 0x26c92
leaq -0x258(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x2e7c0
movb %al, -0x7a1(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x11f60
movb -0x7a1(%rbp), %al
testb $0x1, %al
jne 0x26cc6
jmp 0x26e2f
movq -0x710(%rbp), %rax
movq %rax, %rdi
addq $0x70, %rdi
movl 0x108(%rax), %eax
decl %eax
movslq %eax, %rsi
callq 0x12870
movq %rax, -0x7b8(%rbp)
leaq -0x260(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x2e870
movq -0x7b8(%rbp), %rdi
movq -0x260(%rbp), %rsi
callq 0x2e800
movq %rax, -0x7b0(%rbp)
jmp 0x26d1a
movq -0x7b0(%rbp), %rax
movq %rax, -0x268(%rbp)
jmp 0x26e4b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x26d53
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x12b30
leaq -0x158(%rbp), %rdi
callq 0x12910
jmp 0x271ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x271ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x26da7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x9960
leaq -0x198(%rbp), %rdi
callq 0x11fa0
leaq -0x168(%rbp), %rdi
callq 0x9960
leaq -0x178(%rbp), %rdi
callq 0x11fa0
jmp 0x271ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x26e1e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x26e12
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x26e06
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x61c0
leaq -0x238(%rbp), %rdi
callq 0x61c0
leaq -0x1f8(%rbp), %rdi
callq 0x61c0
leaq -0x218(%rbp), %rdi
callq 0x61c0
jmp 0x271ed
jmp 0x26e31
leaq -0x240(%rbp), %rdi
xorl %esi, %esi
callq 0x2e8b0
movq %rax, -0x270(%rbp)
jmp 0x26c23
leaq -0x28(%rbp), %rdi
callq 0x2e040
movq %rax, -0x7c8(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x280(%rbp), %rdi
movq %rdi, -0x7c0(%rbp)
callq 0x11f40
movq -0x7c8(%rbp), %rdi
movq -0x7c0(%rbp), %rsi
callq 0x3c050
jmp 0x26e87
leaq -0x280(%rbp), %rdi
callq 0x11f60
jmp 0x26eb2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x11f60
jmp 0x271ed
jmp 0x271df
movq -0x710(%rbp), %rdi
addq $0xb8, %rdi
callq 0x2e040
movq %rax, %rsi
leaq -0x2a0(%rbp), %rdi
callq 0x3bf60
jmp 0x26edb
leaq -0x290(%rbp), %rdi
movq %rdi, -0x7d8(%rbp)
leaq -0x2a0(%rbp), %rsi
callq 0x2e600
movq -0x7d8(%rbp), %rdi
callq 0x2e020
movq -0x710(%rbp), %rdi
movq %rax, -0x7d0(%rbp)
addq $0xb8, %rdi
callq 0x2e040
movq %rax, %rsi
leaq -0x2c0(%rbp), %rdi
callq 0x3bf60
jmp 0x26f2c
leaq -0x2b0(%rbp), %rdi
movq %rdi, -0x7e8(%rbp)
leaq -0x2c0(%rbp), %rsi
callq 0x2e600
movq -0x7e8(%rbp), %rdi
callq 0x2e020
movq %rax, %rdi
callq 0x396b0
movl %eax, -0x7dc(%rbp)
jmp 0x26f62
leaq -0x128(%rbp), %rdi
callq 0x2e690
movq %rax, %rdi
callq 0x388a0
movl %eax, -0x7ec(%rbp)
jmp 0x26f7e
movq -0x7d0(%rbp), %rdi
movl -0x7ec(%rbp), %eax
movl -0x7dc(%rbp), %esi
addl %eax, %esi
callq 0x396d0
jmp 0x26f9a
leaq -0x2b0(%rbp), %rdi
callq 0x9960
leaq -0x2c0(%rbp), %rdi
callq 0x11fa0
leaq -0x290(%rbp), %rdi
callq 0x9960
leaq -0x2a0(%rbp), %rdi
callq 0x11fa0
leaq -0x128(%rbp), %rdi
callq 0x2e690
movq %rax, %rsi
leaq -0x340(%rbp), %rdi
callq 0x388c0
jmp 0x26fe7
leaq 0x16d25(%rip), %rdx     # 0x3dd13
leaq -0x320(%rbp), %rdi
leaq -0x340(%rbp), %rsi
callq 0x2e400
jmp 0x27003
leaq -0x128(%rbp), %rdi
callq 0x2e690
movq %rax, %rdi
callq 0x388a0
movl %eax, -0x7f0(%rbp)
jmp 0x2701f
movl -0x7f0(%rbp), %esi
leaq -0x360(%rbp), %rdi
callq 0x8b10
jmp 0x27033
leaq -0x300(%rbp), %rdi
leaq -0x320(%rbp), %rsi
leaq -0x360(%rbp), %rdx
callq 0x2e6b0
jmp 0x2704f
leaq 0x16cc6(%rip), %rdx     # 0x3dd1c
leaq -0x2e0(%rbp), %rdi
leaq -0x300(%rbp), %rsi
callq 0x2e400
jmp 0x2706b
leaq -0x88(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
movq %rsi, -0x808(%rbp)
callq 0x63c0
movq -0x808(%rbp), %rdi
callq 0x61c0
leaq -0x300(%rbp), %rdi
callq 0x61c0
leaq -0x360(%rbp), %rdi
callq 0x61c0
leaq -0x320(%rbp), %rdi
callq 0x61c0
leaq -0x340(%rbp), %rdi
callq 0x61c0
leaq -0x28(%rbp), %rdi
callq 0x2e040
movq %rax, -0x800(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x370(%rbp), %rdi
movq %rdi, -0x7f8(%rbp)
callq 0x11f40
movq -0x800(%rbp), %rdi
movq -0x7f8(%rbp), %rsi
callq 0x3c050
jmp 0x270fd
leaq -0x370(%rbp), %rdi
callq 0x11f60
jmp 0x271df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x27140
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x2b0(%rbp), %rdi
callq 0x9960
leaq -0x2c0(%rbp), %rdi
callq 0x11fa0
leaq -0x290(%rbp), %rdi
callq 0x9960
leaq -0x2a0(%rbp), %rdi
callq 0x11fa0
jmp 0x271ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x271b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x271ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2719f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x61c0
leaq -0x360(%rbp), %rdi
callq 0x61c0
leaq -0x320(%rbp), %rdi
callq 0x61c0
leaq -0x340(%rbp), %rdi
callq 0x61c0
jmp 0x271ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x370(%rbp), %rdi
callq 0x11f60
jmp 0x271ed
leaq -0x128(%rbp), %rdi
callq 0x11f60
jmp 0x271fe
leaq -0x128(%rbp), %rdi
callq 0x11f60
jmp 0x27dd9
movq -0x710(%rbp), %rdi
addq $0xb8, %rdi
callq 0x2e040
movq %rax, -0x818(%rbp)
leaq -0x390(%rbp), %rdi
movq %rdi, -0x810(%rbp)
leaq -0x28(%rbp), %rsi
callq 0xd550
movq -0x818(%rbp), %rsi
movq -0x810(%rbp), %rdx
leaq -0x380(%rbp), %rdi
callq 0x3c100
jmp 0x2724b
movq -0x710(%rbp), %rdi
addq $0xb8, %rdi
leaq -0x380(%rbp), %rsi
movq %rsi, -0x820(%rbp)
callq 0x2e8f0
movq -0x820(%rbp), %rdi
callq 0x99e0
leaq -0x390(%rbp), %rdi
callq 0x99e0
movq -0x710(%rbp), %rdi
addq $0xf8, %rdi
callq 0x2e020
movq %rax, %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x430(%rbp), %rdi
callq *%rax
jmp 0x272ab
leaq 0x16a78(%rip), %rdx     # 0x3dd2a
leaq -0x410(%rbp), %rdi
leaq -0x430(%rbp), %rsi
callq 0x2e400
jmp 0x272c7
movq -0x708(%rbp), %rdx
leaq -0x3f0(%rbp), %rdi
leaq -0x410(%rbp), %rsi
callq 0x2e920
jmp 0x272e3
leaq 0x16b4b(%rip), %rdx     # 0x3de35
leaq -0x3d0(%rbp), %rdi
leaq -0x3f0(%rbp), %rsi
callq 0x2e400
jmp 0x272ff
leaq -0x3b0(%rbp), %rdi
leaq -0x3d0(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x2e920
jmp 0x2731b
leaq -0x88(%rbp), %rdi
leaq -0x3b0(%rbp), %rsi
movq %rsi, -0x830(%rbp)
callq 0x63c0
movq -0x830(%rbp), %rdi
callq 0x61c0
leaq -0x3d0(%rbp), %rdi
callq 0x61c0
leaq -0x3f0(%rbp), %rdi
callq 0x61c0
leaq -0x410(%rbp), %rdi
callq 0x61c0
leaq -0x430(%rbp), %rdi
callq 0x61c0
xorl %eax, %eax
movl %eax, %esi
leaq -0x440(%rbp), %rdi
callq 0x2dc90
leaq -0x458(%rbp), %rdi
callq 0x2dcb0
leaq -0x479(%rbp), %rdi
movq %rdi, -0x828(%rbp)
callq 0x6550
movq -0x828(%rbp), %rdx
leaq 0x15f53(%rip), %rsi     # 0x3d301
leaq -0x478(%rbp), %rdi
callq 0x8a00
jmp 0x273bc
leaq -0x458(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0x2e970
jmp 0x273d1
leaq -0x478(%rbp), %rdi
callq 0x61c0
leaq -0x479(%rbp), %rdi
callq 0x6340
leaq -0x4a1(%rbp), %rdi
movq %rdi, -0x838(%rbp)
callq 0x6550
movq -0x838(%rbp), %rdx
leaq 0x15efd(%rip), %rsi     # 0x3d307
leaq -0x4a0(%rbp), %rdi
callq 0x8a00
jmp 0x27418
leaq -0x458(%rbp), %rdi
leaq -0x4a0(%rbp), %rsi
callq 0x2e970
jmp 0x2742d
leaq -0x4a0(%rbp), %rdi
callq 0x61c0
leaq -0x4a1(%rbp), %rdi
callq 0x6340
leaq -0x4c9(%rbp), %rdi
movq %rdi, -0x840(%rbp)
callq 0x6550
movq -0x840(%rbp), %rdx
leaq 0x15e9e(%rip), %rsi     # 0x3d304
leaq -0x4c8(%rbp), %rdi
callq 0x8a00
jmp 0x27474
leaq -0x458(%rbp), %rdi
leaq -0x4c8(%rbp), %rsi
callq 0x2e970
jmp 0x27489
leaq -0x4c8(%rbp), %rdi
callq 0x61c0
leaq -0x4c9(%rbp), %rdi
callq 0x6340
leaq -0x4f1(%rbp), %rdi
movq %rdi, -0x848(%rbp)
callq 0x6550
movq -0x848(%rbp), %rdx
leaq 0x15e48(%rip), %rsi     # 0x3d30a
leaq -0x4f0(%rbp), %rdi
callq 0x8a00
jmp 0x274d0
leaq -0x458(%rbp), %rdi
leaq -0x4f0(%rbp), %rsi
callq 0x2e970
jmp 0x274e5
leaq -0x4f0(%rbp), %rdi
callq 0x61c0
leaq -0x4f1(%rbp), %rdi
callq 0x6340
leaq -0x519(%rbp), %rdi
movq %rdi, -0x850(%rbp)
callq 0x6550
movq -0x850(%rbp), %rdx
leaq 0x15def(%rip), %rsi     # 0x3d30d
leaq -0x518(%rbp), %rdi
callq 0x8a00
jmp 0x2752c
leaq -0x458(%rbp), %rdi
leaq -0x518(%rbp), %rsi
callq 0x2e970
jmp 0x27541
leaq -0x518(%rbp), %rdi
callq 0x61c0
leaq -0x519(%rbp), %rdi
callq 0x6340
leaq -0x541(%rbp), %rdi
movq %rdi, -0x858(%rbp)
callq 0x6550
movq -0x858(%rbp), %rdx
leaq 0x15d96(%rip), %rsi     # 0x3d310
leaq -0x540(%rbp), %rdi
callq 0x8a00
jmp 0x27588
leaq -0x458(%rbp), %rdi
leaq -0x540(%rbp), %rsi
callq 0x2e970
jmp 0x2759d
leaq -0x540(%rbp), %rdi
callq 0x61c0
leaq -0x541(%rbp), %rdi
callq 0x6340
leaq -0x569(%rbp), %rdi
movq %rdi, -0x860(%rbp)
callq 0x6550
movq -0x860(%rbp), %rdx
leaq 0x15d3d(%rip), %rsi     # 0x3d313
leaq -0x568(%rbp), %rdi
callq 0x8a00
jmp 0x275e4
leaq -0x458(%rbp), %rdi
leaq -0x568(%rbp), %rsi
callq 0x2e970
jmp 0x275f9
leaq -0x568(%rbp), %rdi
callq 0x61c0
leaq -0x569(%rbp), %rdi
callq 0x6340
leaq -0x591(%rbp), %rdi
movq %rdi, -0x868(%rbp)
callq 0x6550
movq -0x868(%rbp), %rdx
leaq 0x15ce4(%rip), %rsi     # 0x3d316
leaq -0x590(%rbp), %rdi
callq 0x8a00
jmp 0x27640
leaq -0x458(%rbp), %rdi
leaq -0x590(%rbp), %rsi
callq 0x2e970
jmp 0x27655
leaq -0x590(%rbp), %rdi
callq 0x61c0
leaq -0x591(%rbp), %rdi
callq 0x6340
movl $0x0, -0x598(%rbp)
movl -0x598(%rbp), %eax
movl %eax, -0x86c(%rbp)
leaq -0x458(%rbp), %rdi
callq 0x2e9a0
movq %rax, %rcx
movl -0x86c(%rbp), %eax
cmpl %ecx, %eax
jge 0x27d63
movq -0x710(%rbp), %rsi
addq $0xb8, %rsi
leaq -0x5b8(%rbp), %rdi
callq 0xd550
movslq -0x598(%rbp), %rsi
leaq -0x458(%rbp), %rdi
callq 0x2e9c0
movq %rax, %rsi
leaq -0x5d8(%rbp), %rdi
callq 0x6130
jmp 0x276de
movq -0x710(%rbp), %rsi
leaq -0x5a8(%rbp), %rdi
leaq -0x5b8(%rbp), %rdx
leaq -0x5d8(%rbp), %rcx
callq 0x250e0
jmp 0x27701
leaq -0x440(%rbp), %rdi
leaq -0x5a8(%rbp), %rsi
callq 0x2e8f0
leaq -0x5a8(%rbp), %rdi
callq 0x99e0
leaq -0x5d8(%rbp), %rdi
callq 0x61c0
leaq -0x5b8(%rbp), %rdi
callq 0x99e0
leaq -0x440(%rbp), %rdi
callq 0x1ed00
movb %al, %cl
movb $0x0, -0x5e9(%rbp)
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x86d(%rbp)
jne 0x2775c
jmp 0x27792
leaq -0x440(%rbp), %rdi
callq 0x2e040
movq %rax, %rsi
leaq -0x5e8(%rbp), %rdi
callq 0x3bfc0
jmp 0x27779
movb $0x1, -0x5e9(%rbp)
leaq -0x5e8(%rbp), %rdi
callq 0x2e370
movb %al, -0x86d(%rbp)
movb -0x86d(%rbp), %al
movb %al, -0x86e(%rbp)
testb $0x1, -0x5e9(%rbp)
jne 0x277a9
jmp 0x277b5
leaq -0x5e8(%rbp), %rdi
callq 0x11f80
movb -0x86e(%rbp), %al
testb $0x1, %al
jne 0x277c4
jmp 0x27d4d
leaq -0x440(%rbp), %rdi
callq 0x2e040
movq %rax, %rsi
leaq -0x620(%rbp), %rdi
callq 0x3bfc0
jmp 0x277e1
leaq -0x620(%rbp), %rdi
callq 0x2e9e0
movq %rax, %rsi
leaq -0x610(%rbp), %rdi
callq 0x3ae10
jmp 0x277fe
leaq -0x620(%rbp), %rdi
callq 0x11f80
movq -0x710(%rbp), %rdi
addq $0xc8, %rdi
movq %rdi, -0x880(%rbp)
callq 0x2ea90
movq -0x880(%rbp), %rdi
movq %rax, -0x630(%rbp)
callq 0x2eac0
movq %rax, -0x638(%rbp)
movq -0x630(%rbp), %rdi
movq -0x638(%rbp), %rsi
leaq -0x610(%rbp), %rdx
callq 0x2ea40
movq %rax, -0x878(%rbp)
jmp 0x27861
movq -0x710(%rbp), %rdi
movq -0x878(%rbp), %rax
movq %rax, -0x628(%rbp)
addq $0xc8, %rdi
callq 0x2eac0
movq %rax, -0x640(%rbp)
leaq -0x628(%rbp), %rdi
leaq -0x640(%rbp), %rsi
callq 0x2ea00
testb $0x1, %al
jne 0x278a5
jmp 0x27c8b
movq -0x710(%rbp), %rdi
addq $0xf8, %rdi
callq 0x2e020
movq %rax, %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x6c0(%rbp), %rdi
callq *%rax
jmp 0x278cc
leaq 0x1645f(%rip), %rdx     # 0x3dd32
leaq -0x6a0(%rbp), %rdi
leaq -0x6c0(%rbp), %rsi
callq 0x2e400
jmp 0x278e8
leaq -0x680(%rbp), %rdi
leaq -0x6a0(%rbp), %rsi
leaq -0x610(%rbp), %rdx
callq 0x2e920
jmp 0x27904
leaq 0x16440(%rip), %rdx     # 0x3dd4b
leaq -0x660(%rbp), %rdi
leaq -0x680(%rbp), %rsi
callq 0x2e400
jmp 0x27920
leaq -0x88(%rbp), %rdi
leaq -0x660(%rbp), %rsi
callq 0x63f0
jmp 0x27935
leaq -0x660(%rbp), %rdi
callq 0x61c0
leaq -0x680(%rbp), %rdi
callq 0x61c0
leaq -0x6a0(%rbp), %rdi
callq 0x61c0
leaq -0x6c0(%rbp), %rdi
callq 0x61c0
jmp 0x27d31
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x390(%rbp), %rdi
callq 0x99e0
jmp 0x27dd9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x279e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x279d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x279c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x3d0(%rbp), %rdi
callq 0x61c0
leaq -0x3f0(%rbp), %rdi
callq 0x61c0
leaq -0x410(%rbp), %rdi
callq 0x61c0
leaq -0x430(%rbp), %rdi
callq 0x61c0
jmp 0x27dd9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x27a18
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x478(%rbp), %rdi
callq 0x61c0
leaq -0x479(%rbp), %rdi
callq 0x6340
jmp 0x27d9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x27a4f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x4a0(%rbp), %rdi
callq 0x61c0
leaq -0x4a1(%rbp), %rdi
callq 0x6340
jmp 0x27d9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x27a86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x4c8(%rbp), %rdi
callq 0x61c0
leaq -0x4c9(%rbp), %rdi
callq 0x6340
jmp 0x27d9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x27abd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x4f0(%rbp), %rdi
callq 0x61c0
leaq -0x4f1(%rbp), %rdi
callq 0x6340
jmp 0x27d9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x27af4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x518(%rbp), %rdi
callq 0x61c0
leaq -0x519(%rbp), %rdi
callq 0x6340
jmp 0x27d9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x27b2b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x540(%rbp), %rdi
callq 0x61c0
leaq -0x541(%rbp), %rdi
callq 0x6340
jmp 0x27d9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x27b62
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x568(%rbp), %rdi
callq 0x61c0
leaq -0x569(%rbp), %rdi
callq 0x6340
jmp 0x27d9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x27b99
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x590(%rbp), %rdi
callq 0x61c0
leaq -0x591(%rbp), %rdi
callq 0x6340
jmp 0x27d9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x27bd0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x5d8(%rbp), %rdi
callq 0x61c0
leaq -0x5b8(%rbp), %rdi
callq 0x99e0
jmp 0x27d9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x27d9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x620(%rbp), %rdi
callq 0x11f80
jmp 0x27d9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x27d3f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x27c7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x27c6e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x27c62
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x660(%rbp), %rdi
callq 0x61c0
leaq -0x680(%rbp), %rdi
callq 0x61c0
leaq -0x6a0(%rbp), %rdi
callq 0x61c0
leaq -0x6c0(%rbp), %rdi
callq 0x61c0
jmp 0x27d3f
movq -0x710(%rbp), %rdi
addq $0xf8, %rdi
callq 0x2e020
movq %rax, %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x700(%rbp), %rdi
callq *%rax
jmp 0x27cb2
leaq 0x16082(%rip), %rdx     # 0x3dd3b
leaq -0x6e0(%rbp), %rdi
leaq -0x700(%rbp), %rsi
callq 0x2e400
jmp 0x27cce
leaq -0x88(%rbp), %rdi
leaq -0x6e0(%rbp), %rsi
callq 0x63f0
jmp 0x27ce3
leaq -0x6e0(%rbp), %rdi
callq 0x61c0
leaq -0x700(%rbp), %rdi
callq 0x61c0
jmp 0x27d31
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x27d23
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x6e0(%rbp), %rdi
callq 0x61c0
leaq -0x700(%rbp), %rdi
callq 0x61c0
jmp 0x27d3f
leaq -0x610(%rbp), %rdi
callq 0x61c0
jmp 0x27d4d
leaq -0x610(%rbp), %rdi
callq 0x61c0
jmp 0x27d9a
jmp 0x27d4f
movl -0x598(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x598(%rbp)
jmp 0x27677
movq -0x720(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x61a0
movl $0x1, -0x90(%rbp)
leaq -0x458(%rbp), %rdi
callq 0x9980
leaq -0x440(%rbp), %rdi
callq 0x99e0
jmp 0x27db4
leaq -0x458(%rbp), %rdi
callq 0x9980
leaq -0x440(%rbp), %rdi
callq 0x99e0
jmp 0x27dd9
leaq -0x88(%rbp), %rdi
callq 0x61c0
leaq -0x28(%rbp), %rdi
callq 0x99e0
movq -0x718(%rbp), %rax
addq $0x880, %rsp            # imm = 0x880
popq %rbp
retq
leaq -0x88(%rbp), %rdi
callq 0x61c0
leaq -0x28(%rbp), %rdi
callq 0x99e0
movq -0x60(%rbp), %rdi
callq 0x6540
nopw (%rax,%rax)