// File: /workspace/github_cpp_makefile_star2_O1/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 0xbaa4
movq (%rbx), %rdx
leaq 0x100(%rsp), %rdi
movq %r14, %rsi
movl $0x74, %ecx
xorl %r8d, %r8d
callq 0xc61c
leaq 0x100(%rsp), %rdi
callq 0xba7c
testb %al, %al
je 0x2473e
leaq 0xe6de(%rip), %rsi      # 0x32088
leaq 0x1d8(%rsp), %rdi
callq 0x6a76
movq %rax, 0xc0(%rsp)
movq 0x1c5f2(%rip), %rdi     # 0x3ffb8
leaq 0xe70a(%rip), %rsi      # 0x320d7
movl $0x34, %edx
callq 0x4400
leaq 0xe72e(%rip), %rsi      # 0x3210c
leaq 0xc0(%rsp), %rdi
callq 0x6a76
leaq 0x1a0(%rsp), %rdi
movq %rax, (%rdi)
callq 0x6dd0
leaq 0x100(%rsp), %rdi
movq %rax, (%rdi)
xorl %esi, %esi
callq 0xb258
movl %eax, %ebx
movq 0x1c5a2(%rip), %rdi     # 0x3ffb8
leaq 0xe6fe(%rip), %rsi      # 0x3211b
movl $0x9, %edx
callq 0x4400
leaq 0x1a0(%rsp), %rdi
callq 0x6dd0
leaq 0x100(%rsp), %rdi
movq %rax, (%rdi)
xorl %esi, %esi
callq 0xb258
movl %eax, %esi
movq 0x1c569(%rip), %rdi     # 0x3ffb8
callq 0x4290
movq %rax, %r14
leaq 0xe61a(%rip), %rsi      # 0x32078
movl $0x2, %edx
movq %rax, %rdi
callq 0x4400
movl %ebx, %esi
movq %r14, %rdi
movq %rsi, 0x130(%rsp)
callq 0x4290
movq %rax, %rbx
leaq 0xc5af(%rip), %rsi      # 0x30036
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 0x1c4f6(%rip), %rdi     # 0x3ffb8
leaq 0xe65c(%rip), %rsi      # 0x32125
movl $0x2d, %edx
callq 0x4400
leaq 0xe679(%rip), %rsi      # 0x32153
leaq 0xc0(%rsp), %rdi
callq 0x6a76
leaq 0x198(%rsp), %rdi
movq %rax, (%rdi)
callq 0x6dd0
leaq 0x100(%rsp), %rdi
movq %rax, (%rdi)
xorl %esi, %esi
callq 0xb22e
movq 0x78(%rsp), %rcx
movl %eax, 0x90(%rcx)
movq 0x1c49d(%rip), %rdi     # 0x3ffb8
leaq 0xe635(%rip), %rsi      # 0x32157
movl $0x8, %edx
callq 0x4400
leaq 0x198(%rsp), %rdi
callq 0x6dd0
leaq 0x100(%rsp), %rdi
movq %rax, (%rdi)
xorl %esi, %esi
callq 0xb22e
movq 0x1c466(%rip), %r15     # 0x3ffb8
movq %r15, %rdi
movl %eax, %esi
callq 0x46d0
movq %rax, %rbx
leaq 0xe512(%rip), %rsi      # 0x32078
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 0xc4a6(%rip), %rsi      # 0x30036
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 0xd92e(%rip), %rsi      # 0x314f9
leaq 0xc0(%rsp), %rdi
callq 0x6a76
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 0xe7fc(%rip), %rbp      # 0x3240d
movq %rax, 0x80(%rsp)
movq %rbx, %rdi
callq 0x69c6
testq %rax, %rax
je 0x247cd
leaq 0x80(%rsp), %rdi
leaq 0xe6b1(%rip), %rsi      # 0x322ea
callq 0x6bb8
movq %rax, 0x100(%rsp)
leaq 0x100(%rsp), %rdi
callq 0x6094
leaq 0xa0(%rsp), %rdi
movq %rax, %rsi
leaq 0xd0(%rsp), %rdx
callq 0x21d02
movl $0x3a, %edx
movq %r15, %rdi
leaq 0xe4e6(%rip), %rsi      # 0x32160
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 0xe4cb(%rip), %rsi      # 0x3219b
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 0xe4c3(%rip), %rsi      # 0x321dc
callq 0x6a76
movl $0x0, 0x8c(%rsp)
leaq 0xd0(%rsp), %rbx
movq %rax, 0xd0(%rsp)
movq %rbx, %rdi
callq 0x69c6
testq %rax, %rax
je 0x23eea
leaq 0xd0(%rsp), %rdi
callq 0x6dd0
movq %rax, 0x1a8(%rsp)
xorps %xmm0, %xmm0
movq %r12, %rdi
callq 0xb280
movsd %xmm0, 0x190(%rsp)
fldl 0x190(%rsp)
fstpt 0x28(%rsp)
leaq 0xd0(%rsp), %rdi
leaq 0xe344(%rip), %rsi      # 0x320d1
callq 0x6bb8
movq %rax, 0x58(%rsp)
leaq 0x58(%rsp), %rdi
xorl %esi, %esi
callq 0x5f62
movl %eax, 0x40(%rsp)
leaq 0x100(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x1de3c
fldt 0x28(%rsp)
fstpt (%rax)
movl $0xa, %edx
movq %r15, %rdi
leaq 0xe417(%rip), %rsi      # 0x321e5
callq 0x4400
leaq 0xd0(%rsp), %rdi
leaq 0xe2ef(%rip), %rsi      # 0x320d1
callq 0x6bb8
movq %rax, 0x1a8(%rsp)
movq %r12, %rdi
xorl %esi, %esi
callq 0x5f62
movq %r15, %rdi
movl %eax, %esi
callq 0x46d0
movq %rax, %r13
movl $0xb, %edx
movq %rax, %rdi
leaq 0xe3db(%rip), %rsi      # 0x321f0
callq 0x4400
leaq 0xd0(%rsp), %rdi
callq 0x6dd0
movq %rax, 0x58(%rsp)
xorps %xmm0, %xmm0
leaq 0x58(%rsp), %rdi
callq 0xb280
movsd %xmm0, 0x188(%rsp)
fldl 0x188(%rsp)
fstpt (%rsp)
movq %r13, %rdi
callq 0x41f0
movq %rax, %r13
movl $0x2, %edx
movq %rax, %rdi
leaq 0xe212(%rip), %rsi      # 0x32078
callq 0x4400
leaq 0xd0(%rsp), %rdi
leaq 0xe257(%rip), %rsi      # 0x320d1
callq 0x6bb8
movq %rax, 0x40(%rsp)
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
callq 0x5f62
movl %eax, 0x10(%rsp)
leaq 0x100(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1de3c
fldt (%rax)
fstpt (%rsp)
movq %r13, %rdi
callq 0x41f0
movl $0x1, %edx
movq %rax, %rdi
leaq 0xc174(%rip), %rsi      # 0x30036
callq 0x4400
incl 0x8c(%rsp)
leaq 0xd0(%rsp), %rbx
movq %rbx, %rdi
leaq 0xe2fc(%rip), %rsi      # 0x321dc
callq 0x6bfe
jmp 0x23d31
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 0xe2dc(%rip), %rsi      # 0x321fc
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 0x29508
cmpq 0x138(%rsp), %rax
je 0x2401e
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 0x1c27c
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 0x1c30c
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x24129
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x24129
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 0x1c27c
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 0x1c5ca
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0x240b6
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x98(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x28380
movq 0x38(%rsp), %rcx
movq %rcx, (%rax)
movl $0x3b, %edx
movq %r15, %rdi
leaq 0xe14f(%rip), %rsi      # 0x32231
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 0xe135(%rip), %rsi      # 0x3226d
callq 0x6a76
leaq 0x10(%rsp), %rbx
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
callq 0x69c6
testq %rax, %rax
je 0x246f0
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 0xe0d9(%rip), %rsi      # 0x32272
callq 0x6a76
movq %rax, 0x1a8(%rsp)
movq %r12, %rdi
callq 0x69c6
testq %rax, %rax
je 0x24231
movq %r12, %rdi
callq 0x6dd0
movq %rax, 0x58(%rsp)
xorps %xmm0, %xmm0
leaq 0x58(%rsp), %rdi
callq 0xb280
movsd %xmm0, 0x180(%rsp)
fldl 0x180(%rsp)
fstpt 0x28(%rsp)
movq %r12, %rdi
leaq 0xd188(%rip), %rsi      # 0x31373
callq 0x6bb8
movq %rax, 0x40(%rsp)
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
callq 0x5f86
movl %eax, 0x18(%rsp)
leaq 0xd0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x1de3c
fldt 0x28(%rsp)
fstpt (%rax)
movq %r12, %rdi
leaq 0xe04b(%rip), %rsi      # 0x32272
callq 0x6bfe
jmp 0x2419e
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 0xe00e(%rip), %rsi      # 0x32280
callq 0x6a76
leaq 0x18(%rsp), %rbx
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
callq 0x69c6
testq %rax, %rax
je 0x244d3
leaq 0x18(%rsp), %rdi
callq 0x6dd0
movq %rax, 0x40(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0xd44a(%rip), %rsi      # 0x316f7
callq 0xb212
leaq 0x58(%rsp), %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x21d02
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
cmpq $0x0, 0x60(%rsp)
je 0x24339
movl $0x2, %ebx
xorl %eax, %eax
movq 0x58(%rsp), %rsi
movb (%rsi,%rax), %dl
movl $0x9, %eax
movl $0x9, %ecx
cmpb $0x61, %dl
jge 0x242fe
movl $0x60, %ecx
leal -0x1(%rbx), %edi
movb (%rsi,%rdi), %sil
cmpb $0x61, %sil
jge 0x24310
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 0x2954e
movl %ebx, %eax
addl $0x2, %ebx
cmpq %rax, 0x60(%rsp)
ja 0x242e2
leaq 0x18(%rsp), %rdi
leaq 0xd02e(%rip), %rsi      # 0x31373
callq 0x6bb8
movq %rax, 0x20(%rsp)
movq %r14, %rdi
xorl %esi, %esi
callq 0x5f86
movl %eax, %r13d
movl %eax, 0x20(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x28660
movq %rax, %rdi
leaq 0x40(%rsp), %rsi
callq 0x285aa
movl $0x35, %edx
movq %r15, %rdi
leaq 0xdf06(%rip), %rsi      # 0x3228d
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 0xdf0d(%rip), %rsi      # 0x322c3
callq 0x4400
leaq 0x10(%rsp), %rdi
leaq 0xdeff(%rip), %rsi      # 0x322c6
callq 0x6bb8
movq %rax, 0x20(%rsp)
movq %r14, %rdi
xorl %esi, %esi
callq 0x5f62
movq %rbx, %rdi
movl %eax, %esi
callq 0x46d0
movl $0x4, %edx
movq %rax, %rdi
leaq 0xded8(%rip), %rsi      # 0x322cc
callq 0x4400
xorl %ebx, %ebx
movl %r13d, 0x20(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x28660
movl %ebx, %ebx
movq 0x8(%rax), %rcx
subq (%rax), %rcx
cmpq %rbx, %rcx
jbe 0x24460
movl $0x1, %edx
movq %r15, %rdi
leaq 0xe17b(%rip), %rsi      # 0x325a3
callq 0x4400
movl %r13d, 0x20(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x28660
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 0x243fb
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 0x2449e
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x43a0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x244ba
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x43a0
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
leaq 0xddb7(%rip), %rsi      # 0x32280
callq 0x6bfe
jmp 0x2427c
leaq 0x10(%rsp), %rdi
leaq 0xddf2(%rip), %rsi      # 0x322d1
callq 0x6bb8
movq %rax, 0x40(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x6094
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
leaq 0x18(%rsp), %rdx
callq 0x21d02
movq 0x98(%rsp), %rdi
movq %rbx, %rsi
callq 0x29508
cmpq 0x138(%rsp), %rax
je 0x24530
movq 0x40(%rax), %rax
movq %rax, 0x28(%rsp)
jmp 0x245f0
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 0x28380
movq 0x28(%rsp), %rcx
movq %rcx, (%rax)
movl $0x3b, %edx
movq %r15, %rdi
leaq 0xdc82(%rip), %rsi      # 0x32231
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 0xdcca(%rip), %rsi      # 0x322c6
callq 0x6bb8
movq %rax, 0x40(%rsp)
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
callq 0x5f62
movl %eax, %r13d
leaq 0x10(%rsp), %rdi
leaq 0xdca5(%rip), %rsi      # 0x322c6
callq 0x6bb8
movq %rax, 0x18(%rsp)
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x5f86
movl %eax, 0xcc(%rsp)
leaq 0x100(%rsp), %rdi
leaq 0xcc(%rsp), %rsi
callq 0x1de3c
fldt (%rax)
fstpt 0x8c(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0xdc71(%rip), %rsi      # 0x322d9
callq 0x6bb8
movq %rax, 0x20(%rsp)
movq %r14, %rdi
xorl %esi, %esi
callq 0x5f62
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 0x1c774
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x246c2
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x43a0
movq %r12, %rdi
callq 0x1e9de
leaq 0xd0(%rsp), %rdi
callq 0x289da
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
leaq 0xdb87(%rip), %rsi      # 0x3226d
callq 0x6bfe
jmp 0x24142
leaq 0x100(%rsp), %rdi
callq 0x289da
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x24722
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x43a0
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
leaq 0xcdc5(%rip), %rsi      # 0x314f9
callq 0x6bfe
jmp 0x23c11
movq 0x1b8ab(%rip), %rdi     # 0x3fff0
leaq 0xd8fc(%rip), %rsi      # 0x32048
movl $0x32, %edx
callq 0x4400
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x1b88c(%rip), %rdi     # 0x3fff0
callq 0x4400
movq %rax, %rbx
leaq 0xd908(%rip), %rsi      # 0x3207b
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 0xbb32
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 0x247ac
jmp 0x24863
jmp 0x24863
movq %rax, %rbx
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0x24808
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x24808
movq %rax, %rbx
movl $0xa8, %esi
movq 0x38(%rsp), %rdi
jmp 0x24845
jmp 0x24863
jmp 0x24863
jmp 0x24863
jmp 0x24863
jmp 0x24863
movq %rax, %rbx
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x24915
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x24915
jmp 0x24863
jmp 0x24863
jmp 0x2489c
jmp 0x2489c
jmp 0x2489c
jmp 0x24863
jmp 0x24863
jmp 0x24863
jmp 0x24863
jmp 0x24863
movq %rax, %rbx
jmp 0x24947
jmp 0x2489c
movq %rax, %rbx
jmp 0x24922
jmp 0x2489c
jmp 0x2489c
jmp 0x248af
jmp 0x24891
jmp 0x248af
jmp 0x248b6
jmp 0x2489c
jmp 0x2489c
jmp 0x24891
jmp 0x248af
jmp 0x2489c
jmp 0x2489c
jmp 0x24891
jmp 0x24891
movq %rax, %rbx
jmp 0x248df
jmp 0x2489c
jmp 0x2489c
jmp 0x2489c
movq %rax, %rbx
jmp 0x24915
jmp 0x248af
jmp 0x248af
jmp 0x248b6
jmp 0x248af
jmp 0x248b6
jmp 0x248c5
jmp 0x248c5
movq %rax, %rbx
jmp 0x248fb
jmp 0x248b6
movq %rax, %rbx
jmp 0x24908
jmp 0x248c5
jmp 0x248c5
jmp 0x248c5
jmp 0x248c5
jmp 0x248c5
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x248df
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x43a0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x248fb
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x43a0
leaq 0x1a8(%rsp), %rdi
callq 0x1e9de
leaq 0xd0(%rsp), %rdi
callq 0x289da
leaq 0x100(%rsp), %rdi
callq 0x289da
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x24947
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x43a0
leaq 0x1d8(%rsp), %rdi
callq 0xbb32
movq %rbx, %rdi
callq 0x4700