// File: /workspace/github_cpp_makefile_star2_O1/sun98[P]Mini-DFS/namenode.cpp
// Function: NameServer::operator()()
void NameServer::operator()()
{
    while (true)
    {
        std::vector<std::string> parameters = parse_cmd();
        std::vector<int> idx;
        std::ifstream is;
        char *buf = nullptr;
        // md5 checksum for replicate chunks;
        MD5 md5;
        if (parameters.empty())
        {
            std::cerr << "input a blank line" << std::endl;
            continue;
        }
        if (parameters[0] == "quit" || parameters[0] == "exit")
        {
            exit(0);
        }
        // list all the files in name server.
        else if (parameters[0] == "ls")
        {
            if (parameters.size() != 1)
            {
                std::cerr << "Usage: "
                          << "ls (list all files in name server)" << std::endl;
            }
            else
            {
                std::cout << "File ID\tChunk Num\tFile Name" << std::endl;
                fileTree_.list(meta);
            }
            continue;
        }
        // upload file to miniDFS
        else if (parameters[0] == "up")
        {
            if (parameters.size() != 3)
            {
                std::cerr << "Usage: "
                          << "up src dest" << std::endl;
                continue;
            }
            is.open(parameters[1], std::ifstream::ate | std::ifstream::binary);
            if (!is)
            {
                std::cerr << "Failed in opening src file: file " << parameters[1] << std::endl;
                continue;
            }
            else if (!fileTree_.insert_node(parameters[2], true))
            {
                std::cerr << "Failed in creating dest file.\nPlease ensure File: " << parameters[2] << " does not exist" << std::endl;
                continue;
            }
            else
            {
                int totalSize = is.tellg();
                buf = new char[totalSize];
                is.seekg(0, is.beg);
                is.read(buf, totalSize);
                std::vector<double> serverSize;
                for (const auto &server : dataServers_)
                    serverSize.push_back(server->size());
                idx = argsort<double>(serverSize);
                // std::cout << "total size " << totalSize << std::endl;
                ++idCnt_;
                for (int i = 0; i < numReplicate_; ++i)
                {
                    std::unique_lock<std::mutex> lk(dataServers_[idx[i]]->mtx);
                    meta[parameters[2]] = std::make_pair(idCnt_, totalSize);
                    dataServers_[idx[i]]->cmd = "up";
                    dataServers_[idx[i]]->fid = idCnt_;
                    dataServers_[idx[i]]->bufSize = totalSize;
                    dataServers_[idx[i]]->buf = buf;
                    dataServers_[idx[i]]->finish = false;
                    lk.unlock();
                    dataServers_[idx[i]]->cv.notify_all();
                }
            }
        }
        // fetch file from miniDFS
        else if (parameters[0] == "down" || parameters[0] == "down_id")
        {
            if (parameters.size() != 3 && parameters.size() != 4)
            {
                std::cerr << "Usage: "
                          << "down src dest" << std::endl;
                std::cerr << "Usage: "
                          << "down_id file_id offset dest" << std::endl;
                continue;
            }
            else
            {
                if (parameters[0] == "down" && meta.find(parameters[1]) == meta.end())
                {
                    std::cerr << "Error: no such file in MiniDFS." << std::endl;
                    continue;
                }
                for (int i = 0; i < 4; ++i)
                {
                    std::unique_lock<std::mutex> lk(dataServers_[i]->mtx);
                    dataServers_[i]->cmd = parameters[0];
                    if (parameters[0] == "down")
                    {
                        std::pair<int, int> metaData = meta[parameters[1]];
                        dataServers_[i]->fid = metaData.first;
                        dataServers_[i]->bufSize = metaData.second;
                    }
                    else
                    {
                        dataServers_[i]->fid = std::stoi(parameters[1]);
                        dataServers_[i]->offset = std::stoi(parameters[2]);
                    }
                    dataServers_[i]->finish = false;
                    lk.unlock();
                    dataServers_[i]->cv.notify_all();
                }
            }
        }
        // locate the data server given file ID and Offset.
        else if (parameters[0] == "loc")
        {
            if (parameters.size() != 3)
            {
                std::cerr << "Usage: "
                          << "loc file_id offset" << std::endl;
                continue;
            }
            else
            {
                for (int i = 0; i < 4; ++i)
                {
                    std::unique_lock<std::mutex> lk(dataServers_[i]->mtx);
                    dataServers_[i]->cmd = "loc";
                    dataServers_[i]->fid = std::stoi(parameters[1]);
                    dataServers_[i]->offset = std::stoi(parameters[2]);
                    dataServers_[i]->finish = false;
                    lk.unlock();
                    dataServers_[i]->cv.notify_all();
                }
            }
        }
        else
            std::cerr << "Unknown command." << std::endl;

        // waiting for the finish of data server.
        for (const auto &server : dataServers_)
        {
            std::unique_lock<std::mutex> lk(server->mtx);
            (server->cv).wait(lk, [&]() { return server->finish; });
            lk.unlock();
            (server->cv).notify_all();
        }

        // work after processing of data server
        if (parameters[0] == "down" || parameters[0] == "down_id")
        {
            std::string md5_checksum, pre_checksum;
            for (int i = 0; i < 4; ++i)
            {
                if (dataServers_[i]->bufSize)
                {
                    std::ofstream os;
                    if (parameters[0] == "down")
                        os.open(parameters[2]);
                    else if (parameters[0] == "down_id")
                        os.open(parameters[3]);
                    if (!os)
                        std::cerr << "Failed in creating file.\nPlease ensure dest directory exists." << std::endl;
                    else
                    {
                        os.write(dataServers_[i]->buf, dataServers_[i]->bufSize);
                        os.close();
                        md5.update(dataServers_[i]->buf, dataServers_[i]->bufSize);
                        md5.finalize();
                        md5_checksum = md5.toString();
                        if (!pre_checksum.empty() && pre_checksum != md5_checksum)
                        {
                            std::cerr << "Error: inconsistent checksum for files from different data servers. File may be corrupted." << std::endl;
                        }
                        else if (!pre_checksum.empty() && pre_checksum == md5_checksum)
                        {
                            std::cout << "MD5 checksum passed." << std::endl;
                        }
                        pre_checksum = md5_checksum;
                    }
                    delete[] dataServers_[i]->buf;
                }
            }
        }
        else if (parameters[0] == "up")
        {
            std::cout << "Upload success. File ID is " << idCnt_ << std::endl;
        }
        else if (parameters[0] == "loc" || parameters[0] == "ls")
        {
            bool notFound = true;
            for (int i = 0; i < 4; ++i)
            {
                if (dataServers_[i]->bufSize)
                {
                    notFound = false;
                    std::cout << "Found File ID=" << parameters[1] << ", offset=" << parameters[2] << " at " << dataServers_[i]->get_name() << std::endl;
                }
            }
            if (notFound)
                std::cout << "Error, File ID=" << parameters[1] << ", offset=" << parameters[2] << " not found." << std::endl;
        }
        delete[] buf;
        is.close();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x548, %rsp            # imm = 0x548
movq %rdi, %rbx
leaq 0x28(%rdi), %rax
movq %rax, -0x80(%rbp)
leaq 0x30(%rdi), %rax
movq %rax, -0xc0(%rbp)
leaq 0x18(%rdi), %rax
movq %rax, -0x88(%rbp)
movq 0x50d2(%rip), %rax      # 0xbfc0
movq (%rax), %rcx
movq %rcx, -0x98(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x90(%rbp)
leaq -0x40(%rbp), %r15
leaq -0x2f0(%rbp), %r14
movq %rdi, -0x48(%rbp)
movq %r15, %rdi
callq 0x6d38
leaq -0x568(%rbp), %rdi
callq 0x32d0
xorl %r13d, %r13d
leaq -0x35c(%rbp), %rdi
callq 0x5a2a
movq -0x40(%rbp), %rdi
movl $0x12, %r12d
cmpq -0x38(%rbp), %rdi
je 0x7050
leaq 0x230e(%rip), %rsi      # 0x925e
callq 0x30e0
testl %eax, %eax
je 0x7f57
movq -0x40(%rbp), %rdi
leaq 0x22fb(%rip), %rsi      # 0x9263
callq 0x30e0
testl %eax, %eax
je 0x7f57
movq -0x40(%rbp), %rdi
leaq 0x22e8(%rip), %rsi      # 0x9268
callq 0x30e0
testl %eax, %eax
je 0x705c
movq -0x40(%rbp), %rdi
leaq 0x2082(%rip), %rsi      # 0x901a
callq 0x30e0
testl %eax, %eax
je 0x72c0
movq -0x40(%rbp), %rdi
leaq 0x206d(%rip), %rsi      # 0x901d
callq 0x30e0
testl %eax, %eax
je 0x70dc
movq -0x40(%rbp), %rdi
leaq 0x205e(%rip), %rsi      # 0x9026
callq 0x30e0
testl %eax, %eax
je 0x70dc
movq -0x40(%rbp), %rdi
leaq 0x2042(%rip), %rsi      # 0x9022
callq 0x30e0
testl %eax, %eax
je 0x74c1
movl $0x10, %edx
xorl %r13d, %r13d
movq 0x4ff4(%rip), %rdi      # 0xbff0
leaq 0x237d(%rip), %rsi      # 0x9380
callq 0x32e0
movq 0x4fe1(%rip), %rcx      # 0xbff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
xorl %r13d, %r13d
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
xorl %r13d, %r13d
movq 0x4fbd(%rip), %rdi      # 0xbff0
callq 0x3040
xorl %r13d, %r13d
movq %rax, %rdi
callq 0x31b0
movq $0x0, -0x78(%rbp)
jmp 0x7645
leaq 0x21f4(%rip), %rsi      # 0x924b
jmp 0x744b
movq -0x38(%rbp), %rax
subq -0x40(%rbp), %rax
cmpq $0x20, %rax
jne 0x735b
movl $0x1b, %edx
xorl %r13d, %r13d
movq 0x4f4b(%rip), %rdi      # 0xbfc8
leaq 0x2212(%rip), %rsi      # 0x9296
callq 0x32e0
movq 0x4f38(%rip), %rcx      # 0xbfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
xorl %r13d, %r13d
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
xorl %r13d, %r13d
movq 0x4f14(%rip), %rdi      # 0xbfc8
callq 0x3040
xorl %r13d, %r13d
movq %rax, %rdi
callq 0x31b0
xorl %r13d, %r13d
movq -0x88(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x5402
jmp 0x749b
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rax
subq %rdi, %rax
sarq $0x5, %rax
addq $-0x3, %rax
cmpq $0x2, %rax
jae 0x7388
leaq 0x1f1d(%rip), %rsi      # 0x901d
callq 0x30e0
testl %eax, %eax
jne 0x7127
movq -0x40(%rbp), %rsi
addq $0x20, %rsi
movq -0x80(%rbp), %rdi
callq 0x89c8
cmpq -0xc0(%rbp), %rax
je 0x7f15
xorl %r15d, %r15d
movq (%rbx), %rax
movq (%rax,%r15), %rax
addq $0x28, %rax
movq %rax, -0x2f0(%rbp)
movb $0x0, -0x2e8(%rbp)
movq %r14, %rdi
callq 0x5068
movb $0x1, -0x2e8(%rbp)
movq -0x40(%rbp), %rsi
movq (%rbx), %rax
movq (%rax,%r15), %rdi
subq $-0x80, %rdi
callq 0x3180
movq -0x40(%rbp), %rdi
leaq 0x1eac(%rip), %rsi      # 0x901d
callq 0x30e0
movq -0x40(%rbp), %rsi
addq $0x20, %rsi
testl %eax, %eax
je 0x7265
movq (%rsi), %r13
callq 0x3060
movq %rax, %r12
movl (%rax), %ebx
movl $0x0, (%rax)
movq %r13, %rdi
leaq -0x70(%rbp), %rsi
movl $0xa, %edx
callq 0x3380
cmpq %r13, -0x70(%rbp)
je 0x7f4b
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x7f27
movl (%r12), %ecx
cmpl $0x22, %ecx
je 0x7f27
testl %ecx, %ecx
jne 0x71e3
movl %ebx, (%r12)
movq -0x48(%rbp), %rcx
movq (%rcx), %rcx
movq (%rcx,%r15), %rcx
movl %eax, 0xa0(%rcx)
movq -0x40(%rbp), %rax
movq 0x40(%rax), %r13
movl (%r12), %ebx
movl $0x0, (%r12)
movq %r13, %rdi
leaq -0x70(%rbp), %rsi
movl $0xa, %edx
callq 0x3380
cmpq %r13, -0x70(%rbp)
je 0x7f33
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x7f3f
movl (%r12), %ecx
cmpl $0x22, %ecx
je 0x7f3f
testl %ecx, %ecx
jne 0x7252
movl %ebx, (%r12)
movq -0x48(%rbp), %rbx
movq (%rbx), %rcx
movq (%rcx,%r15), %rcx
movl %eax, 0xa8(%rcx)
jmp 0x727f
movq -0x80(%rbp), %rdi
callq 0x5460
movq (%rax), %rax
movq (%rbx), %rcx
movq (%rcx,%r15), %rcx
movq %rax, 0xa0(%rcx)
movq (%rbx), %rax
movq (%rax,%r15), %rax
movb $0x0, 0xb8(%rax)
movq %r14, %rdi
callq 0x4f02
movq (%rbx), %rax
movq (%rax,%r15), %rdi
addq $0x50, %rdi
callq 0x3460
movq %r14, %rdi
callq 0x4f34
addq $0x8, %r15
cmpq $0x20, %r15
jne 0x712a
jmp 0x763a
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rax
subq %rsi, %rax
cmpq $0x60, %rax
jne 0x7423
addq $0x20, %rsi
xorl %r13d, %r13d
leaq -0x568(%rbp), %rdi
movl $0x6, %edx
callq 0x3240
movq -0x568(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x548(%rbp,%rax)
je 0x7bf0
movl $0x21, %edx
xorl %r13d, %r13d
movq 0x4cdb(%rip), %rdi      # 0xbff0
leaq 0x1fa2(%rip), %rsi      # 0x92be
callq 0x32e0
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
xorl %r13d, %r13d
movq 0x4cb9(%rip), %rdi      # 0xbff0
callq 0x32e0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
xorl %r13d, %r13d
movl $0xa, %esi
callq 0x3280
jmp 0x7482
movl $0x22, %r12d
movl $0x7, %edx
xorl %r13d, %r13d
movq 0x4c80(%rip), %rdi      # 0xbff0
leaq 0x1ef4(%rip), %rsi      # 0x926b
callq 0x32e0
leaq 0x1ef0(%rip), %rsi      # 0x9273
jmp 0x744b
movl $0x7, %edx
xorl %r13d, %r13d
movq 0x4c59(%rip), %rdi      # 0xbff0
leaq 0x1ecd(%rip), %rsi      # 0x926b
callq 0x32e0
movl $0xd, %edx
xorl %r13d, %r13d
movq 0x4c3e(%rip), %rdi      # 0xbff0
leaq 0x1f6a(%rip), %rsi      # 0x9323
callq 0x32e0
movq 0x4c2b(%rip), %rcx      # 0xbff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
xorl %r13d, %r13d
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
xorl %r13d, %r13d
movq 0x4c07(%rip), %rdi      # 0xbff0
callq 0x3040
xorl %r13d, %r13d
movq %rax, %rdi
callq 0x31b0
movl $0x1b, %r12d
movl $0x7, %edx
xorl %r13d, %r13d
movq 0x4be2(%rip), %rdi      # 0xbff0
leaq 0x1e56(%rip), %rsi      # 0x926b
callq 0x32e0
leaq 0x1f10(%rip), %rsi      # 0x9331
jmp 0x744b
movl $0xb, %r12d
movl $0x7, %edx
xorl %r13d, %r13d
movq 0x4bb8(%rip), %rdi      # 0xbff0
leaq 0x1e2c(%rip), %rsi      # 0x926b
callq 0x32e0
leaq 0x1e67(%rip), %rsi      # 0x92b2
xorl %r13d, %r13d
movq 0x4b9b(%rip), %rdi      # 0xbff0
movq %r12, %rdx
callq 0x32e0
movq 0x4b8c(%rip), %rcx      # 0xbff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
xorl %r13d, %r13d
movl $0xa, %esi
callq 0x3280
movq 0x4b6e(%rip), %r12      # 0xbff0
movsbl %al, %esi
xorl %r13d, %r13d
movq %r12, %rdi
callq 0x3040
xorl %r13d, %r13d
movq %rax, %rdi
callq 0x31b0
leaq -0x568(%rbp), %rdi
callq 0x30c0
testq %r13, %r13
je 0x74b4
movq %r13, %rdi
callq 0x3270
movq %r15, %rdi
callq 0x5412
jmp 0x6f12
movq -0x38(%rbp), %rax
subq -0x40(%rbp), %rax
cmpq $0x60, %rax
jne 0x7d41
xorl %r15d, %r15d
movq (%rbx), %rax
movq (%rax,%r15,8), %rax
addq $0x28, %rax
movq %rax, -0x2f0(%rbp)
movb $0x0, -0x2e8(%rbp)
movq %r14, %rdi
callq 0x5068
movb $0x1, -0x2e8(%rbp)
movq (%rbx), %rax
movq (%rax,%r15,8), %rdi
movq 0x88(%rdi), %rdx
subq $-0x80, %rdi
movl $0x3, %r8d
xorl %esi, %esi
leaq 0x1b03(%rip), %rcx      # 0x9022
callq 0x33f0
movq -0x40(%rbp), %rax
movq 0x20(%rax), %r13
callq 0x3060
movq %rax, %r12
movl (%rax), %ebx
movl $0x0, (%rax)
movq %r13, %rdi
leaq -0x70(%rbp), %rsi
movl $0xa, %edx
callq 0x3380
cmpq %r13, -0x70(%rbp)
je 0x7f5e
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x7f76
movl (%r12), %ecx
cmpl $0x22, %ecx
je 0x7f76
testl %ecx, %ecx
jne 0x7586
movl %ebx, (%r12)
movq -0x48(%rbp), %rcx
movq (%rcx), %rcx
movq (%rcx,%r15,8), %rcx
movl %eax, 0xa0(%rcx)
movq -0x40(%rbp), %rax
movq 0x40(%rax), %r13
movl (%r12), %ebx
movl $0x0, (%r12)
movq %r13, %rdi
leaq -0x70(%rbp), %rsi
movl $0xa, %edx
callq 0x3380
cmpq %r13, -0x70(%rbp)
je 0x7f6a
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x7f82
movl (%r12), %ecx
cmpl $0x22, %ecx
je 0x7f82
testl %ecx, %ecx
jne 0x75f5
movl %ebx, (%r12)
movq -0x48(%rbp), %rbx
movq (%rbx), %rcx
movq (%rcx,%r15,8), %rcx
movl %eax, 0xa8(%rcx)
movb $0x0, 0xb8(%rcx)
movq %r14, %rdi
callq 0x4f02
movq (%rbx), %rax
movq (%rax,%r15,8), %rdi
addq $0x50, %rdi
callq 0x3460
movq %r14, %rdi
callq 0x4f34
incq %r15
cmpq $0x4, %r15
jne 0x74d6
xorl %r13d, %r13d
movq $0x0, -0x78(%rbp)
movq (%rbx), %r15
movq 0x8(%rbx), %rbx
cmpq %rbx, %r15
je 0x76c0
movq (%r15), %rax
addq $0x28, %rax
movq %rax, -0x2f0(%rbp)
movb $0x0, -0x2e8(%rbp)
movq %r14, %rdi
callq 0x5068
movb $0x1, -0x2e8(%rbp)
movq (%r15), %r12
cmpb $0x0, 0xb8(%r12)
jne 0x769e
addq $0x50, %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x30f0
movq (%r15), %rax
cmpb $0x1, 0xb8(%rax)
jne 0x7687
movq %r14, %rdi
callq 0x4f02
movq (%r15), %rdi
addq $0x50, %rdi
callq 0x3460
movq %r14, %rdi
callq 0x4f34
addq $0x8, %r15
jmp 0x764c
movq -0x40(%rbp), %rdi
leaq 0x1952(%rip), %rsi      # 0x901d
callq 0x30e0
testl %eax, %eax
je 0x78e8
movq -0x40(%rbp), %rdi
leaq 0x1943(%rip), %rsi      # 0x9026
callq 0x30e0
testl %eax, %eax
je 0x78e8
movq -0x40(%rbp), %rdi
leaq 0x191f(%rip), %rsi      # 0x901a
callq 0x30e0
testl %eax, %eax
movq -0x48(%rbp), %rbx
je 0x7ccd
movq -0x40(%rbp), %rdi
leaq 0x190b(%rip), %rsi      # 0x9022
callq 0x30e0
testl %eax, %eax
leaq -0x40(%rbp), %r15
je 0x773c
movq -0x40(%rbp), %rdi
leaq 0x1b39(%rip), %rsi      # 0x9268
callq 0x30e0
testl %eax, %eax
jne 0x7d22
movb $0x1, %al
xorl %r15d, %r15d
movq (%rbx), %rcx
movq (%rcx,%r15,8), %rcx
cmpl $0x0, 0xa4(%rcx)
je 0x7830
movl $0xe, %edx
movq 0x4867(%rip), %rdi      # 0xbfc8
leaq 0x1cf3(%rip), %rsi      # 0x945b
callq 0x32e0
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
movq 0x4848(%rip), %rdi      # 0xbfc8
callq 0x32e0
movq %rax, %r12
movl $0x9, %edx
movq %rax, %rdi
leaq 0x1cd3(%rip), %rsi      # 0x946a
callq 0x32e0
movq -0x40(%rbp), %rax
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
movq %r12, %rdi
callq 0x32e0
movq %rax, %r12
movl $0x4, %edx
movq %rax, %rdi
leaq 0x1cb2(%rip), %rsi      # 0x9474
callq 0x32e0
movq (%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x4e4a
movq -0x2f0(%rbp), %rsi
movq -0x2e8(%rbp), %rdx
movq %r12, %rdi
callq 0x32e0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %r12, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
movq -0x2f0(%rbp), %rdi
leaq -0x2e0(%rbp), %rax
cmpq %rax, %rdi
je 0x782e
callq 0x3270
xorl %eax, %eax
incq %r15
cmpq $0x4, %r15
jne 0x7741
testb $0x1, %al
leaq -0x40(%rbp), %r15
je 0x7d22
movl $0xf, %edx
movq 0x4773(%rip), %rdi      # 0xbfc8
leaq 0x1c1d(%rip), %rsi      # 0x9479
callq 0x32e0
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
movq 0x4754(%rip), %rdi      # 0xbfc8
callq 0x32e0
movq %rax, %r12
movl $0x9, %edx
movq %rax, %rdi
leaq 0x1bdf(%rip), %rsi      # 0x946a
callq 0x32e0
movq -0x40(%rbp), %rax
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
movq %r12, %rdi
callq 0x32e0
movq %rax, %r12
movl $0xb, %edx
movq %rax, %rdi
leaq 0x1bd3(%rip), %rsi      # 0x9489
callq 0x32e0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %r12, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
jmp 0x7d22
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
xorl %ecx, %ecx
movq %rcx, -0x68(%rbp)
movb %cl, -0x60(%rbp)
leaq -0xa8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq %rcx, -0xb0(%rbp)
movb %cl, -0xa8(%rbp)
xorl %r15d, %r15d
movq -0x48(%rbp), %rbx
movq (%rbx), %rax
movq (%rax,%r15,8), %rax
cmpl $0x0, 0xa4(%rax)
je 0x7b45
movq %r14, %rdi
callq 0x3450
movq -0x40(%rbp), %rdi
leaq 0x16db(%rip), %rsi      # 0x901d
callq 0x30e0
movq -0x40(%rbp), %rsi
testl %eax, %eax
je 0x796c
movq %rsi, %rdi
leaq 0x16cd(%rip), %rsi      # 0x9026
callq 0x30e0
testl %eax, %eax
jne 0x797d
movq -0x40(%rbp), %rsi
addq $0x60, %rsi
jmp 0x7970
addq $0x40, %rsi
movq %r14, %rdi
movl $0x10, %edx
callq 0x3160
movq -0x2f0(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x2d0(%rbp,%rax)
je 0x79e1
movl $0x3d, %edx
movq 0x4652(%rip), %rdi      # 0xbff0
leaq 0x19ec(%rip), %rsi      # 0x9391
callq 0x32e0
movq 0x463f(%rip), %rcx      # 0xbff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq 0x4621(%rip), %rdi      # 0xbff0
callq 0x3040
movq %rax, %rdi
callq 0x31b0
jmp 0x7af4
movq (%rbx), %rax
movq (%rax,%r15,8), %rax
movq 0xb0(%rax), %rsi
movslq 0xa4(%rax), %rdx
movq %r14, %rdi
callq 0x3350
movq %r14, %rdi
callq 0x3390
movq (%rbx), %rax
movq (%rax,%r15,8), %rax
movq 0xb0(%rax), %rsi
movslq 0xa4(%rax), %rdx
leaq -0x35c(%rbp), %rdi
callq 0x62c2
leaq -0x35c(%rbp), %rdi
callq 0x62cc
leaq -0xe8(%rbp), %r12
movq %r12, %rdi
leaq -0x35c(%rbp), %rsi
callq 0x6362
leaq -0x70(%rbp), %rdi
movq %r12, %rsi
callq 0x3310
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x7a6d
callq 0x3270
movq -0xb0(%rbp), %r12
testq %r12, %r12
je 0x7ae4
cmpq -0x68(%rbp), %r12
jne 0x7a9a
movq -0x70(%rbp), %rsi
movq -0xb8(%rbp), %rdi
movq %r12, %rdx
callq 0x32a0
testl %eax, %eax
je 0x7b54
movl $0x5a, %edx
movq 0x454a(%rip), %rdi      # 0xbff0
leaq 0x1922(%rip), %rsi      # 0x93cf
callq 0x32e0
movq 0x4537(%rip), %rcx      # 0xbff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3280
movq 0x451c(%rip), %rdi      # 0xbff0
movsbl %al, %esi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
leaq -0xb8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x3180
movq (%rbx), %rax
movq (%rax,%r15,8), %rax
movq 0xb0(%rax), %rdi
testq %rdi, %rdi
je 0x7b0c
callq 0x3340
movq -0x98(%rbp), %rax
movq %rax, -0x2f0(%rbp)
movq -0x18(%rax), %rax
movq -0x90(%rbp), %rcx
movq %rcx, -0x2f0(%rbp,%rax)
leaq -0x2e8(%rbp), %rdi
callq 0x3220
leaq -0x1f8(%rbp), %rdi
callq 0x3110
incq %r15
cmpq $0x4, %r15
jne 0x791b
jmp 0x7bb9
testq %r12, %r12
je 0x7ae4
cmpq -0x68(%rbp), %r12
jne 0x7ae4
movq -0x70(%rbp), %rsi
movq -0xb8(%rbp), %rdi
movq %r12, %rdx
callq 0x32a0
testl %eax, %eax
jne 0x7ae4
movl $0x14, %edx
movq 0x4442(%rip), %rdi      # 0xbfc8
leaq 0x189d(%rip), %rsi      # 0x942a
callq 0x32e0
movq 0x442f(%rip), %rcx      # 0xbfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3280
movq 0x4414(%rip), %rdi      # 0xbfc8
jmp 0x7ad4
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
leaq -0x40(%rbp), %r15
je 0x7bd5
callq 0x3270
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x7d22
callq 0x3270
jmp 0x7d22
movq -0x40(%rbp), %rsi
addq $0x40, %rsi
xorl %r13d, %r13d
movq -0x88(%rbp), %rdi
movl $0x1, %edx
callq 0x515e
testb %al, %al
je 0x7d68
leaq -0x568(%rbp), %rdi
callq 0x3480
movq %rax, %r15
movslq %r15d, %rdi
testq %rdi, %rdi
movq $-0x1, %rax
cmovsq %rax, %rdi
callq 0x3030
movq %rax, %r13
leaq -0x568(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3360
movslq %r15d, %rdx
leaq -0x568(%rbp), %rdi
movq %r13, %rsi
callq 0x3320
movq %r15, -0xc8(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x2f0(%rbp)
movq $0x0, -0x2e0(%rbp)
movq %rbx, %rax
movq (%rbx), %rbx
movq 0x8(%rax), %r15
cmpq %r15, %rbx
je 0x7dd5
movq (%rbx), %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x2e8(%rbp), %rsi
cmpq -0x2e0(%rbp), %rsi
je 0x7cbb
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, -0x2e8(%rbp)
jmp 0x7cc7
movq %r14, %rdi
leaq -0x70(%rbp), %rdx
callq 0x82ec
addq $0x8, %rbx
jmp 0x7c84
movl $0x1b, %edx
movq 0x42ef(%rip), %rdi      # 0xbfc8
leaq 0x175f(%rip), %rsi      # 0x943f
callq 0x32e0
leaq -0x40(%rbp), %r15
movl 0x24(%rbx), %esi
movq 0x42d5(%rip), %rdi      # 0xbfc8
callq 0x3470
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %r12, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x7d30
callq 0x3340
leaq -0x568(%rbp), %rdi
callq 0x30b0
jmp 0x749b
movl $0x7, %edx
xorl %r13d, %r13d
movq 0x42a0(%rip), %rdi      # 0xbff0
leaq 0x1514(%rip), %rsi      # 0x926b
callq 0x32e0
leaq 0x160a(%rip), %rsi      # 0x936d
jmp 0x744b
movl $0x32, %edx
xorl %r13d, %r13d
movq 0x4279(%rip), %rdi      # 0xbff0
leaq 0x1562(%rip), %rsi      # 0x92e0
callq 0x32e0
movq -0x40(%rbp), %rax
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
xorl %r13d, %r13d
movq 0x4257(%rip), %rdi      # 0xbff0
callq 0x32e0
movq %rax, %r12
movl $0xf, %edx
xorl %r13d, %r13d
movq %rax, %rdi
leaq 0x1560(%rip), %rsi      # 0x9313
callq 0x32e0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
xorl %r13d, %r13d
movl $0xa, %esi
callq 0x3280
jmp 0x7482
leaq -0x70(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x80d4
movq %r13, -0x78(%rbp)
movq -0x70(%rbp), %r13
movq -0x48(%rbp), %rbx
incl 0x24(%rbx)
cmpl $0x0, 0x20(%rbx)
jle 0x7efb
xorl %r15d, %r15d
movslq (%r13,%r15,4), %rax
movq (%rbx), %rcx
movq (%rcx,%rax,8), %rax
addq $0x28, %rax
movq %rax, -0x70(%rbp)
movb $0x0, -0x68(%rbp)
movq %r12, %rdi
callq 0x5068
movb $0x1, -0x68(%rbp)
movq %rbx, %r12
movl 0x24(%rbx), %ebx
movq -0x40(%rbp), %rsi
addq $0x40, %rsi
movq -0x80(%rbp), %rdi
callq 0x5460
movl %ebx, (%rax)
movq -0xc8(%rbp), %r14
movl %r14d, 0x4(%rax)
movslq (%r13,%r15,4), %rax
movq (%r12), %rcx
movq (%rcx,%rax,8), %rdi
movq 0x88(%rdi), %rdx
subq $-0x80, %rdi
movl $0x2, %r8d
xorl %esi, %esi
leaq 0x11ab(%rip), %rcx      # 0x901a
callq 0x33f0
movq %r12, %rbx
leaq -0x70(%rbp), %r12
movl 0x24(%rbx), %eax
movslq (%r13,%r15,4), %rcx
movq (%rbx), %rdx
movq (%rdx,%rcx,8), %rcx
movl %eax, 0xa0(%rcx)
movslq (%r13,%r15,4), %rax
movq (%rdx,%rax,8), %rax
movl %r14d, 0xa4(%rax)
movslq (%r13,%r15,4), %rax
movq (%rdx,%rax,8), %rcx
movq -0x78(%rbp), %rsi
movq %rsi, 0xb0(%rcx)
movq (%rdx,%rax,8), %rax
movb $0x0, 0xb8(%rax)
movq %r12, %rdi
callq 0x4f02
movslq (%r13,%r15,4), %rax
movq (%rbx), %rcx
movq (%rcx,%rax,8), %rdi
addq $0x50, %rdi
callq 0x3460
movq %r12, %rdi
callq 0x4f34
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
leaq -0x2f0(%rbp), %r14
jl 0x7e00
movq -0x2f0(%rbp), %rdi
testq %rdi, %rdi
je 0x7645
callq 0x3270
jmp 0x7645
movl $0x1f, %r12d
leaq 0x142b(%rip), %rsi      # 0x934d
jmp 0x744b
leaq 0x1567(%rip), %rdi      # 0x9495
callq 0x33a0
leaq 0x155b(%rip), %rdi      # 0x9495
callq 0x3190
leaq 0x154f(%rip), %rdi      # 0x9495
callq 0x33a0
leaq 0x1543(%rip), %rdi      # 0x9495
callq 0x3190
xorl %edi, %edi
callq 0x3300
leaq 0x1530(%rip), %rdi      # 0x9495
callq 0x3190
leaq 0x1524(%rip), %rdi      # 0x9495
callq 0x3190
leaq 0x1518(%rip), %rdi      # 0x9495
callq 0x33a0
leaq 0x150c(%rip), %rdi      # 0x9495
callq 0x33a0
jmp 0x7f9b
jmp 0x8002
jmp 0x8002
jmp 0x8002
jmp 0x8042
movq %rax, %r14
xorl %r13d, %r13d
jmp 0x7fbb
jmp 0x7faf
movq %rax, %r14
jmp 0x7fbb
jmp 0x8042
movq %rax, %r14
leaq -0x70(%rbp), %rdi
callq 0x4f34
movq -0x2f0(%rbp), %rdi
testq %rdi, %rdi
jne 0x80a5
jmp 0x80aa
jmp 0x8002
jmp 0x8047
jmp 0x802e
movq %rax, %r14
xorl %r13d, %r13d
jmp 0x80b6
jmp 0x800b
jmp 0x800b
jmp 0x802e
movq %rax, %r14
movq -0x2f0(%rbp), %rdi
leaq -0x2e0(%rbp), %rax
jmp 0x80a0
movq %rax, %r14
jmp 0x8080
movq %rax, %r14
jmp 0x803d
jmp 0x8042
jmp 0x800b
movq %rax, %r14
cmpl $0x0, (%r12)
jne 0x8031
movl %ebx, (%r12)
jmp 0x8031
jmp 0x8042
movq %rax, %r14
leaq -0x2f0(%rbp), %rdi
callq 0x4f34
jmp 0x80aa
movq %rax, %r14
leaq -0x2f0(%rbp), %rdi
callq 0x4f34
xorl %r13d, %r13d
jmp 0x80aa
movq %rax, %r14
jmp 0x80aa
movq %rax, %r14
leaq -0x2e8(%rbp), %rdi
movq -0x98(%rbp), %rax
movq %rax, -0x8(%rdi)
movq -0x18(%rax), %rax
movq -0x90(%rbp), %rcx
movq %rcx, -0x2f0(%rbp,%rax)
callq 0x3220
leaq -0x1f8(%rbp), %rdi
callq 0x3110
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x8098
callq 0x3270
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x80aa
callq 0x3270
leaq -0x568(%rbp), %rdi
callq 0x30c0
testq %r13, %r13
je 0x80c3
movq %r13, %rdi
callq 0x3270
leaq -0x40(%rbp), %rdi
callq 0x5412
movq %r14, %rdi
callq 0x34a0