// File: /workspace/github_cpp_makefile_star2_O3/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 $0x538, %rsp            # imm = 0x538
movq %rdi, %r15
leaq 0x28(%rdi), %rax
movq %rax, -0x78(%rbp)
leaq 0x30(%rdi), %rax
movq %rax, -0xb8(%rbp)
leaq 0x18(%rdi), %rax
movq %rax, -0x80(%rbp)
movq 0x5135(%rip), %rax      # 0xbfc0
movq (%rax), %rcx
movq %rcx, -0x90(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x88(%rbp)
leaq -0x40(%rbp), %rbx
leaq -0x34c(%rbp), %r13
leaq -0x2e0(%rbp), %r12
movq %rdi, -0x48(%rbp)
movq %rbx, %rdi
callq 0x6cd8
leaq -0x558(%rbp), %rdi
callq 0x32d0
xorl %r14d, %r14d
movq %r13, %rdi
callq 0x5a12
movq -0x40(%rbp), %rdi
movl $0x12, %ebx
cmpq -0x38(%rbp), %rdi
je 0x6fef
leaq 0x236f(%rip), %rsi      # 0x925e
callq 0x30e0
testl %eax, %eax
je 0x7ec5
movq -0x40(%rbp), %rdi
leaq 0x235c(%rip), %rsi      # 0x9263
callq 0x30e0
testl %eax, %eax
je 0x7ec5
movq -0x40(%rbp), %rdi
leaq 0x2349(%rip), %rsi      # 0x9268
callq 0x30e0
testl %eax, %eax
je 0x6ffb
movq -0x40(%rbp), %rdi
leaq 0x20e3(%rip), %rsi      # 0x901a
callq 0x30e0
testl %eax, %eax
je 0x724f
movq -0x40(%rbp), %rdi
leaq 0x20ce(%rip), %rsi      # 0x901d
callq 0x30e0
testl %eax, %eax
je 0x7078
movq -0x40(%rbp), %rdi
leaq 0x20bf(%rip), %rsi      # 0x9026
callq 0x30e0
testl %eax, %eax
je 0x7078
movq -0x40(%rbp), %rdi
leaq 0x20a3(%rip), %rsi      # 0x9022
callq 0x30e0
testl %eax, %eax
je 0x744b
movl $0x10, %edx
xorl %r14d, %r14d
movq 0x5055(%rip), %rdi      # 0xbff0
leaq 0x23de(%rip), %rsi      # 0x9380
callq 0x32e0
movq 0x5042(%rip), %rcx      # 0xbff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
xorl %r14d, %r14d
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
xorl %r14d, %r14d
movq 0x501e(%rip), %rdi      # 0xbff0
callq 0x3040
xorl %r14d, %r14d
movq %rax, %rdi
callq 0x31b0
movq $0x0, -0x70(%rbp)
jmp 0x75ca
leaq 0x2255(%rip), %rsi      # 0x924b
jmp 0x73d7
movq -0x38(%rbp), %rax
subq -0x40(%rbp), %rax
cmpq $0x20, %rax
jne 0x72ea
movl $0x1b, %edx
xorl %r14d, %r14d
movq 0x4fac(%rip), %rdi      # 0xbfc8
leaq 0x2273(%rip), %rsi      # 0x9296
callq 0x32e0
movq 0x4f99(%rip), %rcx      # 0xbfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
xorl %r14d, %r14d
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
xorl %r14d, %r14d
movq 0x4f75(%rip), %rdi      # 0xbfc8
callq 0x3040
xorl %r14d, %r14d
movq %rax, %rdi
callq 0x31b0
xorl %r14d, %r14d
movq -0x80(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x53e6
jmp 0x7427
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rax
subq %rdi, %rax
sarq $0x5, %rax
addq $-0x3, %rax
cmpq $0x2, %rax
jae 0x7316
leaq 0x1f81(%rip), %rsi      # 0x901d
callq 0x30e0
testl %eax, %eax
jne 0x70c3
movq -0x40(%rbp), %rsi
addq $0x20, %rsi
movq -0x78(%rbp), %rdi
callq 0x892e
cmpq -0xb8(%rbp), %rax
je 0x7e84
xorl %r13d, %r13d
movq (%r15), %rax
movq (%rax,%r13,8), %rax
addq $0x28, %rax
movq %rax, -0x2e0(%rbp)
movb $0x0, -0x2d8(%rbp)
movq %r12, %rdi
callq 0x5078
movb $0x1, -0x2d8(%rbp)
movq -0x40(%rbp), %rsi
movq (%r15), %rax
movq (%rax,%r13,8), %rdi
subq $-0x80, %rdi
callq 0x3180
movq -0x40(%rbp), %rdi
leaq 0x1f10(%rip), %rsi      # 0x901d
callq 0x30e0
movq -0x40(%rbp), %rsi
addq $0x20, %rsi
testl %eax, %eax
je 0x71fc
movq (%rsi), %rbx
callq 0x3060
movq %rax, %r14
movl (%rax), %r15d
movl $0x0, (%rax)
movq %rbx, %rdi
leaq -0x68(%rbp), %rsi
movl $0xa, %edx
callq 0x3380
cmpq %rbx, -0x68(%rbp)
je 0x7eb9
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x7e95
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x7e95
testl %ecx, %ecx
jne 0x717e
movl %r15d, (%r14)
movq -0x48(%rbp), %rcx
movq (%rcx), %rcx
movq (%rcx,%r13,8), %rcx
movl %eax, 0xa0(%rcx)
movq -0x40(%rbp), %rax
movq 0x40(%rax), %rbx
movl (%r14), %r15d
movl $0x0, (%r14)
movq %rbx, %rdi
leaq -0x68(%rbp), %rsi
movl $0xa, %edx
callq 0x3380
cmpq %rbx, -0x68(%rbp)
je 0x7ea1
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x7ead
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x7ead
testl %ecx, %ecx
jne 0x71e9
movl %r15d, (%r14)
movq -0x48(%rbp), %r15
movq (%r15), %rcx
movq (%rcx,%r13,8), %rcx
movl %eax, 0xa8(%rcx)
jmp 0x7216
movq -0x78(%rbp), %rdi
callq 0x544e
movq (%rax), %rax
movq (%r15), %rcx
movq (%rcx,%r13,8), %rcx
movq %rax, 0xa0(%rcx)
movb $0x0, 0xb8(%rcx)
movq %r12, %rdi
callq 0x4f0e
movq (%r15), %rax
movq (%rax,%r13,8), %rdi
addq $0x50, %rdi
callq 0x3460
movq %r12, %rdi
callq 0x4f40
incq %r13
cmpq $0x4, %r13
jne 0x70c6
jmp 0x75bf
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rax
subq %rsi, %rax
cmpq $0x60, %rax
jne 0x73b0
addq $0x20, %rsi
xorl %r14d, %r14d
leaq -0x558(%rbp), %rdi
movl $0x6, %edx
callq 0x3240
movq -0x558(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x538(%rbp,%rax)
je 0x7aab
movl $0x21, %edx
xorl %r14d, %r14d
movq 0x4d4c(%rip), %rdi      # 0xbff0
leaq 0x2013(%rip), %rsi      # 0x92be
callq 0x32e0
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
xorl %r14d, %r14d
movq 0x4d2a(%rip), %rdi      # 0xbff0
callq 0x32e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
xorl %r14d, %r14d
movl $0xa, %esi
callq 0x3280
jmp 0x740e
movl $0x22, %ebx
movl $0x7, %edx
xorl %r14d, %r14d
movq 0x4cf2(%rip), %rdi      # 0xbff0
leaq 0x1f66(%rip), %rsi      # 0x926b
callq 0x32e0
leaq 0x1f62(%rip), %rsi      # 0x9273
jmp 0x73d7
movl $0x7, %edx
xorl %r14d, %r14d
movq 0x4ccb(%rip), %rdi      # 0xbff0
leaq 0x1f3f(%rip), %rsi      # 0x926b
callq 0x32e0
movl $0xd, %edx
xorl %r14d, %r14d
movq 0x4cb0(%rip), %rdi      # 0xbff0
leaq 0x1fdc(%rip), %rsi      # 0x9323
callq 0x32e0
movq 0x4c9d(%rip), %rcx      # 0xbff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
xorl %r14d, %r14d
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
xorl %r14d, %r14d
movq 0x4c79(%rip), %rdi      # 0xbff0
callq 0x3040
xorl %r14d, %r14d
movq %rax, %rdi
callq 0x31b0
movl $0x1b, %ebx
movl $0x7, %edx
xorl %r14d, %r14d
movq 0x4c55(%rip), %rdi      # 0xbff0
leaq 0x1ec9(%rip), %rsi      # 0x926b
callq 0x32e0
leaq 0x1f83(%rip), %rsi      # 0x9331
jmp 0x73d7
movl $0xb, %ebx
movl $0x7, %edx
xorl %r14d, %r14d
movq 0x4c2c(%rip), %rdi      # 0xbff0
leaq 0x1ea0(%rip), %rsi      # 0x926b
callq 0x32e0
leaq 0x1edb(%rip), %rsi      # 0x92b2
xorl %r14d, %r14d
movq 0x4c0f(%rip), %rdi      # 0xbff0
movq %rbx, %rdx
callq 0x32e0
movq 0x4c00(%rip), %rcx      # 0xbff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
xorl %r14d, %r14d
movl $0xa, %esi
callq 0x3280
movq 0x4be2(%rip), %rbx      # 0xbff0
movsbl %al, %esi
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x3040
xorl %r14d, %r14d
movq %rax, %rdi
callq 0x31b0
leaq -0x558(%rbp), %rdi
callq 0x30c0
leaq -0x40(%rbp), %rbx
movq %rbx, %rdi
callq 0x53f6
leaq -0x34c(%rbp), %r13
jmp 0x6eb6
movq -0x38(%rbp), %rax
subq -0x40(%rbp), %rax
cmpq $0x60, %rax
jne 0x7cb3
xorl %r13d, %r13d
movq (%r15), %rax
movq (%rax,%r13,8), %rax
addq $0x28, %rax
movq %rax, -0x2e0(%rbp)
movb $0x0, -0x2d8(%rbp)
movq %r12, %rdi
callq 0x5078
movb $0x1, -0x2d8(%rbp)
movq (%r15), %rax
movq (%rax,%r13,8), %rdi
movq 0x88(%rdi), %rdx
subq $-0x80, %rdi
movl $0x3, %r8d
xorl %esi, %esi
leaq 0x1b79(%rip), %rcx      # 0x9022
callq 0x33f0
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rbx
callq 0x3060
movq %rax, %r14
movl (%rax), %r15d
movl $0x0, (%rax)
movq %rbx, %rdi
leaq -0x68(%rbp), %rsi
movl $0xa, %edx
callq 0x3380
cmpq %rbx, -0x68(%rbp)
je 0x7ef0
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x7ed8
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x7ed8
testl %ecx, %ecx
jne 0x750f
movl %r15d, (%r14)
movq -0x48(%rbp), %rcx
movq (%rcx), %rcx
movq (%rcx,%r13,8), %rcx
movl %eax, 0xa0(%rcx)
movq -0x40(%rbp), %rax
movq 0x40(%rax), %rbx
movl (%r14), %r15d
movl $0x0, (%r14)
movq %rbx, %rdi
leaq -0x68(%rbp), %rsi
movl $0xa, %edx
callq 0x3380
cmpq %rbx, -0x68(%rbp)
je 0x7ee4
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x7ecc
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x7ecc
testl %ecx, %ecx
jne 0x757a
movl %r15d, (%r14)
movq -0x48(%rbp), %r15
movq (%r15), %rcx
movq (%rcx,%r13,8), %rcx
movl %eax, 0xa8(%rcx)
movb $0x0, 0xb8(%rcx)
movq %r12, %rdi
callq 0x4f0e
movq (%r15), %rax
movq (%rax,%r13,8), %rdi
addq $0x50, %rdi
callq 0x3460
movq %r12, %rdi
callq 0x4f40
incq %r13
cmpq $0x4, %r13
jne 0x7460
xorl %r14d, %r14d
movq $0x0, -0x70(%rbp)
movq (%r15), %r13
movq 0x8(%r15), %r15
cmpq %r15, %r13
je 0x7647
movq (%r13), %rax
addq $0x28, %rax
movq %rax, -0x2e0(%rbp)
movb $0x0, -0x2d8(%rbp)
movq %r12, %rdi
callq 0x5078
movb $0x1, -0x2d8(%rbp)
movq (%r13), %rbx
cmpb $0x0, 0xb8(%rbx)
jne 0x7624
addq $0x50, %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x30f0
movq (%r13), %rax
cmpb $0x1, 0xb8(%rax)
jne 0x760c
movq %r12, %rdi
callq 0x4f0e
movq (%r13), %rdi
addq $0x50, %rdi
callq 0x3460
movq %r12, %rdi
callq 0x4f40
addq $0x8, %r13
jmp 0x75d1
movq -0x40(%rbp), %rdi
leaq 0x19cb(%rip), %rsi      # 0x901d
callq 0x30e0
testl %eax, %eax
je 0x77d1
movq -0x40(%rbp), %rdi
leaq 0x19bc(%rip), %rsi      # 0x9026
callq 0x30e0
testl %eax, %eax
je 0x77d1
movq -0x40(%rbp), %rdi
leaq 0x1998(%rip), %rsi      # 0x901a
callq 0x30e0
testl %eax, %eax
movq -0x48(%rbp), %r15
je 0x7b7f
movq -0x40(%rbp), %rdi
leaq 0x1984(%rip), %rsi      # 0x9022
callq 0x30e0
testl %eax, %eax
je 0x76bf
movq -0x40(%rbp), %rdi
leaq 0x1bb6(%rip), %rsi      # 0x9268
callq 0x30e0
testl %eax, %eax
jne 0x7c77
movb $0x1, %al
xorl %r13d, %r13d
movq (%r15), %rcx
incq %r13
movq -0x8(%rcx,%r13,8), %rdx
cmpl $0x0, 0xa4(%rdx)
jne 0x76e6
incq %r13
cmpq $0x5, %r13
jne 0x76ca
jmp 0x7bd6
movl $0xe, %edx
movq 0x48d6(%rip), %rdi      # 0xbfc8
leaq 0x1d62(%rip), %rsi      # 0x945b
callq 0x32e0
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
movq 0x48b7(%rip), %rdi      # 0xbfc8
callq 0x32e0
movq %rax, %rbx
movl $0x9, %edx
movq %rax, %rdi
leaq 0x1d42(%rip), %rsi      # 0x946a
callq 0x32e0
movq -0x40(%rbp), %rax
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
movq %rbx, %rdi
callq 0x32e0
movq %rax, %rbx
movl $0x4, %edx
movq %rax, %rdi
leaq 0x1d21(%rip), %rsi      # 0x9474
callq 0x32e0
movq (%r15), %rax
movq -0x8(%rax,%r13,8), %rsi
movq %r12, %rdi
callq 0x4e56
movq -0x2e0(%rbp), %rsi
movq -0x2d8(%rbp), %rdx
movq %rbx, %rdi
callq 0x32e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
movq -0x2e0(%rbp), %rdi
leaq -0x2d0(%rbp), %rax
cmpq %rax, %rdi
je 0x77c0
callq 0x3270
xorl %eax, %eax
cmpq $0x4, %r13
jne 0x76c4
jmp 0x7c77
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
xorl %ecx, %ecx
movq %rcx, -0x60(%rbp)
movb %cl, -0x58(%rbp)
leaq -0xa0(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq %rcx, -0xa8(%rbp)
movb %cl, -0xa0(%rbp)
xorl %ebx, %ebx
movq -0x48(%rbp), %r15
movq (%r15), %rax
movq (%rax,%rbx,8), %rax
cmpl $0x0, 0xa4(%rax)
je 0x7a2a
movq %r12, %rdi
callq 0x3450
movq -0x40(%rbp), %rdi
leaq 0x17f3(%rip), %rsi      # 0x901d
callq 0x30e0
movq -0x40(%rbp), %rsi
testl %eax, %eax
je 0x7854
movq %rsi, %rdi
leaq 0x17e5(%rip), %rsi      # 0x9026
callq 0x30e0
testl %eax, %eax
jne 0x7865
movq -0x40(%rbp), %rsi
addq $0x60, %rsi
jmp 0x7858
addq $0x40, %rsi
movq %r12, %rdi
movl $0x10, %edx
callq 0x3160
movq -0x2e0(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x2c0(%rbp,%rax)
je 0x78c9
movl $0x3d, %edx
movq 0x476a(%rip), %rdi      # 0xbff0
leaq 0x1b04(%rip), %rsi      # 0x9391
callq 0x32e0
movq 0x4757(%rip), %rcx      # 0xbff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq 0x4739(%rip), %rdi      # 0xbff0
callq 0x3040
movq %rax, %rdi
callq 0x31b0
jmp 0x79d9
movq (%r15), %rax
movq (%rax,%rbx,8), %rax
movq 0xb0(%rax), %rsi
movslq 0xa4(%rax), %rdx
movq %r12, %rdi
callq 0x3350
movq %r12, %rdi
callq 0x3390
movq (%r15), %rax
movq (%rax,%rbx,8), %rax
movq 0xb0(%rax), %rsi
movslq 0xa4(%rax), %rdx
leaq -0x34c(%rbp), %rdi
callq 0x62a2
leaq -0x34c(%rbp), %rdi
callq 0x62ac
leaq -0xe0(%rbp), %r13
movq %r13, %rdi
leaq -0x34c(%rbp), %rsi
callq 0x6342
leaq -0x68(%rbp), %rdi
movq %r13, %rsi
callq 0x3310
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x7955
callq 0x3270
movq -0xa8(%rbp), %rdx
testq %rdx, %rdx
je 0x79c9
cmpq -0x60(%rbp), %rdx
jne 0x797f
movq -0x68(%rbp), %rsi
movq -0xb0(%rbp), %rdi
callq 0x32a0
testl %eax, %eax
je 0x7a39
movl $0x5a, %edx
movq 0x4665(%rip), %rdi      # 0xbff0
leaq 0x1a3d(%rip), %rsi      # 0x93cf
callq 0x32e0
movq 0x4652(%rip), %rcx      # 0xbff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3280
movq 0x4637(%rip), %rdi      # 0xbff0
movsbl %al, %esi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
leaq -0xb0(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x3180
movq (%r15), %rax
movq (%rax,%rbx,8), %rax
movq 0xb0(%rax), %rdi
testq %rdi, %rdi
je 0x79f1
callq 0x3340
movq -0x90(%rbp), %rax
movq %rax, -0x2e0(%rbp)
movq -0x18(%rax), %rax
movq -0x88(%rbp), %rcx
movq %rcx, -0x2e0(%rbp,%rax)
leaq -0x2d8(%rbp), %rdi
callq 0x3220
leaq -0x1e8(%rbp), %rdi
callq 0x3110
incq %rbx
cmpq $0x4, %rbx
jne 0x7803
jmp 0x7a78
movl $0x14, %edx
movq 0x4583(%rip), %rdi      # 0xbfc8
leaq 0x19de(%rip), %rsi      # 0x942a
callq 0x32e0
movq 0x4570(%rip), %rcx      # 0xbfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3280
movq 0x4555(%rip), %rdi      # 0xbfc8
jmp 0x79b9
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x7a90
callq 0x3270
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x7c77
callq 0x3270
jmp 0x7c77
movq -0x40(%rbp), %rsi
addq $0x40, %rsi
xorl %r14d, %r14d
movq -0x80(%rbp), %rdi
movl $0x1, %edx
callq 0x516e
testb %al, %al
je 0x7cda
leaq -0x558(%rbp), %rdi
callq 0x3480
movq %rax, -0xc0(%rbp)
movslq %eax, %r14
testq %r14, %r14
movq $-0x1, %rdi
cmovnsq %r14, %rdi
callq 0x3030
movq %rax, %r13
leaq -0x558(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3360
leaq -0x558(%rbp), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x3320
xorps %xmm0, %xmm0
movaps %xmm0, -0x2e0(%rbp)
movq $0x0, -0x2d0(%rbp)
movq (%r15), %r14
movq 0x8(%r15), %r15
cmpq %r15, %r14
je 0x7d46
movq (%r14), %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x68(%rbp)
movq -0x2d8(%rbp), %rsi
cmpq -0x2d0(%rbp), %rsi
je 0x7b6d
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, -0x2d8(%rbp)
jmp 0x7b79
movq %r12, %rdi
leaq -0x68(%rbp), %rdx
callq 0x827a
addq $0x8, %r14
jmp 0x7b36
movl $0x1b, %edx
movq 0x443d(%rip), %rdi      # 0xbfc8
leaq 0x18ad(%rip), %rsi      # 0x943f
callq 0x32e0
movl 0x24(%r15), %esi
movq 0x4426(%rip), %rdi      # 0xbfc8
callq 0x3470
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
jmp 0x7c77
testb $0x1, %al
je 0x7c77
movl $0xf, %edx
movq 0x43de(%rip), %rdi      # 0xbfc8
leaq 0x1888(%rip), %rsi      # 0x9479
callq 0x32e0
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
movq 0x43bf(%rip), %rdi      # 0xbfc8
callq 0x32e0
movq %rax, %rbx
movl $0x9, %edx
movq %rax, %rdi
leaq 0x184a(%rip), %rsi      # 0x946a
callq 0x32e0
movq -0x40(%rbp), %rax
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
movq %rbx, %rdi
callq 0x32e0
movq %rax, %rbx
movl $0xb, %edx
movq %rax, %rdi
leaq 0x183e(%rip), %rsi      # 0x9489
callq 0x32e0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x7c85
callq 0x3340
leaq -0x558(%rbp), %rdi
callq 0x30b0
leaq -0x558(%rbp), %rdi
callq 0x30c0
testq %r14, %r14
je 0x7433
movq %r14, %rdi
callq 0x3270
jmp 0x7433
movl $0x7, %edx
xorl %r14d, %r14d
movq 0x432e(%rip), %rdi      # 0xbff0
leaq 0x15a2(%rip), %rsi      # 0x926b
callq 0x32e0
leaq 0x1698(%rip), %rsi      # 0x936d
jmp 0x73d7
movl $0x32, %edx
xorl %r14d, %r14d
movq 0x4307(%rip), %rdi      # 0xbff0
leaq 0x15f0(%rip), %rsi      # 0x92e0
callq 0x32e0
movq -0x40(%rbp), %rax
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
xorl %r14d, %r14d
movq 0x42e5(%rip), %rdi      # 0xbff0
callq 0x32e0
movq %rax, %rbx
movl $0xf, %edx
xorl %r14d, %r14d
movq %rax, %rdi
leaq 0x15ee(%rip), %rsi      # 0x9313
callq 0x32e0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
xorl %r14d, %r14d
movl $0xa, %esi
callq 0x3280
jmp 0x740e
leaq -0x68(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8055
movq %r13, -0x70(%rbp)
movq -0x68(%rbp), %r14
movq -0x48(%rbp), %r15
incl 0x24(%r15)
cmpl $0x0, 0x20(%r15)
jle 0x7e6a
xorl %r13d, %r13d
movslq (%r14,%r13,4), %rax
movq (%r15), %rcx
movq (%rcx,%rax,8), %rax
addq $0x28, %rax
movq %rax, -0x68(%rbp)
movb $0x0, -0x60(%rbp)
movq %rbx, %rdi
callq 0x5078
movb $0x1, -0x60(%rbp)
movq %r15, %rbx
movl 0x24(%r15), %r15d
movq -0x40(%rbp), %rsi
addq $0x40, %rsi
movq -0x78(%rbp), %rdi
callq 0x544e
movl %r15d, (%rax)
movq -0xc0(%rbp), %r12
movl %r12d, 0x4(%rax)
movslq (%r14,%r13,4), %rax
movq (%rbx), %rcx
movq (%rcx,%rax,8), %rdi
movq 0x88(%rdi), %rdx
subq $-0x80, %rdi
movl $0x2, %r8d
xorl %esi, %esi
leaq 0x1239(%rip), %rcx      # 0x901a
callq 0x33f0
movq %rbx, %r15
leaq -0x68(%rbp), %rbx
movl 0x24(%r15), %eax
movslq (%r14,%r13,4), %rcx
movq (%r15), %rdx
movq (%rdx,%rcx,8), %rcx
movl %eax, 0xa0(%rcx)
movslq (%r14,%r13,4), %rax
movq (%rdx,%rax,8), %rax
movl %r12d, 0xa4(%rax)
movslq (%r14,%r13,4), %rax
movq (%rdx,%rax,8), %rcx
movq -0x70(%rbp), %rsi
movq %rsi, 0xb0(%rcx)
movq (%rdx,%rax,8), %rax
movb $0x0, 0xb8(%rax)
movq %rbx, %rdi
callq 0x4f0e
movslq (%r14,%r13,4), %rax
movq (%r15), %rcx
movq (%rcx,%rax,8), %rdi
addq $0x50, %rdi
callq 0x3460
movq %rbx, %rdi
callq 0x4f40
incq %r13
movslq 0x20(%r15), %rax
cmpq %rax, %r13
leaq -0x2e0(%rbp), %r12
jl 0x7d73
movq -0x2e0(%rbp), %rdi
testq %rdi, %rdi
je 0x75ca
callq 0x3270
jmp 0x75ca
movl $0x1f, %ebx
leaq 0x14bd(%rip), %rsi      # 0x934d
jmp 0x73d7
leaq 0x15f9(%rip), %rdi      # 0x9495
callq 0x33a0
leaq 0x15ed(%rip), %rdi      # 0x9495
callq 0x3190
leaq 0x15e1(%rip), %rdi      # 0x9495
callq 0x33a0
leaq 0x15d5(%rip), %rdi      # 0x9495
callq 0x3190
xorl %edi, %edi
callq 0x3300
leaq 0x15c2(%rip), %rdi      # 0x9495
callq 0x33a0
leaq 0x15b6(%rip), %rdi      # 0x9495
callq 0x33a0
leaq 0x15aa(%rip), %rdi      # 0x9495
callq 0x3190
leaq 0x159e(%rip), %rdi      # 0x9495
callq 0x3190
jmp 0x7f24
jmp 0x7f75
jmp 0x7fc0
jmp 0x7f75
jmp 0x7f75
jmp 0x7fc0
movq %rax, %rbx
movq -0x2e0(%rbp), %rdi
leaq -0x2d0(%rbp), %rax
jmp 0x8021
movq %rax, %rbx
xorl %r14d, %r14d
jmp 0x7f44
jmp 0x7fc0
jmp 0x7f38
movq %rax, %rbx
jmp 0x7f44
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x4f40
movq -0x2e0(%rbp), %rdi
testq %rdi, %rdi
jne 0x8026
jmp 0x802b
jmp 0x7f75
jmp 0x7fc5
jmp 0x7fa0
movq %rax, %rbx
jmp 0x8044
jmp 0x7f7c
jmp 0x7f7c
jmp 0x7fa0
movq %rax, %rbx
jmp 0x8001
movq %rax, %rbx
jmp 0x7faf
jmp 0x7f7c
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x7fa3
movl %r15d, (%r14)
jmp 0x7fa3
jmp 0x7fc0
movq %rax, %rbx
leaq -0x2e0(%rbp), %rdi
callq 0x4f40
jmp 0x802b
movq %rax, %rbx
leaq -0x2e0(%rbp), %rdi
callq 0x4f40
leaq -0x558(%rbp), %rdi
callq 0x30c0
jmp 0x8044
movq %rax, %rbx
jmp 0x802b
movq %rax, %rbx
movq -0x90(%rbp), %rax
movq %rax, -0x2e0(%rbp)
movq -0x18(%rax), %rax
movq -0x88(%rbp), %rcx
movq %rcx, -0x2e0(%rbp,%rax)
leaq -0x2d8(%rbp), %rdi
callq 0x3220
leaq -0x1e8(%rbp), %rdi
callq 0x3110
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x8019
callq 0x3270
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x802b
callq 0x3270
leaq -0x558(%rbp), %rdi
callq 0x30c0
testq %r14, %r14
je 0x8044
movq %r14, %rdi
callq 0x3270
leaq -0x40(%rbp), %rdi
callq 0x53f6
movq %rbx, %rdi
callq 0x34a0