// File: /workspace/github_cpp_makefile_star2_O2/fjamour[P]icentral/src/bcc_delta.cc
// Function: bcc_delta_t::i_iteration_2(unsigned int, unsigned int, unsigned int, int, int, std::tr1::unordered_map<unsigned int, double, std::tr1::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, double>>>&)
void bcc_delta_t::i_iteration_2(node_id_t s,
                        node_id_t src,
                        node_id_t dst,
                        int d_src,
                        int d_dst,
                        tr1_map_t(double)& bc_map)
{
        vector<vector<node_id_t> >&  P = bcc_fast_subgraph.P; 
        vector<int>&                 path_cnt_map = bcc_fast_subgraph.path_cnt_vec;
        vector<int>&                 path_cnt_inc_map = bcc_fast_subgraph.path_cnt_inc_vec;
        vector<int>&                 dist_map = bcc_fast_subgraph.dist_vec;
        vector<double>&              pair_dep_map = bcc_fast_subgraph.pair_dep_vec;
        vector<double>&              sigma_t_map = bcc_fast_subgraph.sigma_t_map;
        vector<bool>&                visited_vec = bcc_fast_subgraph.visited_vec;
        queue<node_id_t>&            Q = bcc_fast_subgraph.Q;
        vector<node_id_t>            S;
        
        bcc_fast_subgraph.init_maps();           

        path_cnt_map[s] = 1;
        dist_map[s] = 0;
        Q.push(s);
        while(!Q.empty()) {
            node_id_t v_i = Q.front(); Q.pop();
            S.push_back(v_i);
            for(int i = 0; i < bcc_fast_subgraph.nodes_vec[v_i].size(); ++i) {
                node_id_t v_n = bcc_fast_subgraph.nodes_vec[v_i][i];
                if(dist_map[v_n] < 0) {
                    Q.push(v_n);
                    dist_map[v_n] = dist_map[v_i] + 1;
                }
                if(dist_map[v_n] == dist_map[v_i] + 1) {
                    path_cnt_map[v_n] = path_cnt_map[v_n] + path_cnt_map[v_i];
                    P[v_n].push_back(v_i);
                }
            }
        }
        
        /*
         * steps:
         * 1. do the reverse BFS and subtract the olds
         * 2. compute the new counts
         * 3. fix the order of S
         * 4. add the new increments
         */
        //RBFS to subtract old pair dependency
        for(int i = S.size()-1; i >= 0; --i) {
            node_id_t v_n = S[i];
            if(   art_pt_map.find(s) != art_pt_map.end()
               && art_pt_map.find(v_n) != art_pt_map.end()
               ){//&& s != v_n) {
                int VG_s, VG_n;
                VG_s = accumulate(art_pt_map[s].begin(), art_pt_map[s].end(), 0);
                VG_n = accumulate(art_pt_map[v_n].begin(), art_pt_map[v_n].end(), 0);
                int c_t = VG_s*VG_n;
                sigma_t_map[v_n] =  sigma_t_map[v_n] + c_t;
                /*this guy must not change!*/
                //bc_map[v_n] = bc_map[v_n] - c_t;
            }
            for(int i = 0; i < P[v_n].size(); ++i) {
                node_id_t v_p = P[v_n][i];
                double sp_sn = ((double)path_cnt_map[v_p]/path_cnt_map[v_n]);
                pair_dep_map[v_p] = pair_dep_map[v_p] + sp_sn*(1+pair_dep_map[v_n]);
                if(art_pt_map.find(s) != art_pt_map.end()) {
                    sigma_t_map[v_p] = sigma_t_map[v_p] + sigma_t_map[v_n]*sp_sn;
                    
//                    node_id_t new_v_p = bcc_fast_subgraph.inout_label_map[v_p];
//                    bc_map[new_v_p] = bc_map[new_v_p] - sigma_t_map[v_n]*sp_sn/2.0;
                }
            }
            if(s != v_n) {
                node_id_t new_v_n = bcc_fast_subgraph.inout_label_map[v_n];
                bc_map[new_v_n] = bc_map[new_v_n] - pair_dep_map[v_n]/2.0;
            }
            if(art_pt_map.find(s) != art_pt_map.end()) {
                int VG_s = accumulate(art_pt_map[s].begin(), art_pt_map[s].end(), 0);
                
                node_id_t new_v_n = bcc_fast_subgraph.inout_label_map[v_n];
                bc_map[new_v_n] = bc_map[new_v_n] - pair_dep_map[v_n]*VG_s;
                
                bc_map[new_v_n] = bc_map[new_v_n] - sigma_t_map[v_n]/2.0;
            }
        }
                
        //Compute new path counts and paths
        if(dist_map[dst] != dist_map[src]+1) {
            P[dst].clear();
            P[dst].push_back(src);
            path_cnt_map[dst] = path_cnt_map[src];
        } else {
            P[dst].push_back(src);
            path_cnt_map[dst] += path_cnt_map[src];
        }
        
        
        Q.push(dst);
        dist_map[dst] = dist_map[src] + 1;
        //P[dst].clear();
        //P[dst].push_back(src);
        path_cnt_inc_map[dst] = path_cnt_map[src];
        //path_cnt_map[dst] = path_cnt_inc_map[dst];
        visited_vec[dst] = true;
        
        while (!Q.empty()) {
            node_id_t v = Q.front();
            Q.pop();
            vector<node_id_t> nbr_vec = bcc_fast_subgraph.get_nbrs(v);
            for (int nbr_idx = 0; nbr_idx < nbr_vec.size(); ++nbr_idx) {
                node_id_t w = nbr_vec[nbr_idx];
                if (dist_map[w] > (dist_map[v] + 1)) {
                    dist_map[w] = dist_map[v] + 1;
                    P[w].clear();
                    P[w].push_back(v);
                    path_cnt_map[w] = 0;
                    path_cnt_inc_map[w] = path_cnt_inc_map[v];
                    path_cnt_map[w] += path_cnt_inc_map[w];
                    if(!visited_vec[w]) {
                        visited_vec[w] = true;
                        Q.push(w);
                    }
                } else if (dist_map[w] == (dist_map[v] + 1)) {
                    path_cnt_inc_map[w] += path_cnt_inc_map[v];
                    path_cnt_map[w] += path_cnt_inc_map[v];
                    if(find(P[w].begin(), P[w].end(), v) == P[w].end()) {
                        P[w].push_back(v);
                    }
                    if(!visited_vec[w]) {
                        visited_vec[w] = true;
                        Q.push(w);
                    }
                }
            }
        }
        
    
        //fix order of S
        //IMP::THIS CAN BE MADE MUCH BETTER!
        //HEAP FOR EXAMPLE
        //EVEN THE SWAPPING CAN BE DONE MORE EFFICIENTLY
        //for now it's not a bottleneck
        for(int i = 1; i < S.size(); ++i) {
            if(dist_map[S[i-1]] > dist_map[S[i]]) {
                int j = i;
                while(dist_map[S[j-1]] > dist_map[S[j]]) {
                    node_id_t tmp = S[j-1];
                    S[j-1] = S[j];
                    S[j] = tmp;
                    --j;
                }
            }
        }

        //DBG
//        printf("===========================\nSource: %d\n", s);
//        for(tr1_map_t(int)::iterator it = path_cnt_map.begin();
//                it != path_cnt_map.end();
//                ++it) {
//            printf("cnt[%d]: %d           ", it->first, it->second);
//            printf("# parents: %d\n", P[it->first].size());
//        }
        /////        
        //DBG
//        printf("========================\nSource: %d\n", s);
//        for(int i = S.size()-1; i >= 0; --i) {
//            printf("%d\n", S[i]);
//        }
        //////
        

        //DBG print all:
//        printf("===========================\nSource: %d\n", s);
//        for(tr1_map_t(int)::iterator it = path_cnt_map.begin();
//                it != path_cnt_map.end();
//                ++it) {
//            printf("cnt[%d]: %d\n", it->first, it->second);
//            for(int i = 0; i < P[it->first].size(); ++i) {
//                printf("        P[%d][%d]: %d\n", it->first, i, P[it->first][i]);
//            }
//        }
//        printf("S:  ");
//        for(int i = S.size()-1; i >= 0; --i) {
//            printf("%d  ", S[i]);
//        }
//        printf("\n");
        ///////////
        

        //DBG
//        printf("===========================\nSource: %d\n", s);
//        for(tr1_map_t(double)::iterator it = pair_dep_map.begin();
//                it != pair_dep_map.end();
//                ++it) {
//            printf("pd[%d]: %f           ", it->first, it->second);
//            printf("# parents: %d\n", P[it->first].size());
//        }
        //////
        
        bcc_fast_subgraph.i_fill_map<double>(pair_dep_map, 0);
        bcc_fast_subgraph.i_fill_map<double>(sigma_t_map, 0);
        //RBFS to add the new pair dependencies
        for(int i = S.size()-1; i >= 0; --i) {
            node_id_t v_n = S[i];
            if(   art_pt_map.find(s) != art_pt_map.end()
               && art_pt_map.find(v_n) != art_pt_map.end()
               ){//&& s != v_n) {
                int VG_s, VG_n;
                VG_s = accumulate(art_pt_map[s].begin(), art_pt_map[s].end(), 0);
                VG_n = accumulate(art_pt_map[v_n].begin(), art_pt_map[v_n].end(), 0);
                int c_t = VG_s*VG_n;
                sigma_t_map[v_n] =  sigma_t_map[v_n] + c_t;
                /*this guy must not change!*/
                //bc_map[v_n] = bc_map[v_n] + c_t;
            }
            for(int i = 0; i < P[v_n].size(); ++i) {
                node_id_t v_p = P[v_n][i];
                double sp_sn = ((double)path_cnt_map[v_p]/path_cnt_map[v_n]);
                pair_dep_map[v_p] = pair_dep_map[v_p] + sp_sn*(1+pair_dep_map[v_n]);
                if(art_pt_map.find(s) != art_pt_map.end()) {
                    sigma_t_map[v_p] = sigma_t_map[v_p] + sigma_t_map[v_n]*sp_sn;
                    
//                    node_id_t new_v_p = bcc_fast_subgraph.inout_label_map[v_p];
//                    bc_map[new_v_p] = bc_map[new_v_p] + sigma_t_map[v_n]*sp_sn/2.0;
                }
            }
            if(s != v_n) {
                node_id_t new_v_n = bcc_fast_subgraph.inout_label_map[v_n];
                bc_map[new_v_n] = bc_map[new_v_n] + pair_dep_map[v_n]/2.0;
            }
            if(art_pt_map.find(s) != art_pt_map.end()) {
                int VG_s = accumulate(art_pt_map[s].begin(), art_pt_map[s].end(), 0);
                
                node_id_t new_v_n = bcc_fast_subgraph.inout_label_map[v_n];
                bc_map[new_v_n] = bc_map[new_v_n] + pair_dep_map[v_n]*VG_s;
                
                bc_map[new_v_n] = bc_map[new_v_n] + sigma_t_map[v_n]/2.0;
            }
        }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movl %esi, 0x2c(%rsp)
movl %edx, 0x1c(%rsp)
movl %ecx, 0x18(%rsp)
leaq 0x2d8(%rdi), %r13
xorpd %xmm0, %xmm0
movapd %xmm0, 0x60(%rsp)
andq $0x0, 0x70(%rsp)
movq %r13, %rdi
callq 0x25fea
leaq 0x480(%rbx), %rdi
movl %ebp, %eax
movq 0x380(%rbx), %rcx
movl $0x1, (%rcx,%rax,4)
leaq 0x2c(%rsp), %rsi
movl (%rsi), %eax
movq 0x3b0(%rbx), %rcx
andl $0x0, (%rcx,%rax,4)
movq %rdi, 0x20(%rsp)
callq 0x62da
leaq 0x3c8(%rbx), %rax
movq %rax, 0x58(%rsp)
leaq 0x410(%rbx), %rax
movq %rax, 0x48(%rsp)
leaq 0x440(%rbx), %r15
leaq 0x30(%rsp), %r14
leaq 0x8(%rsp), %rbp
movq 0x490(%rbx), %rax
cmpq %rax, 0x4b0(%rbx)
je 0xdb42
movl (%rax), %eax
movl %eax, 0x30(%rsp)
movq 0x20(%rsp), %rdi
callq 0x650e
leaq 0x60(%rsp), %rdi
movq %r14, %rsi
callq 0x478c
xorl %r12d, %r12d
movl 0x30(%rsp), %eax
movq (%r13), %rdx
imulq $0x18, %rax, %rsi
movq (%rdx,%rsi), %rcx
movq 0x8(%rdx,%rsi), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %r12, %rdx
jbe 0xda73
movl (%rcx,%r12,4), %ecx
movl %ecx, 0x8(%rsp)
movq 0x3b0(%rbx), %rdx
movl (%rdx,%rcx,4), %esi
testl %esi, %esi
jns 0xdb0d
movq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x62da
movl 0x30(%rsp), %eax
movq 0x3b0(%rbx), %rdx
movl (%rdx,%rax,4), %eax
incl %eax
movl 0x8(%rsp), %ecx
movl %eax, (%rdx,%rcx,4)
movl 0x8(%rsp), %ecx
movl (%rdx,%rcx,4), %esi
movl 0x30(%rsp), %eax
movl (%rdx,%rax,4), %edx
incl %edx
cmpl %edx, %esi
jne 0xdb3a
movq 0x380(%rbx), %rdx
movl (%rdx,%rax,4), %eax
addl %eax, (%rdx,%rcx,4)
movl 0x8(%rsp), %eax
imulq $0x18, %rax, %rdi
addq 0x368(%rbx), %rdi
movq %r14, %rsi
callq 0x478c
incq %r12
jmp 0xdaa7
movq 0x68(%rsp), %rax
subq 0x60(%rsp), %rax
shrq $0x2, %rax
movl %eax, %eax
movq %rax, 0x80(%rsp)
leaq 0x2c(%rsp), %r14
movq 0xc0(%rsp), %rbp
movq 0x80(%rsp), %rax
decq %rax
testl %eax, %eax
js 0xde91
movq %rax, 0x80(%rsp)
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq 0x60(%rsp), %rcx
movl (%rcx,%rax,4), %eax
movl %eax, 0x30(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4a5c
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rdx
cmpq (%rcx,%rdx,8), %rax
je 0xdc55
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0x4a5c
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rdx
cmpq (%rcx,%rdx,8), %rax
je 0xdc55
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4aaa
movq (%rax), %rbp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4aaa
movq 0x8(%rax), %rax
xorl %r12d, %r12d
cmpq %rax, %rbp
je 0xdbfe
addl (%rbp), %r12d
addq $0x4, %rbp
jmp 0xdbef
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0x4aaa
movq (%rax), %rbp
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0x4aaa
movq 0x8(%rax), %rcx
xorl %eax, %eax
cmpq %rcx, %rbp
je 0xdc2f
addl (%rbp), %eax
addq $0x4, %rbp
jmp 0xdc21
imull %r12d, %eax
movl 0x30(%rsp), %ecx
cvtsi2sd %eax, %xmm0
movq 0x48(%rsp), %rax
movq (%rax), %rax
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq 0xc0(%rsp), %rbp
xorl %r12d, %r12d
movl 0x30(%rsp), %eax
movq 0x368(%rbx), %rdx
imulq $0x18, %rax, %rsi
movq (%rdx,%rsi), %rcx
movq 0x8(%rdx,%rsi), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %r12, %rdx
jbe 0xdd0b
movl (%rcx,%r12,4), %ebp
movq 0x380(%rbx), %rcx
cvtsi2sdl (%rcx,%rbp,4), %xmm1
cvtsi2sdl (%rcx,%rax,4), %xmm0
movq 0x3c8(%rbx), %rcx
divsd %xmm0, %xmm1
movsd (%rcx,%rax,8), %xmm0
addsd 0x1a393(%rip), %xmm0    # 0x28040
movsd %xmm1, 0x10(%rsp)
mulsd %xmm1, %xmm0
addsd (%rcx,%rbp,8), %xmm0
movsd %xmm0, (%rcx,%rbp,8)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4a5c
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rdx
cmpq (%rcx,%rdx,8), %rax
je 0xdcfb
movq 0x48(%rsp), %rax
movq (%rax), %rax
movl 0x30(%rsp), %ecx
movsd 0x10(%rsp), %xmm0
mulsd (%rax,%rcx,8), %xmm0
addsd (%rax,%rbp,8), %xmm0
movsd %xmm0, (%rax,%rbp,8)
incq %r12
movq 0xc0(%rsp), %rbp
jmp 0xdc58
cmpl %eax, 0x2c(%rsp)
je 0xdd77
movq 0x320(%rbx), %rcx
movl (%rcx,%rax,4), %eax
movl %eax, 0x8(%rsp)
movq %rbp, %rdi
leaq 0x8(%rsp), %r12
movq %r12, %rsi
callq 0xb00c
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0x30(%rsp), %eax
movq 0x58(%rsp), %rcx
movq (%rcx), %rcx
movsd (%rcx,%rax,8), %xmm0
movsd %xmm0, 0x50(%rsp)
movq %rbp, %rdi
movq %r12, %rsi
callq 0xb00c
movsd 0x50(%rsp), %xmm1
mulsd 0x1a2cf(%rip), %xmm1    # 0x28038
movsd 0x10(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4a5c
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rdx
cmpq (%rcx,%rdx,8), %rax
je 0xdb67
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4aaa
movq (%rax), %rbp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4aaa
movq 0x8(%rax), %rax
xorl %r12d, %r12d
cmpq %rax, %rbp
je 0xddc3
addl (%rbp), %r12d
addq $0x4, %rbp
jmp 0xddb4
movl 0x30(%rsp), %eax
movq 0x320(%rbx), %rcx
movl (%rcx,%rax,4), %eax
movl %eax, 0x8(%rsp)
movq 0xc0(%rsp), %rbp
movq %rbp, %rdi
leaq 0x8(%rsp), %rsi
callq 0xb00c
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0x30(%rsp), %eax
movq 0x58(%rsp), %rcx
movq (%rcx), %rcx
movsd (%rcx,%rax,8), %xmm0
movsd %xmm0, 0x50(%rsp)
movq %rbp, %rdi
leaq 0x8(%rsp), %rsi
callq 0xb00c
cvtsi2sd %r12d, %xmm0
movsd 0x50(%rsp), %xmm1
mulsd %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, (%rax)
movq %rbp, %rdi
leaq 0x8(%rsp), %rsi
callq 0xb00c
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0x30(%rsp), %eax
movq 0x48(%rsp), %rcx
movq (%rcx), %rcx
movsd (%rcx,%rax,8), %xmm0
movsd %xmm0, 0x50(%rsp)
movq %rbp, %rdi
leaq 0x8(%rsp), %rsi
callq 0xb00c
movsd 0x50(%rsp), %xmm1
mulsd 0x1a1ba(%rip), %xmm1    # 0x28038
movsd 0x10(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax)
jmp 0xdb67
movl 0x18(%rsp), %eax
movq 0x3b0(%rbx), %rcx
movl 0x1c(%rsp), %edx
movl (%rcx,%rdx,4), %edx
incl %edx
imulq $0x18, %rax, %rdi
addq 0x368(%rbx), %rdi
cmpl %edx, (%rcx,%rax,4)
jne 0xded6
leaq 0x1c(%rsp), %rsi
callq 0x478c
movl 0x1c(%rsp), %eax
movq 0x380(%rbx), %rcx
movl (%rcx,%rax,4), %eax
movl 0x18(%rsp), %edx
addl %eax, (%rcx,%rdx,4)
jmp 0xdf02
movq (%rdi), %rax
cmpq %rax, 0x8(%rdi)
je 0xdee3
movq %rax, 0x8(%rdi)
leaq 0x1c(%rsp), %rsi
callq 0x478c
movl 0x1c(%rsp), %eax
movq 0x380(%rbx), %rcx
movl (%rcx,%rax,4), %eax
movl 0x18(%rsp), %edx
movl %eax, (%rcx,%rdx,4)
leaq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdi
callq 0x62da
movl 0x1c(%rsp), %eax
movq 0x3b0(%rbx), %rcx
movl (%rcx,%rax,4), %eax
incl %eax
movl 0x18(%rsp), %edx
movl %eax, (%rcx,%rdx,4)
movl 0x1c(%rsp), %eax
movq 0x380(%rbx), %rcx
movq 0x3f8(%rbx), %rdx
movl (%rcx,%rax,4), %eax
movl 0x18(%rsp), %ecx
movl %eax, (%rdx,%rcx,4)
movl 0x18(%rsp), %esi
movq %r15, %rdi
callq 0x4b82
orq %rdx, (%rax)
leaq 0x30(%rsp), %r12
leaq 0x8(%rsp), %r14
movq 0x490(%rbx), %rax
cmpq %rax, 0x4b0(%rbx)
je 0xe102
movl (%rax), %eax
movl %eax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
callq 0x650e
movl 0x8(%rsp), %esi
movq %r13, %rdi
callq 0x25fe0
movq %r12, %rdi
movq %rax, %rsi
callq 0x4ba0
xorl %ebp, %ebp
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rbp, %rcx
jbe 0xe0f5
movl (%rax,%rbp,4), %eax
movl %eax, 0xc(%rsp)
movq 0x3b0(%rbx), %rdx
movl 0x8(%rsp), %ecx
movl (%rdx,%rcx,4), %esi
incl %esi
cmpl %esi, (%rdx,%rax,4)
jle 0xe055
movl %esi, (%rdx,%rax,4)
movl 0xc(%rsp), %eax
movq 0x368(%rbx), %rcx
imulq $0x18, %rax, %rdx
leaq (%rcx,%rdx), %rdi
movq (%rcx,%rdx), %rax
cmpq %rax, 0x8(%rcx,%rdx)
je 0xdff9
movq %rax, 0x8(%rdi)
movq %r14, %rsi
callq 0x478c
movl 0xc(%rsp), %eax
movq 0x380(%rbx), %rcx
andl $0x0, (%rcx,%rax,4)
movl 0x8(%rsp), %eax
movq 0x3f8(%rbx), %rdx
movl (%rdx,%rax,4), %eax
movl 0xc(%rsp), %esi
movl %eax, (%rdx,%rsi,4)
movl 0xc(%rsp), %eax
movl (%rdx,%rax,4), %edx
addl %edx, (%rcx,%rax,4)
movl 0xc(%rsp), %esi
movq %r15, %rdi
callq 0x4b82
testq %rdx, (%rax)
jne 0xe0ed
movl 0xc(%rsp), %esi
movq %r15, %rdi
callq 0x4b82
jmp 0xe0db
jne 0xe0ed
movq 0x3f8(%rbx), %rdx
movl (%rdx,%rcx,4), %ecx
addl %ecx, (%rdx,%rax,4)
movl 0x8(%rsp), %eax
movl (%rdx,%rax,4), %eax
movl 0xc(%rsp), %ecx
movq 0x380(%rbx), %rdx
addl %eax, (%rdx,%rcx,4)
movl 0xc(%rsp), %eax
movq 0x368(%rbx), %rcx
imulq $0x18, %rax, %rax
movq (%rcx,%rax), %rdi
movq 0x8(%rcx,%rax), %rsi
movq %r14, %rdx
callq 0x688c
movl 0xc(%rsp), %esi
movq 0x368(%rbx), %rdi
imulq $0x18, %rsi, %rcx
cmpq 0x8(%rdi,%rcx), %rax
jne 0xe0c2
addq %rcx, %rdi
movq %r14, %rsi
callq 0x478c
movl 0xc(%rsp), %esi
movq %r15, %rdi
callq 0x4b82
testq %rdx, (%rax)
jne 0xe0ed
movl 0xc(%rsp), %esi
movq %r15, %rdi
callq 0x4b82
orq %rdx, (%rax)
movq 0x20(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x62da
incq %rbp
jmp 0xdf9a
movq %r12, %rdi
callq 0x56ec
jmp 0xdf5d
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
movq 0x3b0(%rbx), %rdx
pushq $0x1
popq %rsi
movq %rax, %rdi
cmpq %rsi, %rcx
jbe 0xe15e
movl -0x4(%rax,%rsi,4), %r9d
movl (%rax,%rsi,4), %r8d
movl (%rdx,%r8,4), %r10d
cmpl %r10d, (%rdx,%r9,4)
jle 0xe155
movq %rdi, %r9
movl (%r9), %r11d
cmpl %r10d, (%rdx,%r11,4)
jle 0xe155
movl %r8d, (%r9)
movl %r11d, 0x4(%r9)
movl (%rdx,%r8,4), %r10d
addq $-0x4, %r9
jmp 0xe13b
incq %rsi
addq $0x4, %rdi
jmp 0xe120
xorpd %xmm0, %xmm0
movq %r13, %rdi
movq 0x58(%rsp), %rsi
callq 0x269c2
xorpd %xmm0, %xmm0
movq %r13, %rdi
movq 0x48(%rsp), %rsi
callq 0x269c2
movq 0x68(%rsp), %rax
subq 0x60(%rsp), %rax
shrq $0x2, %rax
movl %eax, %ebp
leaq 0x2c(%rsp), %r14
leaq 0x8(%rsp), %r15
decq %rbp
testl %ebp, %ebp
js 0xe49f
movl %ebp, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq 0x60(%rsp), %rcx
movl (%rcx,%rax,4), %eax
movl %eax, 0x30(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4a5c
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rdx
cmpq (%rcx,%rdx,8), %rax
je 0xe26f
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0x4a5c
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rdx
cmpq (%rcx,%rdx,8), %rax
je 0xe26f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4aaa
movq (%rax), %r13
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4aaa
movq 0x8(%rax), %rax
xorl %r12d, %r12d
cmpq %rax, %r13
je 0xe21f
addl (%r13), %r12d
addq $0x4, %r13
jmp 0xe210
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0x4aaa
movq (%rax), %r13
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0x4aaa
movq 0x8(%rax), %rcx
xorl %eax, %eax
cmpq %rcx, %r13
je 0xe251
addl (%r13), %eax
addq $0x4, %r13
jmp 0xe242
imull %r12d, %eax
movl 0x30(%rsp), %ecx
cvtsi2sd %eax, %xmm0
movq 0x48(%rsp), %rax
movq (%rax), %rax
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
xorl %r12d, %r12d
movl 0x30(%rsp), %eax
movq 0x368(%rbx), %rdx
imulq $0x18, %rax, %rsi
movq (%rdx,%rsi), %rcx
movq 0x8(%rdx,%rsi), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %r12, %rdx
jbe 0xe322
movl (%rcx,%r12,4), %r13d
movq 0x380(%rbx), %rcx
cvtsi2sdl (%rcx,%r13,4), %xmm1
cvtsi2sdl (%rcx,%rax,4), %xmm0
movq 0x3c8(%rbx), %rcx
divsd %xmm0, %xmm1
movsd (%rcx,%rax,8), %xmm0
addsd 0x19d78(%rip), %xmm0    # 0x28040
movsd %xmm1, 0x10(%rsp)
mulsd %xmm1, %xmm0
addsd (%rcx,%r13,8), %xmm0
movsd %xmm0, (%rcx,%r13,8)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4a5c
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rdx
cmpq (%rcx,%rdx,8), %rax
je 0xe31a
movq 0x48(%rsp), %rax
movq (%rax), %rax
movl 0x30(%rsp), %ecx
movsd 0x10(%rsp), %xmm0
mulsd (%rax,%rcx,8), %xmm0
addsd (%rax,%r13,8), %xmm0
movsd %xmm0, (%rax,%r13,8)
incq %r12
jmp 0xe272
cmpl %eax, 0x2c(%rsp)
je 0xe391
movq 0x320(%rbx), %rcx
movl (%rcx,%rax,4), %eax
movl %eax, 0x8(%rsp)
movq 0xc0(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0xb00c
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0x30(%rsp), %eax
movq 0x58(%rsp), %rcx
movq (%rcx), %rcx
movsd (%rcx,%rax,8), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0xb00c
movsd 0x20(%rsp), %xmm1
mulsd 0x19cad(%rip), %xmm1    # 0x28030
movsd 0x10(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4a5c
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rdx
cmpq (%rcx,%rdx,8), %rax
je 0xe19a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4aaa
movq (%rax), %r13
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4aaa
movq 0x8(%rax), %rax
xorl %r12d, %r12d
cmpq %rax, %r13
je 0xe3dd
addl (%r13), %r12d
addq $0x4, %r13
jmp 0xe3ce
movl 0x30(%rsp), %eax
movq 0x320(%rbx), %rcx
movl (%rcx,%rax,4), %eax
movl %eax, 0x8(%rsp)
movq 0xc0(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0xb00c
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0x30(%rsp), %eax
movq 0x58(%rsp), %rcx
movq (%rcx), %rcx
movsd (%rcx,%rax,8), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %r13, %rdi
movq %r15, %rsi
callq 0xb00c
cvtsi2sd %r12d, %xmm0
movsd 0x20(%rsp), %xmm1
mulsd %xmm0, %xmm1
addsd 0x10(%rsp), %xmm1
movsd %xmm1, (%rax)
movq %r13, %rdi
movq %r15, %rsi
callq 0xb00c
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0x30(%rsp), %eax
movq 0x48(%rsp), %rcx
movq (%rcx), %rcx
movsd (%rcx,%rax,8), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %r13, %rdi
movq %r15, %rsi
callq 0xb00c
movsd 0x20(%rsp), %xmm1
mulsd 0x19ba4(%rip), %xmm1    # 0x28030
movsd 0x10(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax)
jmp 0xe19a
leaq 0x60(%rsp), %rdi
callq 0x56ec
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xe4fc
jmp 0xe4fc
jmp 0xe4fc
jmp 0xe4fc
jmp 0xe4fc
jmp 0xe4fc
jmp 0xe4fc
jmp 0xe4fc
jmp 0xe4fc
jmp 0xe4fc
jmp 0xe4fc
jmp 0xe4fc
jmp 0xe4fc
jmp 0xe4fc
jmp 0xe4fc
jmp 0xe4fc
jmp 0xe4fc
jmp 0xe4fc
jmp 0xe4e9
jmp 0xe4e9
jmp 0xe4e9
jmp 0xe4e9
jmp 0xe4e9
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x56ec
jmp 0xe4ff
jmp 0xe4fc
jmp 0xe4fc
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x56ec
movq %rbx, %rdi
callq 0x23d0
nop