// File: /workspace/github_cpp_makefile_star2_O3/kaiming[P]Chamber-Crawler-3k/main.cc
// Function: main
int main(int argc, char* argv[]) {
    bool restart = true;

    while (restart) {
        restart = false;

        std::ifstream infile;
        std::vector<std::vector<std::vector<std::shared_ptr<Tile>>>> floors;
        std::vector<std::shared_ptr<WalkableTile>> playerSpawns;
        std::vector<std::vector<std::shared_ptr<WalkableTile>>> enemies;
        std::vector<std::vector<std::shared_ptr<WalkableTile>>> dragonHoards;
        std::vector<bool> filled;
        int winner = -1; // code 0 for restart, code 1 for win, code 2 for loss

        // if no file is passed in command line
        if (argc == 1) {
            try { 
                infile.open("./default.txt");
            } catch (...) {
               std::cerr << "Error reading in default file" << std::endl;
               infile.close();
               return 1;
            }
            
        } else { // if there are at least one command line argument (only take the first one and try to open it as a file)
            try {
                // get file name 
                const std::string fileName {argv[1]};

                infile.open(fileName);
            } catch (...) {
                std::cerr << "Error reading in given file" << std::endl;
                infile.close();
                return 1;
            }
        } 

        // read in file for floor plan
        readFloorPlan(infile, floors, playerSpawns, enemies, dragonHoards, filled);

        // close file
        infile.close();

        TextDisplay td;

        // Ask player to enter one of the specified races or quit
        std::string race, in;

        std::cout << "Welcome to ChamberCrawler3000, prepare to enter the unknown!" << std::endl;
        
        // Extra Features menu
        std::cout << "Enter settings menu? (y or n): ";
        std::cin >> in;

        while (in != "y" && in != "n") {
            std::cerr << "Invalid option" << std::endl;
            std::cout << "Enter here: ";

            if (std::cin.fail()) {
                if (std::cin.eof()) return 0;

                std::cin.clear();
                std::cin.ignore();
            }

            std::cin >> in;
        }

        int seed = -1;
        bool enemyTracking = false;
        int radius = -1;

        if (in == "y") {
            std::cout << "Settings menu"<< std::endl;
            
            // Get seed
            std::cout << "Enter seed (int) or -1 to skip: ";
            std::cin >> seed;
            
            while (std::cin.fail()) {
                if (std::cin.eof()) return 0;

                std::cin.clear();
                std::cin.ignore();
                std::cout << "Invalid int."<< std::endl;
                std::cout << "Enter seed (int) or -1 to skip:";
                std::cin >> seed;
            }

            if (seed != -1) {
                std::cout << "Seed entered: " << std::to_string(seed) << std::endl;
            }


            // Get enemy tracking option
            std::cout << "Enable Enemy Tracking? (y or n): ";

            std::cin >> in;

            while (in != "y" && in != "n") {
                std::cerr << "Invalid option" << std::endl;
                std::cout << "Enter here: ";

                if (std::cin.fail()) {
                    if (std::cin.eof()) return 0;

                    std::cin.clear();
                    std::cin.ignore();
                }
                
                std::cin >> in;
            }

            if (in == "y") {
                enemyTracking = true;
                std::cout << "Enemy Tracking Enabled" << std::endl;
            } else if (in == "n") {
                enemyTracking = false;
                std::cout << "Enemy Tracking Disabled" << std::endl;
            }

            
            // If enemy tracking option activated, get difficulty
            if (enemyTracking) {
                std::cout << "Set Enemy Tracking difficulty (e, m, h): ";
                std::cin >> in;

                while (in != "e" && in != "m" && in != "h") {
                    std::cerr << "Invalid option" << std::endl;
                    std::cout << "Enter here: ";

                    if (std::cin.fail()) {
                        if (std::cin.eof()) return 0;

                        std::cin.clear();
                        std::cin.ignore();
                    }

                    std::cin >> in;
                }

                if (in == "e") {
                    radius = 2;
                    std::cout << "Enemy Tracking Difficulty: Easy (radius 2)" << std::endl;
                } else if (in == "m") {
                    radius = 3;
                    std::cout << "Enemy Tracking Difficulty: Medium (radius 3)" << std::endl;
                } else if (in == "h") {
                    radius = 4;
                    std::cout << "Enemy Tracking Difficulty: Hard (radius 4)" << std::endl;
                }

            }

            std::cout << "End of Settings menu." << std::endl;

        } else if (race == "n") {
            // Continue
            std::cout << "Settings menu bypassed." << std::endl;

        }



        std::cout << "Choose your character: Shade 's' (default), Drow 'd', Vampire 'v', Goblin 'g', Troll 't'" << std::endl;
        std::cout << "Enter here: ";

        std::getline(std::cin, race);
        std::getline(std::cin, race);



        while (race != "" && race != "s" && race != "d" && race != "v" && race != "g" && race != "t") {
            std::cerr << "Invalid race" << std::endl;
            std::cout << "Enter here: ";

            if (std::cin.fail()) {
                if (std::cin.eof()) return 0;

                std::cin.clear();
                std::cin.ignore();
            }

            std::cin >> std::noskipws >> race;
        }

        if (race == "q") {
            return 0; // NOTE: MAYBE HAVE IT SO A NEW GAME STARTS??
        } else if (race == "r") {
            restart = true; // Sort of useless LOL
            continue;
        } else if (race == "") { // default race
            race = "s";
        }

        std::cout << "Race selected: " + race << std::endl;
/*
    int seed = -1;
        bool enemyTracking = false;
        int radius = -1;
*/

        Board b = Board {floors, filled, playerSpawns, enemies, dragonHoards, race, seed, enemyTracking, radius};


        td.drawFloor(std::cout, b, "The adventure begins");

        std::string cmd;

        while (true) {
            std::cout << "Enter command: ";
            getline(std::cin, cmd);

            // break clause
            if (std::cin.fail()) {
                if (std::cin.eof()) {
                    return 0;
                }
            }

            // Process commands
            std::string message;

            if (cmd == "no" || cmd == "so" || cmd == "ea" || cmd == "we" || cmd == "ne" || cmd == "nw" || cmd == "se" || cmd == "sw") {
                // Move player in given direction
                message = b.movePlayer(cmd);

                if (message == "Dungeon cleared. You win!") {
                    // Game Won by Player
                    winner = 1;

                    break;
                } 

            } else if (static_cast<int>(cmd.length()) == 4 && cmd[0] == 'u') {
                // Use potion in given direction
                message = b.usePotion(cmd.substr(cmd.length() - 2));

            } else if (static_cast<int>(cmd.length()) == 4 && cmd[0] == 'a') {
                // Attack enemy in the given direction
                message = b.attackEnemy(cmd.substr(cmd.length() - 2));

            } else if (cmd == "f") {
                // Freeze enemies
                bool isFrozen = b.toggleFreeze();

                message = "Enemies Frozen: ";
                
                if (isFrozen) {
                    message += "Enabled ";
                 } else {
                    message += "Disabled ";
                 }

            } else if (cmd == "r") {
                // Restart game
                std::cout << "Resetting the game..." << std::endl;
                restart = true;
                winner = 0;

                break;
            } else if (cmd == "q") {
                // Quit Game
                std::cout << "You gave up! Better luck next time!" << std::endl;;

                return 0;
            } else {
                // Invalid Command
                std::cerr << "Invalid Command" << std::endl;
                continue;
            }

            // Move Enemies
            if (message.length () > 30 && message.substr(message.length()-26) == "Proceeding to next floor. ") {

            } else {
                std::string e_message = b.moveEnemies();

                if (e_message.length() == 0) {
                    e_message = "Enemies moved.";
                }

                message +=e_message;
            }
            

            td.drawFloor(std::cout, b, message);

            if (message.length() > 12 && message.substr(message.length()-10) == "Game Over!") {
                // Player killed and lost
                winner = 2;
                break;
            }

        } // End of Command Interpreter

        if (winner == 1) {
            // Print winner stuff
            
            std::cout << "Congratulations! You won!" << std::endl;
        } else if (winner == 2) {
            // Print loser stuff
            
            std::cout << "You have been defeated!" << std::endl;

        }

        if (winner != 0) {
            // Ask Player if they want to play again
            std::cout << "Play again? y or n" << std::endl;
            std::string replay = "";
            
            while (replay != "y" && replay != "n") {
                if (replay != "") {
                    std::cerr << "Invalid Answer" << std::endl;
                }
                
                std::cin >> replay;

                if (std::cin.fail()) {
                    if (std::cin.eof()) return 0;

                    std::cin.clear();
                    std::cin.ignore();
                }
            }

            if (replay == "y") {
                restart = true;
            }
        }

    } // End of restart loop

    

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5c8, %rsp            # imm = 0x5C8
movq %rsi, 0x208(%rsp)
movl %edi, 0x9c(%rsp)
leaq 0x3c0(%rsp), %r14
movq 0x1f855(%rip), %r12     # 0x24ff0
movq 0x1f826(%rip), %r13     # 0x24fc8
movq 0x1f82f(%rip), %r15     # 0x24fd8
leaq 0xc8(%rsp), %rbx
leaq 0x15902(%rip), %rbp     # 0x1b0ba
movl $0x0, 0x8(%rsp)
movq %r14, %rdi
callq 0x5240
xorl %eax, %eax
movq %rax, 0x200(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x1f0(%rsp)
movq %rax, 0x1e0(%rsp)
movaps %xmm0, 0x1d0(%rsp)
movq %rax, 0x1c0(%rsp)
movaps %xmm0, 0x1b0(%rsp)
movq %rax, 0x1a0(%rsp)
movaps %xmm0, 0x190(%rsp)
movq %rax, 0xe8(%rsp)
movl %eax, 0xf0(%rsp)
movq %rax, 0xf8(%rsp)
movl %eax, 0x100(%rsp)
movq %rax, 0x108(%rsp)
cmpl $0x1, 0x9c(%rsp)
jne 0x5853
movq %r14, %rdi
leaq 0x157bd(%rip), %rsi     # 0x1b004
movl $0x8, %edx
callq 0x5130
jmp 0x58b6
movq 0x208(%rsp), %rax
movq 0x8(%rax), %rsi
leaq 0x2b0(%rsp), %r14
movq %r14, %rdi
leaq 0x58(%rsp), %rdx
callq 0x72c4
leaq 0x3c0(%rsp), %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x51a0
movq 0x2b0(%rsp), %rdi
leaq 0x2c0(%rsp), %rax
cmpq %rax, %rdi
je 0x58ae
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0x3c0(%rsp), %r14
movq %r14, %rdi
leaq 0x1f0(%rsp), %rsi
leaq 0x1d0(%rsp), %rdx
leaq 0x1b0(%rsp), %rcx
leaq 0x190(%rsp), %r8
leaq 0xe8(%rsp), %r9
callq 0x7f56
movq %r14, %rdi
callq 0x5060
leaq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x60(%rsp)
movb %cl, 0x68(%rsp)
leaq 0xd8(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq %rcx, 0xd0(%rsp)
movb %cl, 0xd8(%rsp)
movl $0x3c, %edx
movq %r13, %rdi
leaq 0x1571b(%rip), %rsi     # 0x1b04c
callq 0x5250
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movl $0x1f, %edx
movq %r13, %rdi
leaq 0x1571c(%rip), %rsi     # 0x1b089
callq 0x5250
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5280
movq %rbx, %rdi
leaq 0x15722(%rip), %rsi     # 0x1b0a9
callq 0x50a0
testl %eax, %eax
je 0x5a31
movq %rbx, %rdi
leaq 0x15a55(%rip), %rsi     # 0x1b3f3
callq 0x50a0
testl %eax, %eax
je 0x5a31
movl $0xe, %edx
movq %r12, %rdi
leaq 0x156f1(%rip), %rsi     # 0x1b0ab
callq 0x5250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movl $0xc, %edx
movq %r13, %rdi
movq %rbp, %rsi
callq 0x5250
movq (%r15), %rax
movq -0x18(%rax), %rdi
movl 0x20(%r15,%rdi), %eax
testb $0x5, %al
je 0x5a21
testb $0x2, %al
jne 0x6c4f
addq %r15, %rdi
xorl %esi, %esi
callq 0x5360
movq %r15, %rdi
callq 0x53a0
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5280
jmp 0x597d
movl $0xffffffff, 0x10(%rsp) # imm = 0xFFFFFFFF
movq %rbx, %rdi
leaq 0x15666(%rip), %rsi     # 0x1b0a9
callq 0x50a0
testl %eax, %eax
je 0x6594
leaq 0x58(%rsp), %rdi
leaq 0x15997(%rip), %rsi     # 0x1b3f3
callq 0x50a0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x5aa6
movl $0x17, %edx
movq %r13, %rdi
leaq 0x157d1(%rip), %rsi     # 0x1b24a
callq 0x5250
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movl $0x0, 0x4(%rsp)
movl $0x58, %edx
movq %r13, %rdi
leaq 0x157a5(%rip), %rsi     # 0x1b262
callq 0x5250
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movl $0xc, %edx
movq %r13, %rdi
leaq 0x155c1(%rip), %rsi     # 0x1b0ba
callq 0x5250
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %edx
movq %r15, %rdi
leaq 0x58(%rsp), %rsi
callq 0x53b0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %edx
movq %r15, %rdi
leaq 0x58(%rsp), %rsi
callq 0x53b0
leaq 0x58(%rsp), %r14
movq %r14, %rdi
leaq 0x1633a(%rip), %rsi     # 0x1be8f
callq 0x50a0
testl %eax, %eax
je 0x5c6e
movq %r14, %rdi
leaq 0x15783(%rip), %rsi     # 0x1b2ef
callq 0x50a0
testl %eax, %eax
je 0x5c6e
movq %r14, %rdi
leaq 0x155e6(%rip), %rsi     # 0x1b169
callq 0x50a0
testl %eax, %eax
je 0x5c6e
movq %r14, %rdi
leaq 0x15721(%rip), %rsi     # 0x1b2bb
callq 0x50a0
testl %eax, %eax
je 0x5c6e
movq %r14, %rdi
leaq 0x1653e(%rip), %rsi     # 0x1c0ef
callq 0x50a0
testl %eax, %eax
je 0x5c6e
movq %r14, %rdi
leaq 0x16256(%rip), %rsi     # 0x1be1e
callq 0x50a0
testl %eax, %eax
je 0x5c6e
movl $0xc, %edx
movq %r12, %rdi
leaq 0x156d9(%rip), %rsi     # 0x1b2bd
callq 0x5250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movl $0xc, %edx
movq %r13, %rdi
leaq 0x1549a(%rip), %rsi     # 0x1b0ba
callq 0x5250
movq (%r15), %rax
movq -0x18(%rax), %rdi
movl 0x20(%r15,%rdi), %eax
testb $0x5, %al
je 0x5c56
testb $0x2, %al
jne 0x6c4f
addq %r15, %rdi
xorl %esi, %esi
callq 0x5360
movq %r15, %rdi
callq 0x53a0
movq (%r15), %rax
movq -0x18(%rax), %rdi
andb $-0x11, 0x19(%r15,%rdi)
movq %r15, %rdi
leaq 0x58(%rsp), %rsi
callq 0x5280
jmp 0x5b46
movq %r14, %rdi
leaq 0x15652(%rip), %rsi     # 0x1b2ca
callq 0x50a0
testl %eax, %eax
je 0x6c4f
movq %r14, %rdi
leaq 0x15773(%rip), %rsi     # 0x1b402
callq 0x50a0
testl %eax, %eax
je 0x6701
movq %r14, %rdi
leaq 0x161e9(%rip), %rsi     # 0x1be8f
callq 0x50a0
testl %eax, %eax
jne 0x5ccd
movq 0x60(%rsp), %rdx
movl $0x1, %r8d
leaq 0x58(%rsp), %rdi
xorl %esi, %esi
leaq 0x15627(%rip), %rcx     # 0x1b2ef
callq 0x52e0
leaq 0x2b0(%rsp), %rdi
leaq 0x155f0(%rip), %rsi     # 0x1b2cc
leaq 0x58(%rsp), %rdx
callq 0x7301
movq 0x2b0(%rsp), %rsi
movq 0x2b8(%rsp), %rdx
movq %r13, %rdi
callq 0x5250
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movq 0x2b0(%rsp), %rdi
leaq 0x2c0(%rsp), %rax
cmpq %rax, %rdi
je 0x5d4d
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0x298(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
callq 0x738a
leaq 0xa0(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x7424
leaq 0x280(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x74b6
leaq 0x268(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
callq 0x7554
leaq 0x250(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0x7554
leaq 0x180(%rsp), %rax
movq %rax, 0x170(%rsp)
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
addq %rsi, %rdx
leaq 0x170(%rsp), %r14
movq %r14, %rdi
callq 0x7898
movl 0x10(%rsp), %eax
movzbl 0x4(%rsp), %r10d
leaq 0x2b0(%rsp), %rdi
leaq 0x298(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
leaq 0x280(%rsp), %rcx
leaq 0x268(%rsp), %r8
leaq 0x250(%rsp), %r9
pushq %rbp
pushq %r10
pushq %rax
pushq %r14
callq 0xd0a8
addq $0x20, %rsp
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
leaq 0x150(%rsp), %rbp
je 0x5e59
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0x250(%rsp), %rdi
callq 0x75ee
leaq 0x268(%rsp), %rdi
callq 0x75ee
leaq 0x280(%rsp), %rdi
callq 0x7636
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
leaq 0x2b0(%rsp), %r14
je 0x5ecd
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x51f0
xorl %eax, %eax
movq %rax, 0xa0(%rsp)
movl %eax, 0xa8(%rsp)
movq %rax, 0xb0(%rsp)
movl %eax, 0xb8(%rsp)
movq %rax, 0xc0(%rsp)
leaq 0x298(%rsp), %rdi
callq 0x7684
leaq 0x160(%rsp), %rax
movq %rax, 0x150(%rsp)
movq %rbp, %rdi
leaq 0x153e8(%rip), %rsi     # 0x1b2dc
leaq 0x153f5(%rip), %rdx     # 0x1b2f0
callq 0x79f2
leaq 0xf(%rsp), %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %rbp, %rcx
callq 0x1a0fc
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0x5f38
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
movq $0x0, 0x80(%rsp)
movb $0x0, 0x88(%rsp)
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0x4(%rsp)
movl $0xf, %edx
movq %r13, %rdi
leaq 0x15379(%rip), %rsi     # 0x1b2f1
callq 0x5250
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %edx
movq %r15, %rdi
leaq 0x78(%rsp), %rsi
callq 0x53b0
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x20(%r15,%rax), %eax
testb $0x5, %al
setne %cl
andl $0x2, %eax
shrl %eax
testb %al, %cl
jne 0x6711
leaq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
movb $0x0, 0x28(%rsp)
leaq 0x78(%rsp), %r14
movq %r14, %rdi
leaq 0x1531b(%rip), %rsi     # 0x1b301
callq 0x50a0
testl %eax, %eax
je 0x614c
movq %r14, %rdi
leaq 0x15307(%rip), %rsi     # 0x1b304
callq 0x50a0
testl %eax, %eax
je 0x614c
movq %r14, %rdi
leaq 0x152f3(%rip), %rsi     # 0x1b307
callq 0x50a0
testl %eax, %eax
je 0x614c
movq %r14, %rdi
leaq 0x152df(%rip), %rsi     # 0x1b30a
callq 0x50a0
testl %eax, %eax
je 0x614c
movq %r14, %rdi
leaq 0x152cb(%rip), %rsi     # 0x1b30d
callq 0x50a0
testl %eax, %eax
je 0x614c
movq %r14, %rdi
leaq 0x152b7(%rip), %rsi     # 0x1b310
callq 0x50a0
testl %eax, %eax
je 0x614c
movq %r14, %rdi
leaq 0x152a3(%rip), %rsi     # 0x1b313
callq 0x50a0
testl %eax, %eax
je 0x614c
movq %r14, %rdi
leaq 0x1528f(%rip), %rsi     # 0x1b316
callq 0x50a0
testl %eax, %eax
je 0x614c
movq 0x80(%rsp), %rdx
cmpl $0x4, %edx
leaq 0x2b0(%rsp), %rbp
jne 0x63d2
movq 0x78(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x61, %eax
je 0x6485
cmpl $0x75, %eax
jne 0x63d2
addq $-0x2, %rdx
leaq 0x230(%rsp), %rbp
movq %rbp, %rdi
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x5210
leaq 0x38(%rsp), %r14
movq %r14, %rdi
leaq 0x2b0(%rsp), %rsi
movq %rbp, %rdx
callq 0x1552e
leaq 0x18(%rsp), %rdi
movq %r14, %rsi
callq 0x5270
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x6126
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x230(%rsp), %rdi
leaq 0x240(%rsp), %rax
cmpq %rax, %rdi
je 0x61fb
movq 0x240(%rsp), %rsi
jmp 0x6505
leaq 0x140(%rsp), %rax
movq %rax, 0x130(%rsp)
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
addq %rsi, %rdx
leaq 0x130(%rsp), %r14
movq %r14, %rdi
callq 0x7898
leaq 0x2b0(%rsp), %rsi
leaq 0x38(%rsp), %rbp
movq %rbp, %rdi
movq %r14, %rdx
callq 0xf428
leaq 0x18(%rsp), %rdi
movq %rbp, %rsi
callq 0x5270
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x61bd
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x61e2
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0x18(%rsp), %rdi
leaq 0x1512b(%rip), %rsi     # 0x1b319
callq 0x50a0
testl %eax, %eax
je 0x6384
movq 0x20(%rsp), %rdx
cmpq $0x1f, %rdx
jb 0x6254
addq $-0x1a, %rdx
leaq 0x38(%rsp), %r14
movq %r14, %rdi
leaq 0x18(%rsp), %rsi
movq $-0x1, %rcx
callq 0x5210
movq %r14, %rdi
leaq 0x15ae2(%rip), %rsi     # 0x1bd0f
callq 0x50a0
movl %eax, %ebp
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x6250
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x51f0
testl %ebp, %ebp
je 0x62bb
leaq 0x38(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
callq 0x12738
movq 0x40(%rsp), %rdx
testq %rdx, %rdx
jne 0x6290
movl $0xe, %r8d
leaq 0x38(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x1511b(%rip), %rcx     # 0x1b3a1
callq 0x52e0
movq 0x40(%rsp), %rdx
movq 0x38(%rsp), %rsi
leaq 0x18(%rsp), %rdi
callq 0x50b0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x62bb
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0x120(%rsp), %rax
movq %rax, 0x110(%rsp)
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
addq %rsi, %rdx
leaq 0x110(%rsp), %rdi
callq 0x7898
leaq 0xf(%rsp), %rdi
movq %r13, %rsi
leaq 0x2b0(%rsp), %rdx
leaq 0x110(%rsp), %rcx
callq 0x1a0fc
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x6327
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x20(%rsp), %rdx
cmpq $0xd, %rdx
jb 0x6380
addq $-0xa, %rdx
leaq 0x38(%rsp), %r14
movq %r14, %rdi
leaq 0x18(%rsp), %rsi
movq $-0x1, %rcx
callq 0x5210
movq %r14, %rdi
leaq 0x15b7d(%rip), %rsi     # 0x1bed6
callq 0x50a0
movl %eax, %ebp
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x637c
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x51f0
testl %ebp, %ebp
je 0x6393
xorl %ebp, %ebp
jmp 0x63a0
movl $0xf, %ebp
movl $0x1, 0x14(%rsp)
jmp 0x63a0
movl $0xf, %ebp
movl $0x2, 0x14(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x63bc
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x51f0
testl %ebp, %ebp
je 0x5f69
cmpl $0xe, %ebp
je 0x5f69
jmp 0x6723
movq %r14, %rdi
leaq 0x15cf6(%rip), %rsi     # 0x1c0d2
callq 0x50a0
testl %eax, %eax
je 0x6439
movq %r14, %rdi
leaq 0x15013(%rip), %rsi     # 0x1b402
callq 0x50a0
testl %eax, %eax
je 0x6512
movq %r14, %rdi
leaq 0x14ec4(%rip), %rsi     # 0x1b2ca
callq 0x50a0
testl %eax, %eax
je 0x6566
movl $0xf, %edx
movq %r12, %rdi
leaq 0x14f6f(%rip), %rsi     # 0x1b391
callq 0x5250
movl $0xe, %ebp
movq %r12, %rdi
callq 0x5100
jmp 0x63a0
movq %rbp, %rdi
callq 0xe850
movl %eax, %ebp
movq 0x20(%rsp), %rdx
movl $0x10, %r8d
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
leaq 0x14ed7(%rip), %rcx     # 0x1b333
callq 0x52e0
testb %bpl, %bpl
leaq 0x14ee2(%rip), %rsi     # 0x1b34d
leaq 0x14ed2(%rip), %rax     # 0x1b344
cmovneq %rax, %rsi
leaq 0x18(%rsp), %rdi
callq 0x53c0
jmp 0x61fb
addq $-0x2, %rdx
leaq 0x210(%rsp), %rbp
movq %rbp, %rdi
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x5210
leaq 0x38(%rsp), %r14
movq %r14, %rdi
leaq 0x2b0(%rsp), %rsi
movq %rbp, %rdx
callq 0x10cc8
leaq 0x18(%rsp), %rdi
movq %r14, %rsi
callq 0x5270
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x64e4
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x210(%rsp), %rdi
leaq 0x220(%rsp), %rax
cmpq %rax, %rdi
je 0x61fb
movq 0x220(%rsp), %rsi
incq %rsi
callq 0x51f0
jmp 0x61fb
movl $0x15, %edx
movq %r13, %rdi
leaq 0x14e36(%rip), %rsi     # 0x1b357
callq 0x5250
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movl $0xf, %ebp
movl $0x0, 0x14(%rsp)
movb $0x1, %al
movl %eax, 0x4(%rsp)
jmp 0x63a0
movl $0x23, %edx
movq %r13, %rdi
leaq 0x14df8(%rip), %rsi     # 0x1b36d
callq 0x5250
movq %r13, %rdi
callq 0x5100
movl $0x0, 0x8(%rsp)
movl $0x1, %ebp
jmp 0x63a0
movl $0xd, %edx
movq %r13, %rdi
leaq 0x14b24(%rip), %rsi     # 0x1b0c7
callq 0x5250
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movl $0x20, %edx
movq %r13, %rdi
leaq 0x14af6(%rip), %rsi     # 0x1b0d5
callq 0x5250
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x5120
movq (%r15), %rax
movq -0x18(%rax), %rdi
movl 0x20(%r15,%rdi), %eax
testb $0x5, %al
je 0x667d
testb $0x2, %al
jne 0x6c4f
addq %r15, %rdi
xorl %esi, %esi
callq 0x5360
movq %r15, %rdi
callq 0x53a0
movl $0xc, %edx
movq %r13, %rdi
leaq 0x14acc(%rip), %rsi     # 0x1b0f6
callq 0x5250
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movl $0x1f, %edx
movq %r13, %rdi
leaq 0x14a9d(%rip), %rsi     # 0x1b103
callq 0x5250
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x5120
jmp 0x65f1
cmpl $-0x1, 0x10(%rsp)
je 0x69d5
movl $0xe, %edx
movq %r13, %rdi
leaq 0x14a8c(%rip), %rsi     # 0x1b123
callq 0x5250
movl 0x10(%rsp), %r14d
movl %r14d, %ebx
negl %ebx
cmovsl %r14d, %ebx
movl $0x1, %ebp
cmpl $0xa, %ebx
jb 0x6928
movl $0x4, %ebp
movl %ebx, %eax
cmpl $0x63, %eax
jbe 0x6921
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x6926
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x6928
movl %eax, %ecx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebp
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x66bf
addl $-0x3, %ebp
jmp 0x6928
movl $0x2, %ebp
movb $0x1, %al
movl %eax, 0x4(%rsp)
jmp 0x6c64
movl $0x0, 0x8(%rsp)
movl $0x1, %ebp
jmp 0x68ed
cmpl $0xf, %ebp
jne 0x68ed
movl 0x14(%rsp), %ebp
testl %ebp, %ebp
je 0x68ed
cmpl $0x2, %ebp
je 0x6757
movl $0x19, %edx
leaq 0x14c67(%rip), %rsi     # 0x1b3b0
cmpl $0x1, %ebp
leaq 0x14ca2(%rip), %rbp     # 0x1b3f5
je 0x676a
jmp 0x679a
movl $0x17, %edx
leaq 0x14c67(%rip), %rsi     # 0x1b3ca
leaq 0x14c8b(%rip), %rbp     # 0x1b3f5
movq %r13, %rdi
callq 0x5250
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movl $0x12, %edx
movq %r13, %rdi
leaq 0x14c39(%rip), %rsi     # 0x1b3e2
callq 0x5250
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
leaq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x18(%rsp), %r14
movq %r14, %rdi
leaq 0x156a0(%rip), %rdx     # 0x1be8f
movq %rdx, %rsi
callq 0x79f2
movq %r14, %rdi
leaq 0x148a8(%rip), %rsi     # 0x1b0a9
callq 0x50a0
testl %eax, %eax
je 0x68b1
movq %r14, %rdi
leaq 0x14bdb(%rip), %rsi     # 0x1b3f3
callq 0x50a0
testl %eax, %eax
je 0x68b1
movq %r14, %rdi
leaq 0x15660(%rip), %rsi     # 0x1be8f
callq 0x50a0
testl %eax, %eax
je 0x6870
movl $0xe, %edx
movq %r12, %rdi
movq %rbp, %rsi
callq 0x5250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movq %r15, %rdi
leaq 0x18(%rsp), %rsi
callq 0x5280
movq (%r15), %rax
movq -0x18(%rax), %rdi
movl 0x20(%r15,%rdi), %eax
testb $0x5, %al
je 0x68a7
testb $0x2, %al
jne 0x6e86
addq %r15, %rdi
xorl %esi, %esi
callq 0x5360
movq %r15, %rdi
callq 0x53a0
leaq 0x18(%rsp), %r14
jmp 0x67f7
movq %r14, %rdi
leaq 0x147ee(%rip), %rsi     # 0x1b0a9
callq 0x50a0
testl %eax, %eax
sete %al
movl 0x4(%rsp), %ecx
orb %al, %cl
movl %ecx, 0x4(%rsp)
xorl %ebp, %ebp
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x68ed
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x690f
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0x2b0(%rsp), %rdi
callq 0x76cc
jmp 0x6c64
addl $-0x2, %ebp
jmp 0x6928
decl %ebp
shrl $0x1f, %r14d
leal (%r14,%rbp), %esi
leaq 0x2c0(%rsp), %rax
movq %rax, 0x2b0(%rsp)
leaq 0x2b0(%rsp), %rdi
movl $0x2d, %edx
callq 0x5260
addq 0x2b0(%rsp), %r14
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x775d
movq 0x2b0(%rsp), %rsi
movq 0x2b8(%rsp), %rdx
movq %r13, %rdi
callq 0x5250
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movq 0x2b0(%rsp), %rdi
leaq 0x2c0(%rsp), %rax
cmpq %rax, %rdi
leaq 0xc8(%rsp), %rbx
je 0x69d5
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x51f0
movl $0x21, %edx
movq %r13, %rdi
leaq 0x1474e(%rip), %rsi     # 0x1b132
callq 0x5250
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5280
leaq 0x146bf(%rip), %r14     # 0x1b0ba
movq %rbx, %rdi
leaq 0x146a4(%rip), %rsi     # 0x1b0a9
callq 0x50a0
testl %eax, %eax
je 0x6aaf
movq %rbx, %rdi
leaq 0x149d7(%rip), %rsi     # 0x1b3f3
callq 0x50a0
testl %eax, %eax
je 0x6aaf
movl $0xe, %edx
movq %r12, %rdi
leaq 0x14673(%rip), %rsi     # 0x1b0ab
callq 0x5250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movl $0xc, %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x5250
movq (%r15), %rax
movq -0x18(%rax), %rdi
movl 0x20(%r15,%rdi), %eax
testb $0x5, %al
je 0x6a9f
testb $0x2, %al
jne 0x6c4f
addq %r15, %rdi
xorl %esi, %esi
callq 0x5360
movq %r15, %rdi
callq 0x53a0
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5280
jmp 0x69fb
movq %rbx, %rdi
leaq 0x145f0(%rip), %rsi     # 0x1b0a9
callq 0x50a0
testl %eax, %eax
sete %al
movl %eax, 0x4(%rsp)
je 0x6b26
movq %rbx, %rdi
leaq 0x14920(%rip), %rsi     # 0x1b3f3
callq 0x50a0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x6e45
movl $0x17, %edx
movq %r13, %rdi
leaq 0x14677(%rip), %rsi     # 0x1b16b
callq 0x5250
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
jmp 0x6e45
movl $0x16, %edx
movq %r13, %rdi
leaq 0x1461f(%rip), %rsi     # 0x1b154
callq 0x5250
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movl $0x29, %edx
movq %r13, %rdi
leaq 0x14612(%rip), %rsi     # 0x1b183
callq 0x5250
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5280
leaq 0x14532(%rip), %r14     # 0x1b0ba
movq %rbx, %rdi
leaq 0x14736(%rip), %rsi     # 0x1b2c8
callq 0x50a0
testl %eax, %eax
je 0x6d35
movq %rbx, %rdi
leaq 0x14604(%rip), %rsi     # 0x1b1ad
callq 0x50a0
testl %eax, %eax
je 0x6d35
movq %rbx, %rdi
leaq 0x145ef(%rip), %rsi     # 0x1b1af
callq 0x50a0
testl %eax, %eax
je 0x6d35
movl $0xe, %edx
movq %r12, %rdi
leaq 0x144cf(%rip), %rsi     # 0x1b0ab
callq 0x5250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movl $0xc, %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x5250
movq (%r15), %rax
movq -0x18(%rax), %rdi
movl 0x20(%r15,%rdi), %eax
testb $0x5, %al
je 0x6c3f
testb $0x2, %al
jne 0x6c4f
addq %r15, %rdi
xorl %esi, %esi
callq 0x5360
movq %r15, %rdi
callq 0x53a0
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5280
jmp 0x6b88
movl $0x0, 0x4(%rsp)
movl $0x1, %ebp
movl $0x0, 0x8(%rsp)
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x6c89
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x6ca5
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x6cce
movq 0x108(%rsp), %rsi
subq %rdi, %rsi
callq 0x51f0
movq $0x0, 0xe8(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x75ee
leaq 0x1b0(%rsp), %rdi
callq 0x75ee
leaq 0x1d0(%rsp), %rdi
callq 0x7636
leaq 0x1f0(%rsp), %rdi
callq 0x7684
leaq 0x3c0(%rsp), %r14
movq %r14, %rdi
callq 0x5070
testl $0xfffffffd, %ebp       # imm = 0xFFFFFFFD
leaq 0x1439b(%rip), %rbp     # 0x1b0ba
jne 0x6f48
testb $0x1, 0x4(%rsp)
jne 0x57c0
jmp 0x6f48
movq %rbx, %rdi
leaq 0x14589(%rip), %rsi     # 0x1b2c8
callq 0x50a0
testl %eax, %eax
je 0x6dc1
movq %rbx, %rdi
leaq 0x1445b(%rip), %rsi     # 0x1b1ad
callq 0x50a0
testl %eax, %eax
je 0x6e04
movq %rbx, %rdi
leaq 0x14446(%rip), %rsi     # 0x1b1af
callq 0x50a0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x6e45
movl $0x2a, %edx
movq %r13, %rdi
leaq 0x1447f(%rip), %rsi     # 0x1b209
callq 0x5250
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movl $0x4, %ebp
movq %rax, %rdi
callq 0x5140
jmp 0x6e45
movl $0x2a, %edx
movq %r13, %rdi
leaq 0x143e1(%rip), %rsi     # 0x1b1b1
callq 0x5250
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movl $0x2, %ebp
movq %rax, %rdi
callq 0x5140
jmp 0x6e45
movl $0x2c, %edx
movq %r13, %rdi
leaq 0x143c9(%rip), %rsi     # 0x1b1dc
callq 0x5250
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movl $0x3, %ebp
movq %rax, %rdi
callq 0x5140
movl $0x15, %edx
movq %r13, %rdi
leaq 0x143e0(%rip), %rsi     # 0x1b234
callq 0x5250
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
jmp 0x5aae
movl $0x0, 0x8(%rsp)
movl $0x1, %ebp
jmp 0x68d1
movq %rax, %r14
movq 0x2b0(%rsp), %rdi
leaq 0x2c0(%rsp), %rax
cmpq %rax, %rdi
je 0x6ec5
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x51f0
jmp 0x6ec5
movq %rax, %r14
movq %r14, %rdi
callq 0x50e0
movl $0x1b, %edx
movq %r12, %rdi
leaq 0x14154(%rip), %rsi     # 0x1b030
callq 0x5250
movq %r12, %rdi
callq 0x5100
leaq 0x3c0(%rsp), %rdi
callq 0x5060
jmp 0x6f29
movq %rax, %rdi
callq 0x50e0
movl $0x1d, %edx
movq %r12, %rdi
leaq 0x14103(%rip), %rsi     # 0x1b012
callq 0x5250
movq %r12, %rdi
callq 0x5100
leaq 0x3c0(%rsp), %rdi
callq 0x5060
callq 0x5330
movl $0x1, %ebp
movl $0x0, 0x4(%rsp)
movl $0x1, 0x8(%rsp)
jmp 0x6ca5
movl 0x8(%rsp), %eax
addq $0x5c8, %rsp            # imm = 0x5C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
callq 0x5330
jmp 0x723c
movq %rax, %rbx
callq 0x5330
jmp 0x723c
movq %rax, %rdi
callq 0x72b9
movq %rax, %rbx
movq 0x210(%rsp), %rdi
leaq 0x220(%rsp), %rax
cmpq %rax, %rdi
je 0x719c
movq 0x220(%rsp), %rsi
jmp 0x718f
jmp 0x7199
movq %rax, %rbx
movq 0x230(%rsp), %rdi
leaq 0x240(%rsp), %rax
cmpq %rax, %rdi
je 0x719c
movq 0x240(%rsp), %rsi
jmp 0x718f
jmp 0x7199
jmp 0x71be
jmp 0x7199
jmp 0x71f8
movq %rax, %rbx
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0x71e3
movq 0x160(%rsp), %rsi
jmp 0x71db
movq %rax, %rbx
jmp 0x71e3
movq %rax, %rbx
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x7049
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x51f0
jmp 0x7049
movq %rax, %rbx
leaq 0x250(%rsp), %rdi
callq 0x75ee
jmp 0x705b
movq %rax, %rbx
leaq 0x268(%rsp), %rdi
callq 0x75ee
jmp 0x706d
movq %rax, %rbx
leaq 0x280(%rsp), %rdi
callq 0x7636
jmp 0x707f
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x70c9
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x51f0
xorl %eax, %eax
movq %rax, 0xa0(%rsp)
movl %eax, 0xa8(%rsp)
movq %rax, 0xb0(%rsp)
movl %eax, 0xb8(%rsp)
movq %rax, 0xc0(%rsp)
jmp 0x70c9
movq %rax, %rbx
leaq 0x298(%rsp), %rdi
callq 0x7684
jmp 0x71fb
jmp 0x71f8
jmp 0x71f8
jmp 0x71be
jmp 0x70ec
movq %rax, %rbx
movq 0x2b0(%rsp), %rdi
leaq 0x2c0(%rsp), %rax
cmpq %rax, %rdi
je 0x71fb
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x51f0
jmp 0x71fb
jmp 0x7199
jmp 0x7199
jmp 0x7199
jmp 0x7199
movq %rax, %rbx
jmp 0x723c
movq %rax, %rbx
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x719c
movq 0x120(%rsp), %rsi
jmp 0x718f
jmp 0x7199
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x719c
movq 0x48(%rsp), %rsi
jmp 0x718f
jmp 0x71f8
movq %rax, %rbx
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x719c
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x51f0
jmp 0x719c
movq %rax, %rbx
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x71c1
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x51f0
jmp 0x71c1
jmp 0x71f8
jmp 0x71f8
movq %rax, %rbx
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x71e3
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0x2b0(%rsp), %rdi
callq 0x76cc
jmp 0x71fb
jmp 0x71f8
jmp 0x71f8
jmp 0x71f8
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x7220
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x723c
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x7270
movq 0x108(%rsp), %rsi
subq %rdi, %rsi
callq 0x51f0
movq $0x0, 0xe8(%rsp)
movl $0x0, 0xf0(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x75ee
leaq 0x1b0(%rsp), %rdi
callq 0x75ee
leaq 0x1d0(%rsp), %rdi
callq 0x7636
leaq 0x1f0(%rsp), %rdi
callq 0x7684
leaq 0x3c0(%rsp), %rdi
callq 0x5070
movq %rbx, %rdi
callq 0x5380