// File: /workspace/github_cpp_makefile_star2_O3/adamiaonr[P]rid-analytics/src/rid-analytics.cpp
// Function: RID_Analytics::build_network(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int RID_Analytics::build_network(std::string nw_filename) {

    // read .scn file, structured as an xml file
    pugi::xml_document nw_doc;
    if (!(nw_doc.load_file(nw_filename.c_str()))) {

        std::cerr << "RID_Analytics::get_network() : [ERROR] .scn file (" 
            << nw_filename << ") not found." << std::endl;

        return -1;
    }

    pugi::xml_node topology = nw_doc.child("topology");

    // ***
    // *** extract the fwd table size (a unique table size for the complete topology)
    // ***
    std::cout << "RID_Analytics::build_network() : [INFO] table size: ";
    pugi::xml_node ts = topology.child("fwd_table_size");
    uint64_t table_size = ts.text().as_uint();
    std::cout << "\n\tSIZE = " << ts.text().as_uint() << " (" << table_size << ")" << std::endl;

    // ***
    // *** extract the ttl
    // ***
    std::cout << "RID_Analytics::build_network() : [INFO] ttl: ";
    pugi::xml_node ttl_block = topology.child("ttl");
    this->ttl = ttl_block.text().as_int();
    std::cout << "\n\tTTL = " << ttl_block.text().as_int() << " (" << ttl << ")" << std::endl;

    // ***
    // *** start building the topology by reading the info for each router
    // ***
    for (pugi::xml_node router = topology.child("router"); 
        router; 
        router = router.next_sibling("router")) {

        std::string router_id = std::string(router.attribute("id").value());
        std::cout << "RID_Analytics::build_network() : [INFO] installing router " << router_id << std::endl;

        // ***
        // *** extract iface nr. & entry distr. per iface
        // ***
        std::cout << "RID_Analytics::build_network() : [INFO] \% of entries per iface: ";
        // extract the nr. of ifaces by counting the number of fwd_dist xml nodes
        int iface_num = 0;
        // extract iface <-> map
        std::map<int, __float080> fwd_dist;
        for (pugi::xml_node dist = router.child("fwd_dist"); 
            dist; 
            dist = dist.next_sibling("fwd_dist")) {

            fwd_dist[(int) dist.attribute("iface").as_int()] = ((__float080) dist.text().as_double());
            // increment the number of ifaces here
            iface_num++;

            std::cout << "\n\tIFACE = " << dist.attribute("iface").as_int()
                << ", DISTR. = " << (__float080) dist.text().as_double() 
                    << " (" << fwd_dist[(int) dist.attribute("iface").as_int()] << ")";
        }
        std::cout << std::endl;

        std::cout << "RID_Analytics::build_network() : [INFO] iface_num = " << (int) iface_num << std::endl;

        // ***
        // *** create or initialize new RID router
        // ***
        RID_Router * new_router = NULL;
        RID_RouterMap::iterator rit;
        if ((rit = this->routers.find(router_id)) != this->routers.end()) {

            new_router = (*rit).second;
            new_router->init(
                router_id,
                table_size,                 // nr. of table entries for router
                iface_num,                  // nr. of ifaces (i.e. nr. of adjacent routers)
                this->request_size,         // max. request & forwarding entry size
                this->bf_size,              // BF size (of both requests and entries, in bit)
                this->mode);                // modes for multiple matches and error resolution

        } else {

            new_router = 
                new RID_Router(
                    router_id,
                    table_size,
                    (uint8_t) iface_num,
                    this->request_size,
                    this->bf_size,
                    this->mode);

            // add the router to the router map
            this->routers[router_id] = new_router;

            std::cout << "RID_Analytics::build_network() : [INFO] added new router : "
                << router_id << std::endl;
        }

        // ***
        // *** initialize router ifaces & add fwd entries
        // ***
        for (pugi::xml_node link = router.child("link"); 
            link; 
            link = link.next_sibling("link")) {

            // ***
            // *** extract fwd entry size distributions
            // ***
            std::map<int, __float080> size_dist;
            for (pugi::xml_node s_dist = link.child("fwd_size_dist"); 
                s_dist; 
                s_dist = s_dist.next_sibling("fwd_size_dist")) {

                size_dist[s_dist.attribute("size").as_uint()] = s_dist.text().as_double();
            }

            // ***
            // *** extract the tree bitmask : a bitmask which indicates which
            // *** sources are reachable from this iface 
            // ***
            std::map<int, std::vector<uint8_t> > tree_bitmasks;

            for (pugi::xml_node tree_bitmask_block = link.child("tree_bitmask"); 
                tree_bitmask_block; 
                tree_bitmask_block = tree_bitmask_block.next_sibling("tree_bitmask")) {

                std::string tree_bitmask_str = std::string(tree_bitmask_block.text().as_string());
                std::vector<uint8_t> tree_bitmask;

                for (unsigned int i = 0; i < tree_bitmask_str.size(); ) {

                    uint8_t higher_bits = (uint8_t) ((tree_bitmask_str[i] >= 'a') ? (tree_bitmask_str[i] - 'a' + 10) : (tree_bitmask_str[i] - '0'));
                    // std::cout << "RID_Analytics::build_network() : [INFO] tree_bitmask["
                    //     << router_id << "][" << link.attribute("local").as_int() << "] : "
                    //     << "\n\tstr (H4): " << tree_bitmask_str[i]
                    //     << "\n\tint (H4): " << (int) higher_bits << std::endl;

                    i++;

                    uint8_t lower_bits = (uint8_t) ((tree_bitmask_str[i] >= 'a') ? (tree_bitmask_str[i] - 'a' + 10) : (tree_bitmask_str[i] - '0'));
                    // std::cout << "RID_Analytics::build_network() : [INFO] tree_bitmask["
                    //     << router_id << "][" << link.attribute("local").as_int() << "] : "
                    //     << "\n\tstr (L4): " << tree_bitmask_str[i]
                    //     << "\n\tint (L4): " << (int) lower_bits
                    //     << "\n\tint (H4L4): " << (int) (((higher_bits << 4) & 0xF0) | (lower_bits & 0x0F)) << std::endl;

                    i++;

                    tree_bitmask.push_back(((higher_bits << 4) & 0xF0) | (lower_bits & 0x0F));
                }

                unsigned int tb_size = tree_bitmask_block.attribute("size").as_uint();
                tree_bitmasks[tb_size] = tree_bitmask;

                std::cout << "RID_Analytics::build_network() : [INFO] tree_bitmask["
                    << router_id << "][" << link.attribute("local").as_int() << "] : ";
                for (unsigned int i = 0; i < tree_bitmasks[tb_size].size(); i++)
                    std::cout << "[" << (int) tree_bitmasks[tb_size][i] << "] ";
                std::cout << std::endl;
            }
            
            std::string adjacent_router_id = std::string(link.attribute("rrouter").value());

            // if adjacent_router is already in the router map, fetch its 
            // pointer. otherwise, create a new RID_Router object.
            RID_Router * adjacent_router = NULL;
            RID_RouterMap::iterator rtr_map_it;       
            if ((rtr_map_it = this->routers.find(adjacent_router_id)) != this->routers.end()) {

                adjacent_router = (*rtr_map_it).second;

            } else {

                adjacent_router = new RID_Router();
                // add adj. router to the router map
                this->routers[adjacent_router_id] = adjacent_router;

                std::cout << "RID_Analytics::build_network() : [INFO] added new router : "
                    << adjacent_router_id << std::endl;
            }

            new_router->add_fwd_table_entry(
                link.attribute("local").as_int(),
                fwd_dist[link.attribute("local").as_uint()],
                &size_dist,
                &tree_bitmasks,
                adjacent_router, 
                link.attribute("remote").as_int());
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
movq %rsi, %rbx
movq %rdi, 0x78(%rsp)
leaq 0x1d8(%rsp), %r14
movq %r14, %rdi
callq 0xb972
movq (%rbx), %rdx
leaq 0x100(%rsp), %rdi
movq %r14, %rsi
movl $0x74, %ecx
xorl %r8d, %r8d
callq 0xc434
leaq 0x100(%rsp), %rdi
callq 0xb94a
testb %al, %al
je 0x24246
leaq 0xd9b6(%rip), %rsi      # 0x30e68
leaq 0x1d8(%rsp), %rdi
callq 0x6c70
movq %rax, 0xc0(%rsp)
movq 0x1baea(%rip), %rdi     # 0x3efb8
leaq 0xd9e2(%rip), %rsi      # 0x30eb7
movl $0x34, %edx
callq 0x4400
leaq 0xda06(%rip), %rsi      # 0x30eec
leaq 0xc0(%rsp), %rdi
callq 0x6c70
leaq 0x1a0(%rsp), %rdi
movq %rax, (%rdi)
callq 0x6fc6
leaq 0x100(%rsp), %rdi
movq %rax, (%rdi)
xorl %esi, %esi
callq 0xb0ee
movl %eax, %ebx
movq 0x1ba9a(%rip), %rdi     # 0x3efb8
leaq 0xd9d6(%rip), %rsi      # 0x30efb
movl $0x9, %edx
callq 0x4400
leaq 0x1a0(%rsp), %rdi
callq 0x6fc6
leaq 0x100(%rsp), %rdi
movq %rax, (%rdi)
xorl %esi, %esi
callq 0xb0ee
movl %eax, %esi
movq 0x1ba61(%rip), %rdi     # 0x3efb8
callq 0x4290
movq %rax, %r14
leaq 0xd8f2(%rip), %rsi      # 0x30e58
movl $0x2, %edx
movq %rax, %rdi
callq 0x4400
movl %ebx, %esi
movq %r14, %rdi
movq %rsi, 0x130(%rsp)
callq 0x4290
movq %rax, %rbx
leaq 0xb8fd(%rip), %rsi      # 0x2ee8c
movl $0x1, %edx
movq %rax, %rdi
callq 0x4400
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4370
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x42a0
movq 0x1b9ee(%rip), %rdi     # 0x3efb8
leaq 0xd934(%rip), %rsi      # 0x30f05
movl $0x2d, %edx
callq 0x4400
leaq 0xd951(%rip), %rsi      # 0x30f33
leaq 0xc0(%rsp), %rdi
callq 0x6c70
leaq 0x198(%rsp), %rdi
movq %rax, (%rdi)
callq 0x6fc6
leaq 0x100(%rsp), %rdi
movq %rax, (%rdi)
xorl %esi, %esi
callq 0xb0c4
movq 0x78(%rsp), %rcx
movl %eax, 0x90(%rcx)
movq 0x1b995(%rip), %rdi     # 0x3efb8
leaq 0xd90d(%rip), %rsi      # 0x30f37
movl $0x8, %edx
callq 0x4400
leaq 0x198(%rsp), %rdi
callq 0x6fc6
leaq 0x100(%rsp), %rdi
movq %rax, (%rdi)
xorl %esi, %esi
callq 0xb0c4
movq 0x1b95e(%rip), %r15     # 0x3efb8
movq %r15, %rdi
movl %eax, %esi
callq 0x46d0
movq %rax, %rbx
leaq 0xd7ea(%rip), %rsi      # 0x30e58
movl $0x2, %edx
movq %rax, %rdi
callq 0x4400
movq 0x78(%rsp), %rax
movl 0x90(%rax), %esi
movq %rbx, %rdi
callq 0x46d0
movq %rax, %rbx
leaq 0xb7f4(%rip), %rsi      # 0x2ee8c
movl $0x1, %edx
movq %rax, %rdi
callq 0x4400
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4370
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x42a0
leaq 0xcc06(%rip), %rsi      # 0x302d9
leaq 0xc0(%rsp), %rdi
callq 0x6c70
movq 0x78(%rsp), %rcx
leaq 0x50(%rcx), %rdx
movq %rdx, 0x98(%rsp)
addq $0x58, %rcx
movq %rcx, 0x138(%rsp)
leaq 0x80(%rsp), %rbx
leaq 0x1a8(%rsp), %r12
leaq 0x20(%rsp), %r14
leaq 0xdad4(%rip), %rbp      # 0x311ed
movq %rax, 0x80(%rsp)
movq %rbx, %rdi
callq 0x6bc0
testq %rax, %rax
je 0x242d5
leaq 0x80(%rsp), %rdi
leaq 0xd989(%rip), %rsi      # 0x310ca
callq 0x6db0
movq %rax, 0x100(%rsp)
leaq 0x100(%rsp), %rdi
callq 0x6284
leaq 0xa0(%rsp), %rdi
movq %rax, %rsi
leaq 0xd0(%rsp), %rdx
callq 0x2182c
movl $0x3a, %edx
movq %r15, %rdi
leaq 0xd7be(%rip), %rsi      # 0x30f40
callq 0x4400
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
movq %r15, %rdi
callq 0x4400
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4370
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x42a0
movl $0x40, %edx
movq %r15, %rdi
leaq 0xd7a3(%rip), %rsi      # 0x30f7b
callq 0x4400
movl $0x0, 0x108(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x110(%rsp)
leaq 0x108(%rsp), %rax
movq %rax, 0x118(%rsp)
movq %rax, 0x120(%rsp)
movq %rcx, 0x128(%rsp)
leaq 0x80(%rsp), %rdi
leaq 0xd79b(%rip), %rsi      # 0x30fbc
callq 0x6c70
movl $0x0, 0x8c(%rsp)
leaq 0xd0(%rsp), %rbx
movq %rax, 0xd0(%rsp)
movq %rbx, %rdi
callq 0x6bc0
testq %rax, %rax
je 0x239f2
leaq 0xd0(%rsp), %rdi
callq 0x6fc6
movq %rax, 0x1a8(%rsp)
xorps %xmm0, %xmm0
movq %r12, %rdi
callq 0xb116
movsd %xmm0, 0x190(%rsp)
fldl 0x190(%rsp)
fstpt 0x28(%rsp)
leaq 0xd0(%rsp), %rdi
leaq 0xd61c(%rip), %rsi      # 0x30eb1
callq 0x6db0
movq %rax, 0x58(%rsp)
leaq 0x58(%rsp), %rdi
xorl %esi, %esi
callq 0x6152
movl %eax, 0x40(%rsp)
leaq 0x100(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x1d994
fldt 0x28(%rsp)
fstpt (%rax)
movl $0xa, %edx
movq %r15, %rdi
leaq 0xd6ef(%rip), %rsi      # 0x30fc5
callq 0x4400
leaq 0xd0(%rsp), %rdi
leaq 0xd5c7(%rip), %rsi      # 0x30eb1
callq 0x6db0
movq %rax, 0x1a8(%rsp)
movq %r12, %rdi
xorl %esi, %esi
callq 0x6152
movq %r15, %rdi
movl %eax, %esi
callq 0x46d0
movq %rax, %r13
movl $0xb, %edx
movq %rax, %rdi
leaq 0xd6b3(%rip), %rsi      # 0x30fd0
callq 0x4400
leaq 0xd0(%rsp), %rdi
callq 0x6fc6
movq %rax, 0x58(%rsp)
xorps %xmm0, %xmm0
leaq 0x58(%rsp), %rdi
callq 0xb116
movsd %xmm0, 0x188(%rsp)
fldl 0x188(%rsp)
fstpt (%rsp)
movq %r13, %rdi
callq 0x41f0
movq %rax, %r13
movl $0x2, %edx
movq %rax, %rdi
leaq 0xd4ea(%rip), %rsi      # 0x30e58
callq 0x4400
leaq 0xd0(%rsp), %rdi
leaq 0xd52f(%rip), %rsi      # 0x30eb1
callq 0x6db0
movq %rax, 0x40(%rsp)
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
callq 0x6152
movl %eax, 0x10(%rsp)
leaq 0x100(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1d994
fldt (%rax)
fstpt (%rsp)
movq %r13, %rdi
callq 0x41f0
movl $0x1, %edx
movq %rax, %rdi
leaq 0xb4c2(%rip), %rsi      # 0x2ee8c
callq 0x4400
incl 0x8c(%rsp)
leaq 0xd0(%rsp), %rbx
movq %rbx, %rdi
leaq 0xd5d4(%rip), %rsi      # 0x30fbc
callq 0x6df4
jmp 0x23839
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4370
movsbl %al, %esi
movq %r15, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x42a0
movl $0x34, %edx
movq %r15, %rdi
leaq 0xd5b4(%rip), %rsi      # 0x30fdc
callq 0x4400
movq %r15, %rdi
movl 0x8c(%rsp), %esi
callq 0x46d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4370
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x42a0
movq 0x98(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x2902c
cmpq 0x138(%rsp), %rax
je 0x23b26
movq 0x40(%rax), %rax
movq %rax, 0x38(%rsp)
leaq 0x150(%rsp), %rax
movq %rax, 0x140(%rsp)
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x140(%rsp), %rdi
callq 0x1bdb4
movq 0x78(%rsp), %rax
movzbl (%rax), %r8d
movzwl 0x2(%rax), %r9d
movl 0x4(%rax), %eax
movl %eax, (%rsp)
movzbl 0x8c(%rsp), %ecx
movq 0x38(%rsp), %rdi
leaq 0x140(%rsp), %rsi
movq 0x130(%rsp), %rdx
callq 0x1be4c
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x23c31
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x23c31
movl $0xa8, %edi
callq 0x4390
movq %rax, 0x38(%rsp)
leaq 0x170(%rsp), %rax
movq %rax, 0x160(%rsp)
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x160(%rsp), %rbx
movq %rbx, %rdi
callq 0x1bdb4
movq 0x78(%rsp), %rax
movzbl (%rax), %r8d
movzwl 0x2(%rax), %r9d
movl 0x4(%rax), %eax
movl %eax, (%rsp)
movzbl 0x8c(%rsp), %ecx
movq 0x38(%rsp), %rdi
movq %rbx, %rsi
movq 0x130(%rsp), %rdx
callq 0x1c0ae
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0x23bbe
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x98(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x27e8e
movq 0x38(%rsp), %rcx
movq %rcx, (%rax)
movl $0x3b, %edx
movq %r15, %rdi
leaq 0xd427(%rip), %rsi      # 0x31011
callq 0x4400
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
movq %r15, %rdi
callq 0x4400
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4370
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x42a0
leaq 0x80(%rsp), %rdi
leaq 0xd40d(%rip), %rsi      # 0x3104d
callq 0x6c70
leaq 0x10(%rsp), %rbx
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
callq 0x6bc0
testq %rax, %rax
je 0x241f8
movl $0x0, 0xd8(%rsp)
xorl %ecx, %ecx
movq %rcx, 0xe0(%rsp)
leaq 0xd8(%rsp), %rax
movq %rax, 0xe8(%rsp)
movq %rax, 0xf0(%rsp)
movq %rcx, 0xf8(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0xd3b1(%rip), %rsi      # 0x31052
callq 0x6c70
movq %rax, 0x1a8(%rsp)
movq %r12, %rdi
callq 0x6bc0
testq %rax, %rax
je 0x23d39
movq %r12, %rdi
callq 0x6fc6
movq %rax, 0x58(%rsp)
xorps %xmm0, %xmm0
leaq 0x58(%rsp), %rdi
callq 0xb116
movsd %xmm0, 0x180(%rsp)
fldl 0x180(%rsp)
fstpt 0x28(%rsp)
movq %r12, %rdi
leaq 0xc460(%rip), %rsi      # 0x30153
callq 0x6db0
movq %rax, 0x40(%rsp)
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
callq 0x6176
movl %eax, 0x18(%rsp)
leaq 0xd0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x1d994
fldt 0x28(%rsp)
fstpt (%rax)
movq %r12, %rdi
leaq 0xd323(%rip), %rsi      # 0x31052
callq 0x6df4
jmp 0x23ca6
movl $0x0, 0x1b0(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x1b8(%rsp)
leaq 0x1b0(%rsp), %rax
movq %rax, 0x1c0(%rsp)
movq %rax, 0x1c8(%rsp)
movq %rcx, 0x1d0(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0xd2e6(%rip), %rsi      # 0x31060
callq 0x6c70
leaq 0x18(%rsp), %rbx
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
callq 0x6bc0
testq %rax, %rax
je 0x23fdb
leaq 0x18(%rsp), %rdi
callq 0x6fc6
movq %rax, 0x40(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0xc722(%rip), %rsi      # 0x304d7
callq 0xb0a8
leaq 0x58(%rsp), %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x2182c
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
cmpq $0x0, 0x60(%rsp)
je 0x23e41
movl $0x2, %ebx
xorl %eax, %eax
movq 0x58(%rsp), %rsi
movb (%rsi,%rax), %dl
movl $0x9, %eax
movl $0x9, %ecx
cmpb $0x61, %dl
jge 0x23e06
movl $0x60, %ecx
leal -0x1(%rbx), %edi
movb (%rsi,%rdi), %sil
cmpb $0x61, %sil
jge 0x23e18
movl $0x60, %eax
addb %dl, %cl
addb %sil, %al
shlb $0x4, %cl
andb $0xf, %al
orb %cl, %al
movb %al, 0x20(%rsp)
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x29072
movl %ebx, %eax
addl $0x2, %ebx
cmpq %rax, 0x60(%rsp)
ja 0x23dea
leaq 0x18(%rsp), %rdi
leaq 0xc306(%rip), %rsi      # 0x30153
callq 0x6db0
movq %rax, 0x20(%rsp)
movq %r14, %rdi
xorl %esi, %esi
callq 0x6176
movl %eax, %r13d
movl %eax, 0x20(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x28182
movq %rax, %rdi
leaq 0x40(%rsp), %rsi
callq 0x280be
movl $0x35, %edx
movq %r15, %rdi
leaq 0xd1de(%rip), %rsi      # 0x3106d
callq 0x4400
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
movq %r15, %rdi
callq 0x4400
movq %rax, %rbx
movl $0x2, %edx
movq %rax, %rdi
leaq 0xd1e5(%rip), %rsi      # 0x310a3
callq 0x4400
leaq 0x10(%rsp), %rdi
leaq 0xd1d7(%rip), %rsi      # 0x310a6
callq 0x6db0
movq %rax, 0x20(%rsp)
movq %r14, %rdi
xorl %esi, %esi
callq 0x6152
movq %rbx, %rdi
movl %eax, %esi
callq 0x46d0
movl $0x4, %edx
movq %rax, %rdi
leaq 0xd1b0(%rip), %rsi      # 0x310ac
callq 0x4400
xorl %ebx, %ebx
movl %r13d, 0x20(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x28182
movl %ebx, %ebx
movq 0x8(%rax), %rcx
subq (%rax), %rcx
cmpq %rbx, %rcx
jbe 0x23f68
movl $0x1, %edx
movq %r15, %rdi
leaq 0xd453(%rip), %rsi      # 0x31383
callq 0x4400
movl %r13d, 0x20(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x28182
movq (%rax), %rax
movzbl (%rax,%rbx), %esi
movq %r15, %rdi
callq 0x46d0
movl $0x2, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x4400
incl %ebx
jmp 0x23f03
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4370
movsbl %al, %esi
movq %r15, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x42a0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x23fa6
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x43a0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x23fc2
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x43a0
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
leaq 0xd08f(%rip), %rsi      # 0x31060
callq 0x6df4
jmp 0x23d84
leaq 0x10(%rsp), %rdi
leaq 0xd0ca(%rip), %rsi      # 0x310b1
callq 0x6db0
movq %rax, 0x40(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x6284
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
leaq 0x18(%rsp), %rdx
callq 0x2182c
movq 0x98(%rsp), %rdi
movq %rbx, %rsi
callq 0x2902c
cmpq 0x138(%rsp), %rax
je 0x24038
movq 0x40(%rax), %rax
movq %rax, 0x28(%rsp)
jmp 0x240f8
movl $0xa8, %edi
callq 0x4390
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rcx
movq %rcx, %rax
addq $0x10, %rax
movq %rax, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movb %al, 0x10(%rcx)
movq %rax, 0x70(%rcx)
movl $0x0, 0x78(%rcx)
movb %al, 0x20(%rcx)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rcx)
movups %xmm0, 0x40(%rcx)
movups %xmm0, 0x50(%rcx)
movups %xmm0, 0x5c(%rcx)
movups %xmm0, 0x80(%rcx)
movups %xmm0, 0x90(%rcx)
movq 0x98(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x27e8e
movq 0x28(%rsp), %rcx
movq %rcx, (%rax)
movl $0x3b, %edx
movq %r15, %rdi
leaq 0xcf5a(%rip), %rsi      # 0x31011
callq 0x4400
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq %r15, %rdi
callq 0x4400
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4370
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x42a0
leaq 0x10(%rsp), %rdi
leaq 0xcfa2(%rip), %rsi      # 0x310a6
callq 0x6db0
movq %rax, 0x40(%rsp)
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
callq 0x6152
movl %eax, %r13d
leaq 0x10(%rsp), %rdi
leaq 0xcf7d(%rip), %rsi      # 0x310a6
callq 0x6db0
movq %rax, 0x18(%rsp)
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x6176
movl %eax, 0xcc(%rsp)
leaq 0x100(%rsp), %rdi
leaq 0xcc(%rsp), %rsi
callq 0x1d994
fldt (%rax)
fstpt 0x8c(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0xcf49(%rip), %rsi      # 0x310b9
callq 0x6db0
movq %rax, 0x20(%rsp)
movq %r14, %rdi
xorl %esi, %esi
callq 0x6152
fldt 0x8c(%rsp)
fstpt (%rsp)
movq 0x38(%rsp), %rdi
movl %r13d, %esi
leaq 0xd0(%rsp), %rdx
movq %r12, %rcx
movq 0x28(%rsp), %r8
movl %eax, %r9d
callq 0x1c258
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x241ca
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x43a0
movq %r12, %rdi
callq 0x1e55c
leaq 0xd0(%rsp), %rdi
callq 0x284fe
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
leaq 0xce5f(%rip), %rsi      # 0x3104d
callq 0x6df4
jmp 0x23c4a
leaq 0x100(%rsp), %rdi
callq 0x284fe
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x2422a
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x43a0
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
leaq 0xc09d(%rip), %rsi      # 0x302d9
callq 0x6df4
jmp 0x23719
movq 0x1ada3(%rip), %rdi     # 0x3eff0
leaq 0xcbd4(%rip), %rsi      # 0x30e28
movl $0x32, %edx
callq 0x4400
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x1ad84(%rip), %rdi     # 0x3eff0
callq 0x4400
movq %rax, %rbx
leaq 0xcbe0(%rip), %rsi      # 0x30e5b
movl $0xc, %edx
movq %rax, %rdi
callq 0x4400
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4370
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq %rax, %rdi
callq 0x42a0
leaq 0x1d8(%rsp), %rdi
callq 0xb9fe
movl %ebx, %eax
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0x242b4
jmp 0x2436b
jmp 0x2436b
movq %rax, %rbx
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0x24310
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x24310
movq %rax, %rbx
movl $0xa8, %esi
movq 0x38(%rsp), %rdi
jmp 0x2434d
jmp 0x2436b
jmp 0x2436b
jmp 0x2436b
jmp 0x2436b
jmp 0x2436b
movq %rax, %rbx
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x2441d
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x2441d
jmp 0x2436b
jmp 0x2436b
jmp 0x243a4
jmp 0x243a4
jmp 0x243a4
jmp 0x2436b
jmp 0x2436b
jmp 0x2436b
jmp 0x2436b
jmp 0x2436b
movq %rax, %rbx
jmp 0x2444f
jmp 0x243a4
movq %rax, %rbx
jmp 0x2442a
jmp 0x243a4
jmp 0x243a4
jmp 0x243b7
jmp 0x24399
jmp 0x243b7
jmp 0x243be
jmp 0x243a4
jmp 0x243a4
jmp 0x24399
jmp 0x243b7
jmp 0x243a4
jmp 0x243a4
jmp 0x24399
jmp 0x24399
movq %rax, %rbx
jmp 0x243e7
jmp 0x243a4
jmp 0x243a4
jmp 0x243a4
movq %rax, %rbx
jmp 0x2441d
jmp 0x243b7
jmp 0x243b7
jmp 0x243be
jmp 0x243b7
jmp 0x243be
jmp 0x243cd
jmp 0x243cd
movq %rax, %rbx
jmp 0x24403
jmp 0x243be
movq %rax, %rbx
jmp 0x24410
jmp 0x243cd
jmp 0x243cd
jmp 0x243cd
jmp 0x243cd
jmp 0x243cd
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x243e7
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x43a0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x24403
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x43a0
leaq 0x1a8(%rsp), %rdi
callq 0x1e55c
leaq 0xd0(%rsp), %rdi
callq 0x284fe
leaq 0x100(%rsp), %rdi
callq 0x284fe
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x2444f
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x43a0
leaq 0x1d8(%rsp), %rdi
callq 0xb9fe
movq %rbx, %rdi
callq 0x4700