// File: /workspace/github_cpp_makefile_star2_O1/jeffreyan11[P]go-engine/gtp.cpp
// Function: main
int main(int argc, char **argv) {
    // Parse command line arguments and flags with little error checking...
    if (argc == 2) {
        if (argv[1][0] == '-') {
            debugOutput = true;
        }
        else {
            playouts = stoi(string(argv[1]));
        }
    }
    else if (argc == 3) {
        debugOutput = true;

        if (argv[1][0] != '-') {
            playouts = stoi(string(argv[1]));
        }
        else {
            playouts = stoi(string(argv[2]));
        }
    }

    // Do necessary initializations
    initZobristTable();

    string input;

    while (true) {
        getline(cin, input);
        // TODO tab can also be a delimiter
        vector<string> inputVector = split(input, ' ');
        cin.clear();

        // The command is the first word in the string
        string command = inputVector.at(0);


        // Gameplay commands
        if (command == "play") {
            Player p = stringToColor(inputVector.at(1));

            if (p != EMPTY) {
                string moveString = inputVector.at(2);

                // We don't do anything to the board for passes
                if (moveString != "pass" && moveString != "PASS") {
                    char fileChar = moveString[0];
                    int file = 0;
                    if (fileChar >= 'A' && fileChar <= 'Z') {
                        // Board coordinates are 1-indexed
                        file = fileChar - 'A' + 1;
                        // The I character is skipped
                        if (fileChar > 'I')
                            file--;
                    }
                    else {
                        file = fileChar - 'a' + 1;
                        if (fileChar > 'i')
                            file--;
                    }

                    int rank = stoi(moveString.substr(1));
                    Move inputMove = coordToMove(file, rank);
                    lastMove = inputMove;

                    keyStack[keyStackSize] = game.getZobristKey();
                    keyStackSize++;
                    game.doMove(p, inputMove);

                    if (debugOutput) {
                        cerr << endl << "   ";
                        for (int i = 1; i <= boardSize; i++)
                            cerr << COLUMNS[i] << " ";
                        cerr << endl;

                        game.errorPrint();

                        cerr << "   ";
                        for (int i = 1; i <= boardSize; i++)
                            cerr << COLUMNS[i] << " ";
                        cerr << endl;
                    }
                }
                else
                    lastMove = MOVE_PASS;

                cout << "= " << endl << endl;
            }
            else
                cout << "? invalid color" << endl << endl;
        }

        else if (command == "genmove") {
            Player p = stringToColor(inputVector.at(1));

            if (p != EMPTY) {
                auto startTime = std::chrono::high_resolution_clock::now();
                Move m = generateMove(p, lastMove);
                if (debugOutput) {
                    auto endTime = std::chrono::high_resolution_clock::now();
                    std::chrono::duration<double> timeSpan =
                            std::chrono::duration_cast<std::chrono::duration<double>>(
                            endTime-startTime);
                    cerr << "genmove took: " << timeSpan.count() << " sec" << endl;
                }

                lastMove = m;
                if (m == MOVE_PASS)
                    cout << "= pass" << endl << endl;
                else {
                    keyStack[keyStackSize] = game.getZobristKey();
                    keyStackSize++;
                    game.doMove(p, m);

                    if (debugOutput) {
                        cerr << endl << "   ";
                        for (int i = 1; i <= boardSize; i++)
                            cerr << COLUMNS[i] << " ";
                        cerr << endl;

                        game.errorPrint();

                        cerr << "   ";
                        for (int i = 1; i <= boardSize; i++)
                            cerr << COLUMNS[i] << " ";
                        cerr << endl;
                    }

                    cout << "= " << COLUMNS[getX(m)] << getY(m) << endl << endl;
                }
            }
            else
                cout << "? invalid color" << endl << endl;
        }

        else if (command == "fixed_handicap") {
            int numStones = stoi(inputVector.at(1));
            int maxHandicap = (boardSize % 2) == 1 ? 9 : 4;
            if (numStones < 2 || numStones > maxHandicap)
                cout << "? invalid number of stones" << endl << endl;
            else if (!game.isEmpty())
                cout << "? board is not empty" << endl << endl;
            else if (boardSize < 7)
                cout << "? board size too small" << endl << endl;
            else {
                int hLine = (boardSize < 13) ? 3 : 4;
                int low = hLine;
                int mid = (boardSize + 1) / 2;
                int high = boardSize - hLine + 1;
                cout << "? ";
                switch (numStones) {
                    case 9:
                        game.doMove(BLACK, coordToMove(mid, mid));
                        cout << COLUMNS[mid] << mid << " ";
                    case 8:
                        game.doMove(BLACK, coordToMove(mid, high));
                        cout << COLUMNS[mid] << high << " ";
                    case 7:
                        game.doMove(BLACK, coordToMove(mid, low));
                        cout << COLUMNS[mid] << low << " ";
                    case 6:
                        game.doMove(BLACK, coordToMove(high, mid));
                        cout << COLUMNS[high] << mid << " ";
                    case 5:
                        game.doMove(BLACK, coordToMove(low, mid));
                        cout << COLUMNS[low] << mid << " ";
                    case 4:
                        game.doMove(BLACK, coordToMove(high, low));
                        cout << COLUMNS[high] << low << " ";
                    case 3:
                        game.doMove(BLACK, coordToMove(low, high));
                        cout << COLUMNS[low] << high << " ";
                    case 2:
                        game.doMove(BLACK, coordToMove(low, low));
                        game.doMove(BLACK, coordToMove(high, high));
                        cout << COLUMNS[low] << low << " " << COLUMNS[high] << high;
                    default:
                        break;
                }
                cout << endl << endl;
            }
        }


        // Game setup commands
        else if (command == "boardsize") {
            int inputSize = stoi(inputVector.at(1));
            if (inputSize < 3 || inputSize > 21)
                cout << "? unacceptable size" << endl << endl;
            else {
                boardSize = inputSize;
                arraySize = inputSize + 2;
                game.reset();
                resetSearchState();
                cout << "= " << endl << endl;
            }
        }

        else if (command == "clear_board") {
            lastMove = MOVE_PASS;
            game.reset();
            resetSearchState();
            cout << "= " << endl << endl;
        }

        else if (command == "komi") {
            float inputKomi = stof(inputVector.at(1));
            komi = inputKomi;
            cout << "= " << endl << endl;
        }


        // Protocol / information commands
        else if (command == "protocol_version")
            cout << "= 2" << endl << endl;
        else if (command == "name")
            cout << "= " << ENGINE_NAME << endl << endl;
        else if (command == "version")
            cout << "= " << VERSION << endl << endl;
        else if (command == "known_command") {
            bool isKnown = false;
            for (int i = 0; i < NUM_KNOWN_COMMANDS; i++) {
                if (KNOWN_COMMANDS[i] == inputVector.at(1)) {
                    isKnown = true;
                    break;
                }
            }

            if (isKnown)
                cout << "= true" << endl << endl;
            else
                cout << "= false" << endl << endl;
        }
        else if (command == "list_commands") {
            cout << "= " << endl;
            for (int i = 0; i < NUM_KNOWN_COMMANDS; i++) {
                cout << KNOWN_COMMANDS[i] << endl;
            }
            cout << endl;
        }


        // Debugging commands
        else if (command == "showboard") {
            cout << "= " << endl;
            cout << "   ";
            for (int i = 1; i <= boardSize; i++)
                cout << COLUMNS[i] << " ";
            cout << endl;

            game.prettyPrint();

            cout << "   ";
            for (int i = 1; i <= boardSize; i++)
                cout << COLUMNS[i] << " ";
            cout << endl << endl;
        }

        else if (command == "selfplay") {
            Player p = BLACK;
            Move last = 0;
            Move m = MOVE_PASS;

            while (last != MOVE_PASS || m != MOVE_PASS) {
                last = m;
                auto startTime = std::chrono::high_resolution_clock::now();
                m = generateMove(p, last);
                if (debugOutput) {
                    auto endTime = std::chrono::high_resolution_clock::now();
                    std::chrono::duration<double> timeSpan =
                            std::chrono::duration_cast<std::chrono::duration<double>>(
                            endTime-startTime);
                    cerr << "genmove took: " << timeSpan.count() << " sec" << endl;
                }

                if (m != MOVE_PASS) {
                    keyStack[keyStackSize] = game.getZobristKey();
                    keyStackSize++;
                    game.doMove(p, m);
                }

                p = otherPlayer(p);
            }

            cout << "= " << endl << endl;
        }


        else if (command == "quit") {
            cout << "= " << endl << endl;
            break;
        }


        // Otherwise, give an error message indicating an unknown command
        else {
            cout << "? unknown command" << endl << endl;
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
cmpl $0x3, %edi
je 0x6aec
cmpl $0x2, %edi
jne 0x6c6d
movq 0x8(%rsi), %rsi
cmpb $0x2d, (%rsi)
jne 0x6b71
movb $0x1, 0x11be9(%rip)     # 0x186d0
jmp 0x6c6d
movb $0x1, 0x11bdd(%rip)     # 0x186d0
movq 0x8(%rsi), %rax
cmpb $0x2d, (%rax)
jne 0x6bda
movq 0x10(%rsi), %rsi
movq %rsp, %rdi
leaq 0x60(%rsp), %rdx
callq 0x8aa2
movq (%rsp), %rbx
callq 0x2050
movq %rax, %r14
movl (%rax), %ebp
movl $0x0, (%rax)
leaq 0x20(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x2220
cmpq %rbx, (%r15)
je 0x877d
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x6b65
movl (%r14), %ecx
cmpl $0x22, %ecx
jne 0x6c42
leaq 0x2654(%rip), %rdi      # 0x91c0
callq 0x2230
movq %rsp, %rdi
leaq 0x60(%rsp), %rdx
callq 0x8aa2
movq (%rsp), %rbx
callq 0x2050
movq %rax, %r14
movl (%rax), %ebp
movl $0x0, (%rax)
leaq 0x20(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x2220
cmpq %rbx, (%r15)
je 0x8789
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x6bce
movl (%r14), %ecx
cmpl $0x22, %ecx
jne 0x6c42
leaq 0x25eb(%rip), %rdi      # 0x91c0
callq 0x2230
movq %rsp, %rdi
leaq 0x60(%rsp), %rdx
movq %rax, %rsi
callq 0x8aa2
movq (%rsp), %rbx
callq 0x2050
movq %rax, %r14
movl (%rax), %ebp
movl $0x0, (%rax)
leaq 0x20(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x2220
cmpq %rbx, (%r15)
je 0x8795
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x87a1
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x87a1
testl %ecx, %ecx
jne 0x6c49
movl %ebp, (%r14)
leaq 0x554c(%rip), %rcx      # 0xc19c
movl %eax, (%rcx)
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6c6d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21c0
callq 0x2d3c
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x30(%rsp), %r13
movq 0x5346(%rip), %rbx      # 0xbfd8
movq %rsp, %r14
leaq 0x20(%rsp), %r15
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x22e0
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
movl $0x20, %edx
callq 0x88ff
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
xorl %esi, %esi
callq 0x22a0
movq 0x40(%rsp), %rax
cmpq %rax, 0x48(%rsp)
leaq 0x60(%rsp), %rbx
je 0x8686
movq %r13, 0x20(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x8b7a
movq %r15, %rdi
leaq 0x23d3(%rip), %rsi      # 0x90e8
callq 0x2080
testl %eax, %eax
je 0x6e6a
movq %r15, %rdi
leaq 0x234a(%rip), %rsi      # 0x9076
callq 0x2080
testl %eax, %eax
je 0x71f8
movq %r15, %rdi
leaq 0x2356(%rip), %rsi      # 0x9099
callq 0x2080
testl %eax, %eax
je 0x7396
movq %r15, %rdi
leaq 0x2324(%rip), %rsi      # 0x907e
callq 0x2080
testl %eax, %eax
je 0x75d5
movq %r15, %rdi
leaq 0x2317(%rip), %rsi      # 0x9088
callq 0x2080
testl %eax, %eax
je 0x7994
movq %r15, %rdi
leaq 0x230c(%rip), %rsi      # 0x9094
callq 0x2080
testl %eax, %eax
je 0x7b42
movq %r15, %rdi
leaq 0x2309(%rip), %rsi      # 0x90a8
callq 0x2080
testl %eax, %eax
je 0x7ba0
movq %r15, %rdi
leaq 0x2303(%rip), %rsi      # 0x90b9
callq 0x2080
testl %eax, %eax
je 0x7cf6
movq %r15, %rdi
leaq 0x22e4(%rip), %rsi      # 0x90b1
callq 0x2080
testl %eax, %eax
je 0x8144
movq %r15, %rdi
leaq 0x22da(%rip), %rsi      # 0x90be
callq 0x2080
testl %eax, %eax
je 0x820b
movq %r15, %rdi
leaq 0x22d1(%rip), %rsi      # 0x90cc
callq 0x2080
testl %eax, %eax
je 0x82ef
movq %r15, %rdi
leaq 0x22c8(%rip), %rsi      # 0x90da
callq 0x2080
testl %eax, %eax
je 0x83ab
movq %r15, %rdi
leaq 0x22bb(%rip), %rsi      # 0x90e4
callq 0x2080
testl %eax, %eax
je 0x84dc
movq %r15, %rdi
leaq 0x22ad(%rip), %rsi      # 0x90ed
callq 0x2080
testl %eax, %eax
je 0x8624
movl $0x11, %edx
movq 0x516f(%rip), %rdi      # 0xbfc8
leaq 0x233e(%rip), %rsi      # 0x919e
callq 0x21f0
jmp 0x84c0
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq $0x1, %rdx
jbe 0x8698
leaq 0xd8(%rsp), %rcx
movq %rcx, 0xc8(%rsp)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rdi
callq 0x8b7a
leaq 0xc8(%rsp), %rdi
callq 0x8a13
movl %eax, %r15d
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x6ee2
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x21c0
testl %r15d, %r15d
leaq 0x60(%rsp), %rbx
je 0x7559
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq $0x2, %rdx
jbe 0x86be
leaq 0x70(%rsp), %rcx
movq %rcx, 0x60(%rsp)
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x8b7a
movq %rbx, %rdi
leaq 0x21f6(%rip), %rsi      # 0x9128
callq 0x2080
testl %eax, %eax
je 0x74b8
movq %rbx, %rdi
leaq 0x21ad(%rip), %rsi      # 0x90f6
callq 0x2080
testl %eax, %eax
je 0x74b8
movq 0x60(%rsp), %rax
movzbl (%rax), %r13d
leal -0x41(%r13), %eax
xorl %ecx, %ecx
cmpb $0x4a, %r13b
setl %cl
addl $0xbf, %ecx
movq %rbx, %rsi
xorl %ebx, %ebx
cmpb $0x6a, %r13b
setl %bl
addl $0x9f, %ebx
cmpb $0x1a, %al
cmovbl %ecx, %ebx
movl $0x1, %edx
leaq 0x80(%rsp), %rdi
movq $-0x1, %rcx
callq 0x21e0
movq 0x80(%rsp), %rbp
callq 0x2050
movq %rax, %r12
movl (%rax), %eax
movl %eax, 0x5c(%rsp)
movl $0x0, (%r12)
movq %rbp, %rdi
leaq 0xa0(%rsp), %rsi
movl $0xa, %edx
callq 0x2220
cmpq %rbp, 0xa0(%rsp)
je 0x8727
movq %rax, %r14
addq $-0x80000000, %rax      # imm = 0x80000000
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
jb 0x86fc
movl (%r12), %eax
cmpl $0x22, %eax
je 0x86fc
testl %eax, %eax
movq 0x4fdb(%rip), %rbp      # 0xbff0
jne 0x701f
movl 0x5c(%rsp), %eax
movl %eax, (%r12)
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x7044
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x21c0
addl %r13d, %ebx
movzwl %bx, %eax
shll $0x8, %eax
orl %eax, %r14d
movw %r14w, 0x5148(%rip)     # 0xc1a0
leaq 0x7899(%rip), %rdi      # 0xe8f8
leaq 0x30(%rsp), %r13
callq 0x5324
leaq 0x108c0(%rip), %rdx     # 0x17930
movslq (%rdx), %rcx
leaq 0x88b6(%rip), %rsi      # 0xf930
movq %rax, (%rsi,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, (%rdx)
movzwl %r14w, %edx
leaq 0x786a(%rip), %rdi      # 0xe8f8
movl %r15d, %esi
callq 0x3046
cmpb $0x1, 0x11633(%rip)     # 0x186d0
jne 0x74c1
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movl $0x3, %edx
movq %rax, %rdi
leaq 0x2021(%rip), %rsi      # 0x90fb
callq 0x21f0
leaq 0x50a2(%rip), %rax      # 0xc188
cmpl $0x0, (%rax)
leaq 0x200d(%rip), %r15      # 0x90fd
jle 0x7131
leaq 0x112bf(%rip), %rbx     # 0x183b8
xorl %r14d, %r14d
movq -0x8(%rbx), %rsi
movq (%rbx), %rdx
movq %rbp, %rdi
callq 0x21f0
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x21f0
leaq 0x5066(%rip), %rax      # 0xc188
movslq (%rax), %rax
incq %r14
addq $0x20, %rbx
cmpq %rax, %r14
jl 0x70fc
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
leaq 0x7798(%rip), %rdi      # 0xe8f8
callq 0x5482
movl $0x3, %edx
movq %rbp, %rdi
leaq 0x1f87(%rip), %rsi      # 0x90fb
callq 0x21f0
leaq 0x5008(%rip), %rax      # 0xc188
cmpl $0x0, (%rax)
leaq 0x1f73(%rip), %r15      # 0x90fd
jle 0x71cb
leaq 0x11225(%rip), %rbx     # 0x183b8
xorl %r14d, %r14d
movq -0x8(%rbx), %rsi
movq (%rbx), %rdx
movq %rbp, %rdi
callq 0x21f0
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x21f0
leaq 0x4fcc(%rip), %rax      # 0xc188
movslq (%rax), %rax
incq %r14
addq $0x20, %rbx
cmpq %rax, %r14
jl 0x7196
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
jmp 0x74c1
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq $0x1, %rdx
jbe 0x86ab
leaq 0xb8(%rsp), %rcx
movq %rcx, 0xa8(%rsp)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0x8b7a
leaq 0xa8(%rsp), %rdi
callq 0x8a13
movl %eax, %r14d
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x7270
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x21c0
testl %r14d, %r14d
je 0x76be
callq 0x2060
movq %rax, %r12
movzwl 0x4f18(%rip), %esi      # 0xc1a0
movl %r14d, %edi
callq 0x5c14
movl %eax, %r15d
cmpb $0x1, 0x11436(%rip)     # 0x186d0
jne 0x7317
callq 0x2060
movq %rax, %rbp
movl $0xe, %edx
movq 0x4d40(%rip), %rdi      # 0xbff0
leaq 0x1e5b(%rip), %rsi      # 0x9112
callq 0x21f0
subq %r12, %rbp
cvtsi2sd %rbp, %xmm0
divsd 0x1d74(%rip), %xmm0     # 0x9040
movq 0x4d1d(%rip), %rdi      # 0xbff0
callq 0x2280
movq %rax, %r12
movl $0x4, %edx
movq %rax, %rdi
leaq 0x1e37(%rip), %rsi      # 0x9121
callq 0x21f0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movw %r15w, 0x4e81(%rip)     # 0xc1a0
movzwl %r15w, %r12d
cmpl $0x8000, %r12d          # imm = 0x8000
jne 0x773a
movl $0x6, %edx
movq 0x4c8c(%rip), %rdi      # 0xbfc8
leaq 0x1de3(%rip), %rsi      # 0x9126
callq 0x21f0
movq 0x4c79(%rip), %rcx      # 0xbfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0x4c5b(%rip), %rdi      # 0xbfc8
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
jmp 0x7979
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq $0x1, %rdx
jbe 0x86e9
movq 0x20(%rax), %r12
callq 0x2050
movq %rax, %r15
movl (%rax), %ebp
movl $0x0, (%rax)
movq %r12, %rdi
movq %rbx, %rsi
movl $0xa, %edx
callq 0x2220
cmpq %r12, 0x60(%rsp)
je 0x86dd
movq %rax, %r14
addq $-0x80000000, %rax      # imm = 0x80000000
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
jb 0x86d1
movl (%r15), %eax
cmpl $0x22, %eax
je 0x86d1
testl %eax, %eax
jne 0x740f
movl %ebp, (%r15)
cmpl $0x2, %r14d
jl 0x743c
leaq 0x4d6c(%rip), %rax      # 0xc188
movl (%rax), %eax
movl $0x80000001, %ecx       # imm = 0x80000001
andl %ecx, %eax
xorl %ecx, %ecx
cmpl $0x1, %eax
sete %cl
leal (%rcx,%rcx,4), %eax
addl $0x4, %eax
cmpl %r14d, %eax
jge 0x7ab6
movl $0x1a, %edx
movq 0x4b80(%rip), %rdi      # 0xbfc8
leaq 0x1cde(%rip), %rsi      # 0x912d
callq 0x21f0
movq 0x4b6d(%rip), %rcx      # 0xbfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0x4b4f(%rip), %rdi      # 0xbfc8
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movb $0x1, %bpl
movq %rax, %rdi
callq 0x2110
jmp 0x81cd
movw $0x8000, 0x4cdf(%rip)   # imm = 0x8000
movl $0x2, %edx
movq 0x4afb(%rip), %rdi      # 0xbfc8
leaq 0x1c2b(%rip), %rsi      # 0x90ff
callq 0x21f0
movq 0x4ae8(%rip), %rcx      # 0xbfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0x4aca(%rip), %rdi      # 0xbfc8
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x7551
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x21c0
movb $0x1, %bpl
jmp 0x81cd
movl $0xf, %edx
movq 0x4a63(%rip), %rdi      # 0xbfc8
leaq 0x1b96(%rip), %rsi      # 0x9102
callq 0x21f0
movq 0x4a50(%rip), %rcx      # 0xbfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0x4a32(%rip), %rdi      # 0xbfc8
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movb $0x1, %bpl
movq %rax, %rdi
callq 0x2110
jmp 0x81cd
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq $0x1, %rdx
jbe 0x8708
movq 0x20(%rax), %r15
callq 0x2050
movq %rax, %r14
movl (%rax), %ebp
movl $0x0, (%rax)
movq %r15, %rdi
movq %rbx, %rsi
movl $0xa, %edx
callq 0x2220
cmpq %r15, 0x60(%rsp)
je 0x871b
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x8733
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x8733
testl %ecx, %ecx
jne 0x764c
movl %ebp, (%r14)
leal -0x16(%rax), %ecx
cmpl $-0x14, %ecx
ja 0x7a14
movl $0x13, %edx
movq 0x4964(%rip), %rdi      # 0xbfc8
leaq 0x1b0c(%rip), %rsi      # 0x9177
callq 0x21f0
movq 0x4951(%rip), %rcx      # 0xbfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0x4933(%rip), %rdi      # 0xbfc8
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
jmp 0x7a9b
movl $0xf, %edx
movq 0x48fe(%rip), %rdi      # 0xbfc8
leaq 0x1a31(%rip), %rsi      # 0x9102
callq 0x21f0
movq 0x48eb(%rip), %rcx      # 0xbfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0x48cd(%rip), %rdi      # 0xbfc8
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movb $0x1, %bpl
movq %rax, %rdi
callq 0x2110
jmp 0x81cd
leaq 0x71b7(%rip), %rdi      # 0xe8f8
callq 0x5324
leaq 0x101e3(%rip), %rdx     # 0x17930
movslq (%rdx), %rcx
leaq 0x81d9(%rip), %rsi      # 0xf930
movq %rax, (%rsi,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, (%rdx)
leaq 0x7191(%rip), %rdi      # 0xe8f8
movl %r14d, %esi
movl %r12d, %edx
callq 0x3046
cmpb $0x1, 0x10f57(%rip)     # 0x186d0
jne 0x78ed
movq 0x486a(%rip), %rcx      # 0xbff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0x484c(%rip), %rdi      # 0xbff0
callq 0x2040
movq %rax, %rdi
callq 0x2110
movl $0x3, %edx
movq %rax, %rdi
leaq 0x193b(%rip), %rsi      # 0x90fb
callq 0x21f0
leaq 0x49bc(%rip), %rax      # 0xc188
cmpl $0x0, (%rax)
movq 0x481a(%rip), %r12      # 0xbff0
jle 0x781b
leaq 0x10bd9(%rip), %rbx     # 0x183b8
xorl %r14d, %r14d
movq -0x8(%rbx), %rsi
movq (%rbx), %rdx
movq %r12, %rdi
callq 0x21f0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x18fd(%rip), %rsi      # 0x90fd
callq 0x21f0
leaq 0x497c(%rip), %rax      # 0xc188
movslq (%rax), %rax
incq %r14
addq $0x20, %rbx
cmpq %rax, %r14
jl 0x77e2
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0x47b6(%rip), %rdi      # 0xbff0
callq 0x2040
movq %rax, %rdi
callq 0x2110
leaq 0x70aa(%rip), %rdi      # 0xe8f8
callq 0x5482
movl $0x3, %edx
movq 0x4791(%rip), %rdi      # 0xbff0
leaq 0x1895(%rip), %rsi      # 0x90fb
callq 0x21f0
leaq 0x4916(%rip), %rax      # 0xc188
cmpl $0x0, (%rax)
movq 0x4774(%rip), %r12      # 0xbff0
jle 0x78c1
leaq 0x10b33(%rip), %rbx     # 0x183b8
xorl %r14d, %r14d
movq -0x8(%rbx), %rsi
movq (%rbx), %rdx
movq %r12, %rdi
callq 0x21f0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x1857(%rip), %rsi      # 0x90fd
callq 0x21f0
leaq 0x48d6(%rip), %rax      # 0xc188
movslq (%rax), %rax
incq %r14
addq $0x20, %rbx
cmpq %rax, %r14
jl 0x7888
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0x4710(%rip), %rdi      # 0xbff0
callq 0x2040
movq %rax, %rdi
callq 0x2110
movl $0x2, %edx
movq 0x46cf(%rip), %rdi      # 0xbfc8
leaq 0x17ff(%rip), %rsi      # 0x90ff
callq 0x21f0
movl %r15d, %eax
shrl $0x3, %eax
andl $0x1fe0, %eax           # imm = 0x1FE0
leaq 0x10a79(%rip), %rcx     # 0x18390
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq 0x46a1(%rip), %rdi      # 0xbfc8
callq 0x21f0
movzbl %r15b, %esi
movq %rax, %rdi
callq 0x22b0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movb $0x1, %bpl
movq %rax, %rdi
callq 0x2110
jmp 0x81cd
movw $0x8000, 0x4803(%rip)   # imm = 0x8000
leaq 0x6f54(%rip), %rdi      # 0xe8f8
callq 0x532a
callq 0x69aa
movl $0x2, %edx
movq 0x460e(%rip), %rdi      # 0xbfc8
leaq 0x173e(%rip), %rsi      # 0x90ff
callq 0x21f0
movq 0x45fb(%rip), %rcx      # 0xbfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0x45dd(%rip), %rdi      # 0xbfc8
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
jmp 0x81b7
leaq 0x476d(%rip), %rcx      # 0xc188
movl %eax, (%rcx)
addl $0x2, %eax
leaq 0x4765(%rip), %rcx      # 0xc18c
movl %eax, (%rcx)
leaq 0x6ec8(%rip), %rdi      # 0xe8f8
callq 0x532a
callq 0x69aa
movl $0x2, %edx
movq 0x4582(%rip), %rdi      # 0xbfc8
leaq 0x16b2(%rip), %rsi      # 0x90ff
callq 0x21f0
movq 0x456f(%rip), %rcx      # 0xbfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0x4551(%rip), %rdi      # 0xbfc8
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movb $0x1, %bpl
movq %rax, %rdi
callq 0x2110
jmp 0x81cd
leaq 0x6e3b(%rip), %rdi      # 0xe8f8
callq 0x5318
testb %al, %al
je 0x7c06
leaq 0x46b7(%rip), %rax      # 0xc188
movl (%rax), %ebp
cmpl $0x6, %ebp
jg 0x7d6e
movl $0x16, %edx
movq 0x44e0(%rip), %rdi      # 0xbfc8
leaq 0x166e(%rip), %rsi      # 0x915d
callq 0x21f0
movq 0x44cd(%rip), %rcx      # 0xbfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0x44af(%rip), %rdi      # 0xbfc8
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
jmp 0x749d
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq $0x1, %rdx
jbe 0x873f
movq 0x20(%rax), %r15
callq 0x2050
movq %rax, %r14
movl (%rax), %ebp
movl $0x0, (%rax)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2210
cmpq %r15, 0x60(%rsp)
je 0x8752
movl (%r14), %eax
testl %eax, %eax
je 0x7c6c
cmpl $0x22, %eax
jne 0x7c6f
jmp 0x875e
movl $0x3, %edx
movq 0x441c(%rip), %rdi      # 0xbfc8
leaq 0x15d8(%rip), %rsi      # 0x918b
callq 0x21f0
movq 0x4409(%rip), %rcx      # 0xbfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0x43eb(%rip), %rdi      # 0xbfc8
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
jmp 0x81b7
movl $0x14, %edx
movq 0x43b6(%rip), %rdi      # 0xbfc8
leaq 0x152f(%rip), %rsi      # 0x9148
callq 0x21f0
movq 0x43a3(%rip), %rcx      # 0xbfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0x4385(%rip), %rdi      # 0xbfc8
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
jmp 0x749d
movl %ebp, (%r14)
leaq 0x4522(%rip), %rax      # 0xc198
movss %xmm0, (%rax)
movl $0x2, %edx
movq 0x4342(%rip), %rdi      # 0xbfc8
leaq 0x1472(%rip), %rsi      # 0x90ff
callq 0x21f0
movq 0x432f(%rip), %rcx      # 0xbfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0x4311(%rip), %rdi      # 0xbfc8
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movb $0x1, %bpl
movq %rax, %rdi
callq 0x2110
jmp 0x81cd
movl $0x2, %edx
movq 0x42c6(%rip), %rdi      # 0xbfc8
leaq 0x13f6(%rip), %rsi      # 0x90ff
callq 0x21f0
movq 0x10473(%rip), %rsi     # 0x18188
movq 0x10474(%rip), %rdx     # 0x18190
movq 0x42a5(%rip), %rdi      # 0xbfc8
callq 0x21f0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
jmp 0x81b7
xorl %r15d, %r15d
cmpl $0xd, %ebp
setge %bl
movl $0x2, %edx
movq 0x4245(%rip), %rdi      # 0xbfc8
leaq 0x13ea(%rip), %rsi      # 0x9174
callq 0x21f0
movb %bl, %r15b
addl $0x3, %r15d
movq %rbp, %rbx
incq %rbx
shrq %rbx
subl %r15d, %ebp
incl %ebp
addl $-0x2, %r14d
leaq 0x1299(%rip), %rcx      # 0x9048
movslq (%rcx,%r14,4), %rax
addq %rcx, %rax
movl %ebp, %r12d
jmpq *%rax
movl %ebx, %eax
shll $0x8, %eax
orl %ebx, %eax
movzwl %ax, %edx
leaq 0x6b2c(%rip), %rdi      # 0xe8f8
movl $0x1, %esi
callq 0x3046
movq %rbx, %rax
shlq $0x5, %rax
leaq 0x105ac(%rip), %rcx     # 0x18390
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq 0x41d4(%rip), %rdi      # 0xbfc8
callq 0x21f0
movq %rax, %rdi
movl %ebx, %esi
callq 0x22b0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x12eb(%rip), %rsi      # 0x90fd
callq 0x21f0
movl %ebx, %eax
shll $0x8, %eax
orl %ebp, %eax
movzwl %ax, %edx
leaq 0x6ad0(%rip), %rdi      # 0xe8f8
movl $0x1, %esi
callq 0x3046
movl %ebx, %eax
shlq $0x5, %rax
leaq 0x10551(%rip), %rcx     # 0x18390
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq 0x4179(%rip), %rdi      # 0xbfc8
callq 0x21f0
movq %rax, %rdi
movl %ebp, %esi
callq 0x22b0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x1290(%rip), %rsi      # 0x90fd
callq 0x21f0
movl %ebx, %eax
shll $0x8, %eax
orl %r15d, %eax
movzwl %ax, %edx
leaq 0x6a74(%rip), %rdi      # 0xe8f8
movl $0x1, %esi
callq 0x3046
movl %ebx, %eax
shlq $0x5, %rax
leaq 0x104f5(%rip), %rcx     # 0x18390
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq 0x411d(%rip), %rdi      # 0xbfc8
callq 0x21f0
movq %rax, %rdi
movl %r15d, %esi
callq 0x22b0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x1233(%rip), %rsi      # 0x90fd
callq 0x21f0
movl %ebp, %eax
shll $0x8, %eax
orl %ebx, %eax
movzwl %ax, %edx
leaq 0x6a18(%rip), %rdi      # 0xe8f8
movl $0x1, %esi
callq 0x3046
movq %r12, %rax
shlq $0x5, %rax
leaq 0x10498(%rip), %rcx     # 0x18390
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq 0x40c0(%rip), %rdi      # 0xbfc8
callq 0x21f0
movq %rax, %rdi
movl %ebx, %esi
callq 0x22b0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x11d7(%rip), %rsi      # 0x90fd
callq 0x21f0
movl %r15d, %eax
shll $0x8, %eax
orl %ebx, %eax
movzwl %ax, %edx
leaq 0x69bb(%rip), %rdi      # 0xe8f8
movl $0x1, %esi
callq 0x3046
movl %r15d, %eax
shll $0x5, %eax
leaq 0x1043c(%rip), %rcx     # 0x18390
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq 0x4064(%rip), %rdi      # 0xbfc8
callq 0x21f0
movq %rax, %rdi
movl %ebx, %esi
callq 0x22b0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x117b(%rip), %rsi      # 0x90fd
callq 0x21f0
movl %ebp, %eax
shll $0x8, %eax
orl %r15d, %eax
movzwl %ax, %edx
leaq 0x695f(%rip), %rdi      # 0xe8f8
movl $0x1, %esi
callq 0x3046
movq %r12, %rax
shlq $0x5, %rax
leaq 0x103df(%rip), %rcx     # 0x18390
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq 0x4007(%rip), %rdi      # 0xbfc8
callq 0x21f0
movq %rax, %rdi
movl %r15d, %esi
callq 0x22b0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x111d(%rip), %rsi      # 0x90fd
callq 0x21f0
movl %r15d, %eax
shll $0x8, %eax
orl %ebp, %eax
movzwl %ax, %edx
leaq 0x6901(%rip), %rdi      # 0xe8f8
movl $0x1, %esi
callq 0x3046
movl %r15d, %eax
shll $0x5, %eax
leaq 0x10382(%rip), %rcx     # 0x18390
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq 0x3faa(%rip), %rdi      # 0xbfc8
callq 0x21f0
movq %rax, %rdi
movl %ebp, %esi
callq 0x22b0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x10c1(%rip), %rsi      # 0x90fd
callq 0x21f0
movl %r15d, %edx
shll $0x8, %edx
orl %r15d, %edx
leaq 0x68a7(%rip), %rdi      # 0xe8f8
movl $0x1, %esi
callq 0x3046
movl %ebp, %eax
shll $0x8, %eax
orl %ebp, %eax
movzwl %ax, %edx
leaq 0x688c(%rip), %rdi      # 0xe8f8
movl $0x1, %esi
callq 0x3046
movl %r15d, %eax
shll $0x5, %eax
leaq 0x1030d(%rip), %rcx     # 0x18390
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq 0x3f35(%rip), %rdi      # 0xbfc8
callq 0x21f0
movq %rax, %rdi
movl %r15d, %esi
callq 0x22b0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x1048(%rip), %rsi      # 0x90fd
callq 0x21f0
shlq $0x5, %r12
leaq 0x102cb(%rip), %rax     # 0x18390
movq (%r12,%rax), %rsi
movq 0x8(%r12,%rax), %rdx
movq %r14, %rdi
callq 0x21f0
movq %rax, %rdi
movl %ebp, %esi
callq 0x22b0
movq 0x3ee1(%rip), %rcx      # 0xbfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0x3ec3(%rip), %rdi      # 0xbfc8
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movb $0x1, %bpl
movq %rax, %rdi
callq 0x2110
jmp 0x81cd
movl $0x2, %edx
movq 0x3e78(%rip), %rdi      # 0xbfc8
leaq 0xfa8(%rip), %rsi       # 0x90ff
callq 0x21f0
movq 0x10045(%rip), %rsi     # 0x181a8
movq 0x10046(%rip), %rdx     # 0x181b0
movq 0x3e57(%rip), %rdi      # 0xbfc8
callq 0x21f0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movb $0x1, %bpl
movq %rax, %rdi
callq 0x2110
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x81e4
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21c0
leaq 0x40(%rsp), %rdi
callq 0x8ae0
testb %bpl, %bpl
movq 0x3de0(%rip), %rbx      # 0xbfd8
movq %rsp, %r14
leaq 0x20(%rsp), %r15
jne 0x6c9a
jmp 0x8657
movq 0x40(%rsp), %rbx
movq 0x48(%rsp), %rdx
subq %rbx, %rdx
sarq $0x5, %rdx
cmpq $0x2, %rdx
jb 0x876a
movq 0x28(%rbx), %r14
movl $0x8, %r15d
leaq 0xff99(%rip), %rax      # 0x181d0
movq (%r15,%rax), %rdx
cmpq %r14, %rdx
jne 0x8266
testq %rdx, %rdx
je 0x8377
movq 0x20(%rbx), %rsi
leaq 0xff7c(%rip), %rax      # 0x181d0
movq -0x8(%r15,%rax), %rdi
callq 0x21d0
testl %eax, %eax
je 0x8377
addq $0x20, %r15
cmpq $0x1c8, %r15            # imm = 0x1C8
jne 0x8230
movl $0x7, %edx
movq 0x3d49(%rip), %rdi      # 0xbfc8
leaq 0xf10(%rip), %rsi       # 0x9196
callq 0x21f0
movq 0x3d36(%rip), %rcx      # 0xbfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0x3d18(%rip), %rdi      # 0xbfc8
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movb $0x1, %bpl
movq %rax, %rdi
callq 0x2110
jmp 0x81cd
movl $0x2, %edx
movq 0x3ccd(%rip), %rdi      # 0xbfc8
leaq 0xdfd(%rip), %rsi       # 0x90ff
callq 0x21f0
movq 0x3cba(%rip), %rdi      # 0xbfc8
callq 0x20d0
movl $0x8, %ebx
leaq 0xfeb1(%rip), %rax      # 0x181d0
movq -0x8(%rbx,%rax), %rsi
movq (%rbx,%rax), %rdx
movq 0x3c99(%rip), %rdi      # 0xbfc8
callq 0x21f0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
addq $0x20, %rbx
cmpq $0x1c8, %rbx            # imm = 0x1C8
jne 0x8318
movq 0x3c56(%rip), %rax      # 0xbfc8
jmp 0x84cc
movl $0x6, %edx
movq 0x3c45(%rip), %rdi      # 0xbfc8
leaq 0xe05(%rip), %rsi       # 0x918f
callq 0x21f0
movq 0x3c32(%rip), %rdi      # 0xbfc8
callq 0x20d0
movb $0x1, %bpl
movq %rax, %rdi
callq 0x20d0
jmp 0x81cd
movl $0x2, %edx
movq 0x3c11(%rip), %rdi      # 0xbfc8
leaq 0xd41(%rip), %rsi       # 0x90ff
callq 0x21f0
movq 0x3bfe(%rip), %rdi      # 0xbfc8
callq 0x20d0
movl $0x3, %edx
movq 0x3bed(%rip), %rdi      # 0xbfc8
leaq 0xd19(%rip), %rsi       # 0x90fb
callq 0x21f0
leaq 0x3d9a(%rip), %rax      # 0xc188
cmpl $0x0, (%rax)
leaq 0xd05(%rip), %r15       # 0x90fd
jle 0x843d
leaq 0xffb7(%rip), %rbx      # 0x183b8
xorl %r14d, %r14d
movq -0x8(%rbx), %rsi
movq (%rbx), %rdx
movq 0x3bb6(%rip), %rdi      # 0xbfc8
callq 0x21f0
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x21f0
leaq 0x3d5a(%rip), %rax      # 0xc188
movslq (%rax), %rax
incq %r14
addq $0x20, %rbx
cmpq %rax, %r14
jl 0x8404
movq 0x3b84(%rip), %rdi      # 0xbfc8
callq 0x20d0
leaq 0x64a8(%rip), %rdi      # 0xe8f8
callq 0x533c
movl $0x3, %edx
movq 0x3b67(%rip), %rdi      # 0xbfc8
leaq 0xc93(%rip), %rsi       # 0x90fb
callq 0x21f0
leaq 0x3d14(%rip), %rax      # 0xc188
cmpl $0x0, (%rax)
jle 0x84c0
leaq 0xff38(%rip), %rbx      # 0x183b8
xorl %r14d, %r14d
movq -0x8(%rbx), %rsi
movq (%rbx), %rdx
movq 0x3b37(%rip), %rdi      # 0xbfc8
callq 0x21f0
movl $0x1, %edx
movq %rax, %rdi
leaq 0xc58(%rip), %rsi       # 0x90fd
callq 0x21f0
leaq 0x3cd7(%rip), %rax      # 0xc188
movslq (%rax), %rax
incq %r14
addq $0x20, %rbx
cmpq %rax, %r14
jl 0x8483
movq 0x3b01(%rip), %rdi      # 0xbfc8
callq 0x20d0
movb $0x1, %bpl
movq %rax, %rdi
callq 0x20d0
jmp 0x81cd
movl $0x1, %r14d
movw $0x8000, %r15w          # imm = 0x8000
movl $0x8000, %ebx           # imm = 0x8000
callq 0x2060
movq %rax, %r12
movzwl %r15w, %esi
movl %r14d, %edi
callq 0x5c14
movl %eax, %r13d
cmpb $0x1, 0x101c6(%rip)     # 0x186d0
jne 0x858a
callq 0x2060
movq %rax, %rbp
movl $0xe, %edx
movq 0x3ad0(%rip), %rdi      # 0xbff0
leaq 0xbeb(%rip), %rsi       # 0x9112
callq 0x21f0
subq %r12, %rbp
xorps %xmm0, %xmm0
cvtsi2sd %rbp, %xmm0
divsd 0xb01(%rip), %xmm0      # 0x9040
movq 0x3aaa(%rip), %rdi      # 0xbff0
callq 0x2280
movq %rax, %r12
movl $0x4, %edx
movq %rax, %rdi
leaq 0xbc4(%rip), %rsi       # 0x9121
callq 0x21f0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movl %r13d, %eax
negw %ax
jo 0x85cb
leaq 0x635f(%rip), %rdi      # 0xe8f8
callq 0x5324
leaq 0xf38b(%rip), %rdx      # 0x17930
movslq (%rdx), %rcx
leaq 0x7381(%rip), %rsi      # 0xf930
movq %rax, (%rsi,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, (%rdx)
movzwl %r13w, %edx
leaq 0x6335(%rip), %rdi      # 0xe8f8
movl %r14d, %esi
callq 0x3046
movl $0x3, %eax
subl %r14d, %eax
xorl %ebx, %r15d
movl %r13d, %ecx
xorl %ebx, %ecx
orw %r15w, %cx
movl %r13d, %r15d
movl %eax, %r14d
jne 0x84ec
movl $0x2, %edx
movq 0x39d1(%rip), %rdi      # 0xbfc8
leaq 0xb01(%rip), %rsi       # 0x90ff
leaq 0x30(%rsp), %r13
callq 0x21f0
movq 0x39b9(%rip), %rdi      # 0xbfc8
callq 0x20d0
movb $0x1, %bpl
movq %rax, %rdi
callq 0x20d0
jmp 0x81cd
movl $0x2, %edx
movq 0x3998(%rip), %rdi      # 0xbfc8
leaq 0xac8(%rip), %rsi       # 0x90ff
callq 0x21f0
movq 0x3985(%rip), %rdi      # 0xbfc8
callq 0x20d0
movq %rax, %rdi
callq 0x20d0
xorl %ebp, %ebp
jmp 0x81cd
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x8672
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21c0
xorl %eax, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb67(%rip), %rdi       # 0x91f4
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2250
leaq 0xb55(%rip), %rdi       # 0x91f4
movl $0x1, %esi
xorl %eax, %eax
callq 0x2250
leaq 0xb42(%rip), %rdi       # 0x91f4
movl $0x1, %esi
xorl %eax, %eax
callq 0x2250
leaq 0xb2f(%rip), %rdi       # 0x91f4
movl $0x2, %esi
xorl %eax, %eax
callq 0x2250
leaq 0xae8(%rip), %rdi       # 0x91c0
callq 0x2230
leaq 0xadc(%rip), %rdi       # 0x91c0
callq 0x2100
leaq 0xb04(%rip), %rdi       # 0x91f4
movl $0x1, %esi
xorl %eax, %eax
callq 0x2250
leaq 0xabd(%rip), %rdi       # 0x91c0
callq 0x2230
leaq 0xae5(%rip), %rdi       # 0x91f4
movl $0x1, %esi
xorl %eax, %eax
callq 0x2250
leaq 0xa9e(%rip), %rdi       # 0x91c0
callq 0x2100
leaq 0xa92(%rip), %rdi       # 0x91c0
callq 0x2100
leaq 0xa86(%rip), %rdi       # 0x91c0
callq 0x2230
leaq 0xaae(%rip), %rdi       # 0x91f4
movl $0x1, %esi
xorl %eax, %eax
callq 0x2250
leaq 0xa6c(%rip), %rdi       # 0x91c5
callq 0x2100
leaq 0xa60(%rip), %rdi       # 0x91c5
callq 0x2230
leaq 0xa83(%rip), %rdi       # 0x91f4
movl $0x1, %esi
xorl %eax, %eax
callq 0x2250
leaq 0xa3c(%rip), %rdi       # 0x91c0
callq 0x2100
leaq 0xa30(%rip), %rdi       # 0x91c0
callq 0x2100
leaq 0xa24(%rip), %rdi       # 0x91c0
callq 0x2100
leaq 0xa18(%rip), %rdi       # 0x91c0
callq 0x2230
jmp 0x88b3
jmp 0x87b6
jmp 0x87b6
movq %rax, %rbx
jmp 0x88f2
jmp 0x8865
jmp 0x87c7
jmp 0x87c7
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x87d3
movl %ebp, (%r14)
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x88e0
jmp 0x88b3
jmp 0x8865
jmp 0x8801
jmp 0x8865
jmp 0x88b3
jmp 0x88b3
movq %rax, %rbx
jmp 0x8846
jmp 0x8865
jmp 0x8865
jmp 0x8865
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x8868
movl %ebp, (%r14)
jmp 0x8868
movq %rax, %rbx
cmpl $0x0, (%r12)
jne 0x8821
movl 0x5c(%rsp), %eax
movl %eax, (%r12)
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x8846
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x21c0
leaq 0x30(%rsp), %r13
jmp 0x8895
jmp 0x8865
jmp 0x8865
jmp 0x88b3
jmp 0x88b3
jmp 0x88b3
movq %rax, %rbx
cmpl $0x0, (%r15)
jne 0x8868
movl %ebp, (%r15)
jmp 0x8868
movq %rax, %rbx
leaq 0x30(%rsp), %r13
jmp 0x88b6
jmp 0x88b3
jmp 0x88b3
jmp 0x8892
jmp 0x88b3
jmp 0x88b3
jmp 0x88b3
jmp 0x88b3
jmp 0x8881
jmp 0x8881
movq %rax, %rbx
jmp 0x88cd
jmp 0x88fa
jmp 0x88b3
jmp 0x88b3
jmp 0x88b3
jmp 0x8892
jmp 0x8892
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x88b6
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x21c0
jmp 0x88b6
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x88cd
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21c0
leaq 0x40(%rsp), %rdi
callq 0x8ae0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x88f2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x22c0
movq %rax, %rbx
jmp 0x88d7