// File: fjamour[P]icentral/src/experiments.cc
// Function: insertion_test_qube_hash(graph_t&, int, std::vector<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>, bool, int)
void insertion_test_qube_hash(graph_t& graph,
        int num_edges_to_insert,
        vector<edge_t> rand_edge_vec,
        bool use_incremental_algo,
        int max_iter)
{
    //1. prepare structures to store the results for each edge 
    //2. generate random edges
    //3. run Brandes and find time
    //4. run update after each edge insertion and record results
    //5. print the results progressively
    //int num_edges_to_insert = 2;
    
    printf("==========================================================\n");
    printf("Graph: \t\t\t%s\n", graph.graph_name.c_str());
    printf("Graph # nodes: \t\t%d\n", graph.size());
    printf("Graph # edges: \t\t%d\n", graph.edge_set.size());
    graph_hash_t g;
    g.fill_graph(graph);
    
    double brandes_time, muc_find_time;
    timer tm;
    
    printf("Brandes runtime: \t");
    tr1_map_t(double) bc_vec;
    tm.start();
    bc_vec = brandes_bc_hash_out(graph, max_iter);
    tm.stop();
    if(max_iter == -1)
        brandes_time = tm.interval();
    else
        brandes_time = (tm.interval()/max_iter)*graph.size();
    printf("%f\n", brandes_time);
    printf("Brandes avg iter time: \t%f\n", brandes_time/graph.size());
    
    printf("# MUCs: \t\t");
    tm.start();
    graph.find_mucs();
    tm.stop();
    muc_find_time = tm.interval();
    printf("%d\n", graph.get_num_mucs());
    printf("Time to find MUCs: \t%f\n", muc_find_time);
    
    //vector<edge_t> rand_edge_vec;
    if(rand_edge_vec.size() == 0) {
        printf("Generating edges...\n");
        gen_rand_edges(num_edges_to_insert, graph, rand_edge_vec);
    }
    vector<edge_stat_t> edge_stat_vec;
    
    double tot_speedup = 0;
    double tot_ideal_speedup = 0;
    
    vector<double> speedup_vec;
    for(int i = 0; i < rand_edge_vec.size(); ++i) {
        edge_t rand_edge = rand_edge_vec[i];
        edge_stat_t edge_stat;
        printf("Adding edge (%d, %d)\n", rand_edge.first, rand_edge.second);
        tm.start();
        graph.insert_edge_update_muc(rand_edge.first, rand_edge.second);
        tm.stop();
        edge_stat.edge_ins_time = tm.interval();

        muc_id_t muc_id = graph.node_to_muc_vec[rand_edge.first];
        edge_stat.muc_num_edges = graph.muc_vec[muc_id].muc_subgraph.edge_set.size();
        edge_stat.muc_num_nodes = graph.muc_vec[muc_id].muc_subgraph.nodes_map.size();
        tr1::unordered_map<node_id_t, double> bc_map;
        tm.start();
        if(!use_incremental_algo) {
            graph.muc_vec[muc_id].compute_bc(bc_map, max_iter);
        } else {
            graph.muc_vec[muc_id].compute_bc_inc(bc_map, rand_edge.first, rand_edge.second);
        }
        tm.stop();
        if(max_iter == -1)
            edge_stat.muc_bc_update_time = tm.interval();
        else
            edge_stat.muc_bc_update_time = (tm.interval()/max_iter)*edge_stat.muc_num_nodes;
        //TMP CODE XXX FIX THIS SHIT
        edge_stat.muc_bc_update_time += edge_stat.edge_ins_time;
        ////
        
        double speedup = brandes_time/edge_stat.muc_bc_update_time;
        tot_speedup += speedup;
        speedup_vec.push_back(speedup);
        //estimating ideal speedup using the node and edge proportions
        double ideal_speedup;
        double V  = graph.size(); double E = graph.edge_set.size();
        double Vm = edge_stat.muc_num_nodes; double Em = edge_stat.muc_num_edges;
        ideal_speedup = ((V+E)/(Vm+Em))*(V/Vm);
        tot_ideal_speedup += ideal_speedup;
        ////
        
        printf("\tMUC # nodes: \t\t%d (%f G_n)\n",
                edge_stat.muc_num_nodes,
                edge_stat.muc_num_nodes/(double)graph.size());
        printf("\tMUC # edges: \t\t%d (%f G_M)\n",
                edge_stat.muc_num_edges,
                edge_stat.muc_num_edges/(double)graph.edge_set.size());
        printf("\n");
        printf("\tTime to update BC: \t%f\n", edge_stat.muc_bc_update_time);
        printf("\tSpeedup: \t\t%f (Ideal: %f)\n", speedup, ideal_speedup);
        printf("\n");
        printf("\tQUBE avg iter time: \t%f\n",
                edge_stat.muc_bc_update_time/edge_stat.muc_num_nodes);
        printf("\tTime to update MUCs: \t%f\n", edge_stat.edge_ins_time);

        edge_stat_vec.push_back(edge_stat);
    }
    
    double avg_speedup = tot_speedup/num_edges_to_insert;
    double avg_ideal_speedup = tot_ideal_speedup/num_edges_to_insert;
    printf("[[Average speedup: %f (Ideal: %f)]]\n",
        avg_speedup,
        avg_ideal_speedup);
    
    //calculating 95% confidence interval
    double s_mean, s_median, s_stddev, s_min, s_max;
    simple_stats(speedup_vec, s_mean, s_stddev, s_median, s_min, s_max);
    double diff = 1.96*s_stddev/sqrt(num_edges_to_insert);
    double v1 = s_mean - diff;
    double v2 = s_mean + diff;
    printf("[[Speedup 95 CI: %f - %f]]\n", v1, v2);
}

// Assembly:
subq $0x5a8, %rsp            # imm = 0x5A8
movq %rdx, 0xe0(%rsp)
movb %cl, %al
movq %rdi, 0x5a0(%rsp)
movl %esi, 0x59c(%rsp)
movq %rdx, 0x590(%rsp)
andb $0x1, %al
movb %al, 0x58f(%rsp)
movl %r8d, 0x588(%rsp)
leaq 0x32e20(%rip), %rdi     # 0x7b2e0
xorl %eax, %eax
movb %al, 0xef(%rsp)
callq 0x9040
movq 0x5a0(%rsp), %rdi
addq $0x108, %rdi            # imm = 0x108
callq 0x9250
movq %rax, %rsi
movb 0xef(%rsp), %al
leaq 0x32e29(%rip), %rdi     # 0x7b31c
callq 0x9040
movq 0x5a0(%rsp), %rdi
callq 0x56b40
movq %rax, %rsi
movb 0xef(%rsp), %al
leaq 0x32e14(%rip), %rdi     # 0x7b32a
callq 0x9040
movq 0x5a0(%rsp), %rdi
addq $0x30, %rdi
callq 0x4dbe0
movq %rax, %rsi
movb 0xef(%rsp), %al
leaq 0x32e02(%rip), %rdi     # 0x7b33f
callq 0x9040
leaq 0x2e0(%rsp), %rdi
movq %rdi, 0xf0(%rsp)
callq 0x41780
movq 0xf0(%rsp), %rdi
movq 0x5a0(%rsp), %rsi
callq 0x53670
jmp 0x4856e
leaq 0x32ddf(%rip), %rdi     # 0x7b354
xorl %eax, %eax
callq 0x9040
jmp 0x4857e
leaq 0x26d(%rsp), %rdi
movq %rdi, 0xd8(%rsp)
callq 0x2d1e0
movq 0xd8(%rsp), %r8
leaq 0x270(%rsp), %rdi
movl $0xa, %esi
leaq 0x26f(%rsp), %rdx
leaq 0x26e(%rsp), %rcx
callq 0x2d1f0
jmp 0x485bf
leaq 0x26d(%rsp), %rdi
callq 0x2d230
leaq 0x2a0(%rsp), %rdi
callq 0x2d430
jmp 0x485db
movq 0x5a0(%rsp), %rsi
movl 0x588(%rsp), %edx
leaq 0x238(%rsp), %rdi
callq 0x29120
jmp 0x485f9
leaq 0x270(%rsp), %rdi
leaq 0x238(%rsp), %rsi
callq 0x4ddf0
jmp 0x48610
leaq 0x238(%rsp), %rdi
callq 0x2d420
leaq 0x2a0(%rsp), %rdi
callq 0x2d450
jmp 0x4862c
cmpl $-0x1, 0x588(%rsp)
jne 0x486e7
leaq 0x2a0(%rsp), %rdi
callq 0x2d470
movsd %xmm0, 0xd0(%rsp)
jmp 0x48652
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, 0x2c8(%rsp)
jmp 0x4877a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2d8(%rsp)
movl %eax, 0x2d4(%rsp)
jmp 0x49182
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2d8(%rsp)
movl %eax, 0x2d4(%rsp)
leaq 0x26d(%rsp), %rdi
callq 0x2d230
jmp 0x49182
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2d8(%rsp)
movl %eax, 0x2d4(%rsp)
jmp 0x49175
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2d8(%rsp)
movl %eax, 0x2d4(%rsp)
leaq 0x238(%rsp), %rdi
callq 0x2d420
jmp 0x49175
leaq 0x2a0(%rsp), %rdi
callq 0x2d470
movsd %xmm0, 0xc8(%rsp)
jmp 0x486ff
movsd 0xc8(%rsp), %xmm0
cvtsi2sdl 0x588(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0xb8(%rsp)
movq 0x5a0(%rsp), %rdi
callq 0x56b40
movq %rax, 0xc0(%rsp)
jmp 0x48735
movsd 0xb8(%rsp), %xmm0
movq 0xc0(%rsp), %rax
movq %rax, %xmm1
movaps 0x32b5e(%rip), %xmm2    # 0x7b2b0
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x32b62(%rip), %xmm2    # 0x7b2c0
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x2c8(%rsp)
movsd 0x2c8(%rsp), %xmm0
leaq 0x32dc6(%rip), %rdi     # 0x7b550
movb $0x1, %al
callq 0x9040
jmp 0x48793
movsd 0x2c8(%rsp), %xmm0
movsd %xmm0, 0xa8(%rsp)
movq 0x5a0(%rsp), %rdi
callq 0x56b40
movq %rax, 0xb0(%rsp)
jmp 0x487bc
movsd 0xa8(%rsp), %xmm0
movq 0xb0(%rsp), %rax
movq %rax, %xmm1
movaps 0x32ad7(%rip), %xmm2    # 0x7b2b0
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x32adb(%rip), %xmm2    # 0x7b2c0
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
leaq 0x32c3b(%rip), %rdi     # 0x7b43a
movb $0x1, %al
callq 0x9040
jmp 0x48808
leaq 0x32b58(%rip), %rdi     # 0x7b367
xorl %eax, %eax
callq 0x9040
jmp 0x48818
leaq 0x2a0(%rsp), %rdi
callq 0x2d430
jmp 0x48827
movq 0x5a0(%rsp), %rdi
callq 0x68030
jmp 0x48836
leaq 0x2a0(%rsp), %rdi
callq 0x2d450
jmp 0x48845
leaq 0x2a0(%rsp), %rdi
callq 0x2d470
movsd %xmm0, 0xa0(%rsp)
jmp 0x4885d
movsd 0xa0(%rsp), %xmm0
movsd %xmm0, 0x2c0(%rsp)
movq 0x5a0(%rsp), %rdi
callq 0x68af0
movq %rax, 0x98(%rsp)
jmp 0x48886
movq 0x98(%rsp), %rsi
leaq 0x32b74(%rip), %rdi     # 0x7b409
xorl %eax, %eax
callq 0x9040
jmp 0x4889e
movsd 0x2c0(%rsp), %xmm0
leaq 0x32ac4(%rip), %rdi     # 0x7b372
movb $0x1, %al
callq 0x9040
jmp 0x488b7
movq 0xe0(%rsp), %rdi
callq 0x47680
cmpq $0x0, %rax
jne 0x488fa
leaq 0x32b85(%rip), %rdi     # 0x7b456
xorl %eax, %eax
callq 0x9040
jmp 0x488da
movq 0xe0(%rsp), %rdx
movl 0x59c(%rsp), %edi
movq 0x5a0(%rsp), %rsi
callq 0x47910
jmp 0x488f8
jmp 0x488fa
leaq 0x220(%rsp), %rdi
callq 0x4dca0
xorps %xmm0, %xmm0
movsd %xmm0, 0x218(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x210(%rsp)
leaq 0x1f8(%rsp), %rdi
callq 0xfa00
movl $0x0, 0x1f4(%rsp)
movq 0xe0(%rsp), %rdi
movslq 0x1f4(%rsp), %rax
movq %rax, 0x90(%rsp)
callq 0x47680
movq %rax, %rcx
movq 0x90(%rsp), %rax
cmpq %rcx, %rax
jae 0x48f9d
movq 0xe0(%rsp), %rdi
movslq 0x1f4(%rsp), %rsi
callq 0x4dbc0
movq (%rax), %rax
movq %rax, 0x1e8(%rsp)
movl 0x1e8(%rsp), %esi
movl 0x1ec(%rsp), %edx
leaq 0x32a02(%rip), %rdi     # 0x7b39f
xorl %eax, %eax
callq 0x9040
jmp 0x489a6
leaq 0x2a0(%rsp), %rdi
callq 0x2d430
jmp 0x489b5
movq 0x5a0(%rsp), %rdi
movl 0x1e8(%rsp), %esi
movl 0x1ec(%rsp), %edx
callq 0x68820
jmp 0x489d2
leaq 0x2a0(%rsp), %rdi
callq 0x2d450
jmp 0x489e1
leaq 0x2a0(%rsp), %rdi
callq 0x2d470
movsd %xmm0, 0x88(%rsp)
jmp 0x489f9
movsd 0x88(%rsp), %xmm0
movsd %xmm0, 0x1d0(%rsp)
movq 0x5a0(%rsp), %rdi
addq $0x18, %rdi
movl 0x1e8(%rsp), %eax
movl %eax, %esi
callq 0xfbc0
movl (%rax), %eax
movl %eax, 0x1cc(%rsp)
movq 0x5a0(%rsp), %rdi
addq $0x60, %rdi
movl 0x1cc(%rsp), %eax
movl %eax, %esi
callq 0x4dcb0
movq %rax, %rdi
addq $0x90, %rdi
callq 0x4dbe0
movl %eax, 0x1e4(%rsp)
movq 0x5a0(%rsp), %rdi
addq $0x60, %rdi
movl 0x1cc(%rsp), %eax
movl %eax, %esi
callq 0x4dcb0
movq %rax, %rdi
addq $0x60, %rdi
callq 0x4dcd0
movq %rax, 0x80(%rsp)
jmp 0x48a8e
movq 0x80(%rsp), %rax
movl %eax, 0x1e0(%rsp)
leaq 0x195(%rsp), %rdi
movq %rdi, 0x78(%rsp)
callq 0x2d1e0
movq 0x78(%rsp), %r8
leaq 0x198(%rsp), %rdi
movl $0xa, %esi
leaq 0x197(%rsp), %rdx
leaq 0x196(%rsp), %rcx
callq 0x2d1f0
jmp 0x48ad8
leaq 0x195(%rsp), %rdi
callq 0x2d230
leaq 0x2a0(%rsp), %rdi
callq 0x2d430
jmp 0x48af4
testb $0x1, 0x58f(%rsp)
jne 0x48b9f
movq 0x5a0(%rsp), %rdi
addq $0x60, %rdi
movl 0x1cc(%rsp), %eax
movl %eax, %esi
callq 0x4dcb0
movq %rax, %rdi
movl 0x588(%rsp), %edx
leaq 0x198(%rsp), %rsi
callq 0x68b80
jmp 0x48b35
jmp 0x48be1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2d8(%rsp)
movl %eax, 0x2d4(%rsp)
jmp 0x4915b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2d8(%rsp)
movl %eax, 0x2d4(%rsp)
leaq 0x195(%rsp), %rdi
callq 0x2d230
jmp 0x4915b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2d8(%rsp)
movl %eax, 0x2d4(%rsp)
leaq 0x198(%rsp), %rdi
callq 0x2d420
jmp 0x4915b
movq 0x5a0(%rsp), %rdi
addq $0x60, %rdi
movl 0x1cc(%rsp), %eax
movl %eax, %esi
callq 0x4dcb0
movq %rax, %rdi
movl 0x1e8(%rsp), %edx
movl 0x1ec(%rsp), %ecx
leaq 0x198(%rsp), %rsi
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x6a350
jmp 0x48bdf
jmp 0x48be1
leaq 0x2a0(%rsp), %rdi
callq 0x2d450
jmp 0x48bf0
cmpl $-0x1, 0x588(%rsp)
jne 0x48c20
leaq 0x2a0(%rsp), %rdi
callq 0x2d470
movsd %xmm0, 0x70(%rsp)
jmp 0x48c0f
movsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x1d8(%rsp)
jmp 0x48c5e
leaq 0x2a0(%rsp), %rdi
callq 0x2d470
movsd %xmm0, 0x68(%rsp)
jmp 0x48c35
movsd 0x68(%rsp), %xmm0
cvtsi2sdl 0x588(%rsp), %xmm1
divsd %xmm1, %xmm0
cvtsi2sdl 0x1e0(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x1d8(%rsp)
movsd 0x1d0(%rsp), %xmm1
movsd 0x1d8(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x1d8(%rsp)
movsd 0x2c8(%rsp), %xmm0
movsd 0x1d8(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x188(%rsp)
movsd 0x188(%rsp), %xmm1
movsd 0x218(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x218(%rsp)
leaq 0x1f8(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x4de20
jmp 0x48cd2
movq 0x5a0(%rsp), %rdi
callq 0x56b40
movq %rax, 0x60(%rsp)
jmp 0x48ce6
movq 0x60(%rsp), %rax
movq %rax, %xmm0
movaps 0x325b9(%rip), %xmm1    # 0x7b2b0
movaps %xmm1, 0x20(%rsp)
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x325b8(%rip), %xmm1    # 0x7b2c0
movaps %xmm1, 0x30(%rsp)
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, 0x178(%rsp)
movq 0x5a0(%rsp), %rdi
addq $0x30, %rdi
callq 0x4dbe0
movaps 0x20(%rsp), %xmm2
movaps 0x30(%rsp), %xmm1
movq %rax, %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, 0x170(%rsp)
cvtsi2sdl 0x1e0(%rsp), %xmm0
movsd %xmm0, 0x168(%rsp)
cvtsi2sdl 0x1e4(%rsp), %xmm0
movsd %xmm0, 0x160(%rsp)
movsd 0x178(%rsp), %xmm1
movsd 0x170(%rsp), %xmm2
movaps %xmm1, %xmm0
addsd %xmm2, %xmm0
movsd 0x168(%rsp), %xmm2
movsd 0x160(%rsp), %xmm4
movaps %xmm2, %xmm3
addsd %xmm4, %xmm3
divsd %xmm3, %xmm0
divsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x180(%rsp)
movsd 0x180(%rsp), %xmm1
movsd 0x210(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x210(%rsp)
movl 0x1e0(%rsp), %eax
movl %eax, 0x4c(%rsp)
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x50(%rsp)
movq 0x5a0(%rsp), %rdi
callq 0x56b40
movq %rax, 0x58(%rsp)
jmp 0x48e14
movl 0x4c(%rsp), %esi
movsd 0x50(%rsp), %xmm0
movq 0x58(%rsp), %rax
movq %rax, %xmm1
movaps 0x32481(%rip), %xmm2    # 0x7b2b0
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x32485(%rip), %xmm2    # 0x7b2c0
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
leaq 0x32616(%rip), %rdi     # 0x7b46b
movb $0x1, %al
callq 0x9040
jmp 0x48e5e
movl 0x1e4(%rsp), %eax
movl %eax, 0x1c(%rsp)
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x5a0(%rsp), %rdi
addq $0x30, %rdi
callq 0x4dbe0
movsd 0x10(%rsp), %xmm0
movl 0x1c(%rsp), %esi
movq %rax, %xmm1
movaps 0x32416(%rip), %xmm2    # 0x7b2b0
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x3241a(%rip), %xmm2    # 0x7b2c0
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
leaq 0x325c8(%rip), %rdi     # 0x7b488
movb $0x1, %al
callq 0x9040
jmp 0x48ec9
leaq 0x32f52(%rip), %rdi     # 0x7be22
xorl %eax, %eax
callq 0x9040
jmp 0x48ed9
movsd 0x1d8(%rsp), %xmm0
leaq 0x324e7(%rip), %rdi     # 0x7b3d0
movb $0x1, %al
callq 0x9040
jmp 0x48ef2
movsd 0x188(%rsp), %xmm0
movsd 0x180(%rsp), %xmm1
leaq 0x3259a(%rip), %rdi     # 0x7b4a5
movb $0x2, %al
callq 0x9040
jmp 0x48f14
leaq 0x32f07(%rip), %rdi     # 0x7be22
xorl %eax, %eax
callq 0x9040
jmp 0x48f24
movsd 0x1d8(%rsp), %xmm0
cvtsi2sdl 0x1e0(%rsp), %xmm1
divsd %xmm1, %xmm0
leaq 0x32580(%rip), %rdi     # 0x7b4c1
movb $0x1, %al
callq 0x9040
jmp 0x48f4a
movsd 0x1d0(%rsp), %xmm0
leaq 0x3245b(%rip), %rdi     # 0x7b3b5
movb $0x1, %al
callq 0x9040
jmp 0x48f63
leaq 0x220(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x4dce0
jmp 0x48f7a
leaq 0x198(%rsp), %rdi
callq 0x2d420
movl 0x1f4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1f4(%rsp)
jmp 0x48937
movsd 0x218(%rsp), %xmm0
cvtsi2sdl 0x59c(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x158(%rsp)
movsd 0x210(%rsp), %xmm0
cvtsi2sdl 0x59c(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x150(%rsp)
movsd 0x158(%rsp), %xmm0
movsd 0x150(%rsp), %xmm1
leaq 0x324e7(%rip), %rdi     # 0x7b4db
movb $0x2, %al
callq 0x9040
jmp 0x48ffd
leaq 0x110(%rsp), %rdi
leaq 0x1f8(%rsp), %rsi
callq 0x4de90
jmp 0x49014
leaq 0x110(%rsp), %rdi
leaq 0x148(%rsp), %rsi
leaq 0x138(%rsp), %rdx
leaq 0x140(%rsp), %rcx
leaq 0x130(%rsp), %r8
leaq 0x128(%rsp), %r9
callq 0x78710
jmp 0x4904b
leaq 0x110(%rsp), %rdi
callq 0xfa50
movsd 0x138(%rsp), %xmm0
movsd 0x32237(%rip), %xmm1    # 0x7b2a0
mulsd %xmm1, %xmm0
movsd %xmm0, (%rsp)
movl 0x59c(%rsp), %edi
callq 0x4df90
movsd %xmm0, 0x8(%rsp)
jmp 0x49086
movsd 0x8(%rsp), %xmm1
movsd (%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x108(%rsp)
movsd 0x148(%rsp), %xmm0
movsd 0x108(%rsp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x100(%rsp)
movsd 0x148(%rsp), %xmm0
movsd 0x108(%rsp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0xf8(%rsp)
movsd 0x100(%rsp), %xmm0
movsd 0xf8(%rsp), %xmm1
leaq 0x3240b(%rip), %rdi     # 0x7b500
movb $0x2, %al
callq 0x9040
jmp 0x490fe
leaq 0x1f8(%rsp), %rdi
callq 0xfa50
leaq 0x220(%rsp), %rdi
callq 0x4dd90
leaq 0x270(%rsp), %rdi
callq 0x2d420
leaq 0x2e0(%rsp), %rdi
callq 0x41f20
addq $0x5a8, %rsp            # imm = 0x5A8
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2d8(%rsp)
movl %eax, 0x2d4(%rsp)
leaq 0x110(%rsp), %rdi
callq 0xfa50
leaq 0x1f8(%rsp), %rdi
callq 0xfa50
leaq 0x220(%rsp), %rdi
callq 0x4dd90
leaq 0x270(%rsp), %rdi
callq 0x2d420
leaq 0x2e0(%rsp), %rdi
callq 0x41f20
movq 0x2d8(%rsp), %rdi
callq 0x9cf0
nopl (%rax)