// File: /workspace/github_cpp_makefile_star2_O2/fjamour[P]icentral/src/experiments.cc
// Function: insertion_test_fuad_max_iter(graph_t&, int, int, double, std::vector<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>)
void insertion_test_fuad_max_iter(graph_t& graph,
        int num_edges_to_insert,
        int num_iter,
        double time_to_run_all_iter,
        vector<edge_t> rand_edge_vec)
{
    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());
    
    double brandes_time;
    timer tm;
    
    printf("Brandes runtime: \t");
    tm.start();
    tr1_map_t(double) bc_vec = brandes_bc_hash_out(graph, num_iter);
    tm.stop();
    brandes_time = (tm.interval()*graph.size()/num_iter);
    
    bool do_all_iter = false;
    if(brandes_time < time_to_run_all_iter)
        do_all_iter = true;
    
    if(do_all_iter) {
        num_iter = -1;
        tm.start();
        tr1_map_t(double) bc_vec = brandes_bc_hash_out(graph, num_iter);
        tm.stop();
        brandes_time = tm.interval();
        printf("%f\n", brandes_time);
        printf("Brandes avg iter time: \t%f\n", tm.interval()/graph.size());
        printf("WILL DO ALL ITERATIONS...\n");
    } else {
        printf("%f\n", brandes_time);
        printf("Brandes avg iter time: \t%f\n", tm.interval()/num_iter);
    }

    
    //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);
    }

    double tot_fuad_time = 0;
    double tot_speedup = 0;
    
    double tot_ideal_speedup_perfect = 0;
    double tot_ideal_speedup = 0;
    
    vector<bcc_stat_t>  bcc_stat_vec;
    vector<double>      speedup_vec;
    for(int i = 0; i < rand_edge_vec.size(); ++i) {
        bcc_stat_t bcc_stat;
        edge_t rand_edge = rand_edge_vec[i];
        double est_time = 0;
        
        printf("Inserting edge (%d, %d) and updating bc...\n", rand_edge.first, rand_edge.second);
        tm.start();
        graph.insert_edge_update_bc_experimental(rand_edge.first, rand_edge.second, bcc_stat, num_iter, num_iter);
        tm.stop();
        if(do_all_iter) {
            est_time = bcc_stat.bc_update_time + bcc_stat.bcc_find_time;
            
            // TMP XXX FIX THIS
            //est_time = bcc_stat.bc_update_time;
            ////
        }
        
        double avg_iter_time_naive;
        graph.approx_bcc_iter_tm(rand_edge.first, rand_edge.second, avg_iter_time_naive, num_iter);
        tot_fuad_time += tm.interval();
        
        //fix counts if will produce errors:
        if(bcc_stat.num_d0_iter == 0) {
            bcc_stat.num_d0_iter = 1;
            bcc_stat.tot_d0_tm = 0;
        }
        if(bcc_stat.num_d1_iter == 0) {
            bcc_stat.num_d1_iter = 1;
            bcc_stat.tot_d1_tm = 0;
        }
        if(bcc_stat.num_d2_iter == 0) {
            bcc_stat.num_d2_iter = 1;
            bcc_stat.tot_d2_tm = 0;
        }
        ////
        if(!do_all_iter) {
            est_time += bcc_stat.tot_d1_tm*bcc_stat.tot_d1_iter/bcc_stat.num_d1_iter;
            est_time += bcc_stat.tot_d2_tm*bcc_stat.tot_d2_iter/bcc_stat.num_d2_iter;
        }
        

        tot_speedup += (brandes_time/est_time);
        speedup_vec.push_back(brandes_time/est_time);
        
        //ideal speedup estimation
        double ideal_speedup_perfect, ideal_speedup;
        double G_n   = graph.size(); 
        double G_m   = graph.edge_set.size();
        double BCC_n = bcc_stat.bcc_num_nodes;
        double BCC_m = bcc_stat.bcc_num_edges;
        double inc_iter_ratio = 150;//PARAMETER!! IMP make a #define
        double iter_frac = 1 - ((double)bcc_stat.tot_d0_iter/BCC_n);
        ideal_speedup_perfect =
                fuad_ideal_speedup(iter_frac, 
                    BCC_n,
                    BCC_m,
                    G_n,
                    G_m,
                    100);
        ideal_speedup =
                fuad_ideal_speedup(iter_frac, 
                    BCC_n,
                    BCC_m,
                    G_n,
                    G_m,
                    inc_iter_ratio);
        
        tot_ideal_speedup_perfect += ideal_speedup_perfect;
        tot_ideal_speedup += ideal_speedup;
        ////
        
        //speedup if BFS DAGS were to be stored in memory
        double in_mem_speedup;
        double in_mem_time = 0;
        in_mem_time += (bcc_stat.tot_d1_tm/bcc_stat.num_d1_iter-avg_iter_time_naive)*bcc_stat.tot_d1_iter;
        in_mem_time += (bcc_stat.tot_d2_tm/bcc_stat.num_d2_iter-avg_iter_time_naive)*bcc_stat.tot_d2_iter;
        in_mem_speedup = brandes_time/in_mem_time;
        printf("\tStored DAGS ideal speedup: \t%f\n\n", in_mem_speedup);
        ////
        
        printf("\tBCC num nodes: \t\t\t%d (%f G_n)\n",
                bcc_stat.bcc_num_nodes,
                (double)bcc_stat.bcc_num_nodes/graph.size());
        printf("\tBCC num edges: \t\t\t%d (%f G_m)\n",
                bcc_stat.bcc_num_edges,
                (double)bcc_stat.bcc_num_edges/graph.edge_set.size());
        printf("\n");
        printf("\tTime to update BC: \t\t%f\n",
                est_time);
        printf("\tSpeedup: \t\t\t%f (Ideal: %f - %f)\n",
                brandes_time/est_time,
                ideal_speedup,
                ideal_speedup_perfect);
        printf("\n");
        printf("\tBCC d1 time: \t\t\t%f (%f to naive iter)\n",
                bcc_stat.tot_d1_tm/bcc_stat.num_d1_iter,
                (bcc_stat.tot_d1_tm/bcc_stat.num_d1_iter)/avg_iter_time_naive);
        printf("\tBCC d2 time: \t\t\t%f (%f to naive iter)\n",
                bcc_stat.tot_d2_tm/bcc_stat.num_d2_iter,
                (bcc_stat.tot_d2_tm/bcc_stat.num_d2_iter)/avg_iter_time_naive);
        printf("\tavg iter time naive: \t\t%f (%f to naive iter)\n",
                avg_iter_time_naive,
                avg_iter_time_naive/avg_iter_time_naive);
        printf("\n");
        printf("\tBCC num/tot d0 BFS: \t\t%*d/%*d (%f to BCC_n)\n",
                8,
                bcc_stat.num_d0_iter,
                8,
                bcc_stat.tot_d0_iter,
                bcc_stat.tot_d0_iter/(double)bcc_stat.bcc_num_nodes);
        printf("\tBCC num/tot d1 BFS: \t\t%*d/%*d (%f to BCC_n)\n",
                8,
                bcc_stat.num_d1_iter,
                8,
                bcc_stat.tot_d1_iter,
                bcc_stat.tot_d1_iter/(double)bcc_stat.bcc_num_nodes);
        printf("\tBCC num/tot d2 BFS: \t\t%*d/%*d (%f to BCC_n)\n",
                8,
                bcc_stat.num_d2_iter,
                8,
                bcc_stat.tot_d2_iter,
                bcc_stat.tot_d2_iter/(double)bcc_stat.bcc_num_nodes);
        printf("\n");
        printf("\tBCC bcc find time: \t\t%f\n", bcc_stat.bcc_find_time);
        printf("\tBCC sssp time: \t\t\t%f\n", bcc_stat.sssp_tm);
        
        bcc_stat_vec.push_back(bcc_stat);
        
        //dont remove the edge, to have fair comparison to QUBE
        //in my QUBE implementation the MUC update after edge removal is not
        //implemented
        //graph.remove_edge(rand_edge.first, rand_edge.second);
    }
    
    //double avg_speedup = (num_edges_to_insert*brandes_time)/tot_fuad_time;
    double avg_speedup = tot_speedup/num_edges_to_insert;
    double avg_ideal_speedup_perfect = tot_ideal_speedup_perfect/num_edges_to_insert;
    double avg_ideal_speedup = tot_ideal_speedup/num_edges_to_insert;
    
    printf("[[Average speedup: %f (Ideal: %f - %f)]]\n",
        avg_speedup,
        avg_ideal_speedup,
        avg_ideal_speedup_perfect);
    
    //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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rcx, 0x28(%rsp)
movsd %xmm0, 0xa8(%rsp)
movl %edx, %r15d
movl %esi, %ebp
movq %rdi, %r13
leaq 0x14703(%rip), %rdi     # 0x28b00
callq 0x2360
movq 0x108(%r13), %rsi
leaq 0x13e00(%rip), %rdi     # 0x28210
xorl %eax, %eax
callq 0x2030
movq %r13, %rdi
callq 0x18d3c
leaq 0x13df8(%rip), %rdi     # 0x2821e
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
movq 0x58(%r13), %rsi
leaq 0x13df8(%rip), %rdi     # 0x28233
xorl %eax, %eax
callq 0x2030
leaq 0x13dff(%rip), %rdi     # 0x28248
xorl %eax, %eax
callq 0x2030
leaq 0x100(%rsp), %rbx
movq %rbx, %rdi
callq 0xb094
leaq 0x168(%rsp), %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0x946d
movq %rbx, %rdi
callq 0xb09c
movq %rbx, %rdi
callq 0xb0a8
movsd %xmm0, 0x18(%rsp)
movq %r13, %rdi
callq 0x18d3c
movq %rax, %xmm0
punpckldq 0x13d52(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x13d5a(%rip), %xmm0    # 0x28200
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
cvtsi2sd %r15d, %xmm3
movsd 0x18(%rsp), %xmm2
mulsd %xmm1, %xmm2
divsd %xmm3, %xmm2
movsd 0xa8(%rsp), %xmm0
ucomisd %xmm2, %xmm0
movsd %xmm2, 0x18(%rsp)
jbe 0x14590
leaq 0x100(%rsp), %rdi
callq 0xb094
leaq 0x48(%rsp), %rdi
pushq $-0x1
popq %r15
movq %r13, %rsi
movl %r15d, %edx
callq 0x946d
leaq 0x100(%rsp), %rbx
movq %rbx, %rdi
callq 0xb09c
movq %rbx, %rdi
callq 0xb0a8
leaq 0x13efc(%rip), %rdi     # 0x2841a
movsd %xmm0, 0x30(%rsp)
movb $0x1, %al
callq 0x2030
movq %rbx, %rdi
callq 0xb0a8
movsd %xmm0, (%rsp)
movq %r13, %rdi
callq 0x18d3c
movq %rax, %xmm0
punpckldq 0x13ca3(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x13cab(%rip), %xmm0    # 0x28200
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd (%rsp), %xmm0
divsd %xmm1, %xmm0
leaq 0x13da8(%rip), %rdi     # 0x28319
movb $0x1, %al
callq 0x2030
leaq 0x14553(%rip), %rdi     # 0x28ad2
callq 0x2360
leaq 0x48(%rsp), %rdi
callq 0xb070
jmp 0x145d3
movapd %xmm2, %xmm0
leaq 0x13e7f(%rip), %rdi     # 0x2841a
movb $0x1, %al
movsd %xmm3, (%rsp)
callq 0x2030
leaq 0x100(%rsp), %rdi
callq 0xb0a8
divsd (%rsp), %xmm0
leaq 0x13d59(%rip), %rdi     # 0x28319
movb $0x1, %al
callq 0x2030
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movq 0x28(%rsp), %rcx
movq 0x8(%rcx), %rax
cmpq (%rcx), %rax
jne 0x145fc
leaq 0x14504(%rip), %rdi     # 0x28aec
callq 0x2360
movl %ebp, %edi
movq %r13, %rsi
movq 0x28(%rsp), %rdx
callq 0x12cba
movl %ebp, 0x40(%rsp)
xorpd %xmm0, %xmm0
leaq 0x120(%rsp), %rax
andq $0x0, 0x10(%rax)
leaq 0xe0(%rsp), %rcx
andq $0x0, 0x10(%rcx)
movapd %xmm0, (%rax)
movapd %xmm0, (%rcx)
leaq 0x100(%rsp), %r14
leaq 0x48(%rsp), %r12
xorpd %xmm1, %xmm1
xorpd %xmm2, %xmm2
xorpd %xmm0, %xmm0
xorl %edx, %edx
movl %r15d, 0x44(%rsp)
movq 0x28(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rdx, %rcx
jbe 0x14b0f
movsd %xmm0, 0xc8(%rsp)
movsd %xmm2, 0xd0(%rsp)
movsd %xmm1, 0xd8(%rsp)
movl (%rax,%rdx,8), %ebx
movq %rdx, 0xc0(%rsp)
movl 0x4(%rax,%rdx,8), %ebp
leaq 0x13e79(%rip), %rdi     # 0x2850c
movl %ebx, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2030
movq %r14, %rdi
callq 0xb094
movq %r13, %rdi
movl %ebx, %esi
movl %ebp, %edx
movq %r12, %rcx
movl %r15d, %r8d
movl %r15d, %r9d
callq 0x1930a
movq %r14, %rdi
callq 0xb09c
movsd 0x88(%rsp), %xmm0
addsd 0x80(%rsp), %xmm0
movapd %xmm0, (%rsp)
movq %r13, %rdi
movl %ebx, %esi
movl %ebp, %edx
leaq 0x10(%rsp), %rcx
movl %r15d, %r8d
callq 0x19462
movq %r14, %rdi
callq 0xb0a8
cmpl $0x0, 0x58(%rsp)
jne 0x1470b
movl $0x1, 0x58(%rsp)
andq $0x0, 0x68(%rsp)
movl 0x5c(%rsp), %eax
testl %eax, %eax
movsd 0xa8(%rsp), %xmm0
jne 0x1472d
movl $0x1, 0x5c(%rsp)
andq $0x0, 0x70(%rsp)
pushq $0x1
popq %rax
movl 0x60(%rsp), %ecx
testl %ecx, %ecx
jne 0x14746
movl $0x1, 0x60(%rsp)
andq $0x0, 0x78(%rsp)
pushq $0x1
popq %rcx
ucomisd 0x18(%rsp), %xmm0
ja 0x1478e
movd %ecx, %xmm0
movd %eax, %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
cvtdq2pd %xmm1, %xmm0
cvtdq2pd 0x9c(%rsp), %xmm2
movupd 0x70(%rsp), %xmm1
mulpd %xmm1, %xmm2
divpd %xmm0, %xmm2
movapd %xmm2, %xmm0
addsd 0x13a3f(%rip), %xmm0    # 0x281c0
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm0, %xmm2
movapd %xmm2, (%rsp)
movsd 0x30(%rsp), %xmm0
divsd (%rsp), %xmm0
movsd %xmm0, 0xb8(%rsp)
movsd %xmm0, 0x38(%rsp)
leaq 0xe0(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x16dca
movq %r12, %r14
movq %r13, %rdi
callq 0x18d3c
movq %rax, %rbx
movl 0x58(%r13), %ebp
movq %r13, %r12
movl 0x48(%rsp), %r13d
cvtsi2sd %r13d, %xmm0
cvtsi2sdl 0x98(%rsp), %xmm1
movl 0x4c(%rsp), %r15d
divsd %xmm0, %xmm1
movsd 0x1384d(%rip), %xmm0    # 0x28040
subsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
movl %r13d, %edi
movl %r15d, %esi
movl %ebx, %edx
movl %ebp, %ecx
pushq $0x64
popq %r8
callq 0x12c68
movsd %xmm0, 0xb0(%rsp)
movsd 0x20(%rsp), %xmm0
movl %r13d, %edi
movq %r12, %r13
movl %r15d, %esi
movl %ebx, %edx
movl %ebp, %ecx
movl $0x96, %r8d
callq 0x12c68
cvtsi2sdl 0x5c(%rsp), %xmm1
movsd %xmm0, 0x20(%rsp)
movsd 0x70(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd 0x78(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
subsd %xmm2, %xmm0
cvtsi2sdl 0x9c(%rsp), %xmm3
mulsd %xmm0, %xmm3
addsd 0x1394e(%rip), %xmm3    # 0x281c0
cvtsi2sdl 0x60(%rsp), %xmm0
divsd %xmm0, %xmm1
subsd %xmm2, %xmm1
cvtsi2sdl 0xa0(%rsp), %xmm2
mulsd %xmm1, %xmm2
addsd %xmm3, %xmm2
movsd 0x30(%rsp), %xmm0
divsd %xmm2, %xmm0
leaq 0x13d5b(%rip), %rdi     # 0x285fd
movb $0x1, %al
callq 0x2030
movl 0x48(%rsp), %ebx
movq %r12, %rdi
callq 0x18d3c
movq %r14, %r12
cvtsi2sd %ebx, %xmm0
movq %rax, %xmm1
movq 0x13927(%rip), %xmm2    # 0x281f0
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x1392b(%rip), %xmm2    # 0x28200
subpd %xmm2, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
leaq 0x13d2f(%rip), %rdi     # 0x2861f
movl %ebx, %esi
movb $0x1, %al
callq 0x2030
movl 0x4c(%rsp), %esi
cvtsi2sd %esi, %xmm0
movsd 0x58(%r13), %xmm1
unpcklps 0x138e2(%rip), %xmm1    # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x138ea(%rip), %xmm1    # 0x28200
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
leaq 0x13d12(%rip), %rdi     # 0x2863f
movb $0x1, %al
callq 0x2030
pushq $0xa
popq %rbx
movl %ebx, %edi
callq 0x2300
leaq 0x13d1a(%rip), %rdi     # 0x2865f
movaps (%rsp), %xmm0
movb $0x1, %al
callq 0x2030
leaq 0x13d22(%rip), %rdi     # 0x28679
movsd 0xb8(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0xb0(%rsp), %xmm2
movb $0x3, %al
callq 0x2030
movl %ebx, %edi
callq 0x2300
movsd 0x70(%rsp), %xmm0
cvtsi2sdl 0x5c(%rsp), %xmm1
divsd %xmm1, %xmm0
movapd %xmm0, %xmm1
divsd 0x10(%rsp), %xmm1
leaq 0x13cfd(%rip), %rdi     # 0x2869b
movb $0x2, %al
callq 0x2030
movsd 0x78(%rsp), %xmm0
cvtsi2sdl 0x60(%rsp), %xmm1
divsd %xmm1, %xmm0
movapd %xmm0, %xmm1
divsd 0x10(%rsp), %xmm1
leaq 0x13cfd(%rip), %rdi     # 0x286c3
movb $0x2, %al
callq 0x2030
movsd 0x10(%rsp), %xmm0
movapd %xmm0, %xmm1
divsd %xmm0, %xmm1
leaq 0x13d09(%rip), %rdi     # 0x286eb
movb $0x2, %al
callq 0x2030
movl %ebx, %edi
callq 0x2300
movl 0x98(%rsp), %r8d
cvtsi2sd %r8d, %xmm0
movl 0x58(%rsp), %edx
cvtsi2sdl 0x48(%rsp), %xmm1
divsd %xmm1, %xmm0
leaq 0x13d08(%rip), %rdi     # 0x2871a
pushq $0x8
popq %rbp
movl %ebp, %esi
movl %ebp, %ecx
movb $0x1, %al
callq 0x2030
movl 0x9c(%rsp), %r8d
cvtsi2sd %r8d, %xmm0
movl 0x5c(%rsp), %edx
cvtsi2sdl 0x48(%rsp), %xmm1
divsd %xmm1, %xmm0
leaq 0x13d06(%rip), %rdi     # 0x28748
movl %ebp, %esi
movl %ebp, %ecx
movb $0x1, %al
callq 0x2030
movl 0xa0(%rsp), %r8d
cvtsi2sd %r8d, %xmm0
movl 0x60(%rsp), %edx
cvtsi2sdl 0x48(%rsp), %xmm1
divsd %xmm1, %xmm0
leaq 0x13d07(%rip), %rdi     # 0x28776
movl %ebp, %esi
movl %ebp, %ecx
movb $0x1, %al
callq 0x2030
movl %ebx, %edi
callq 0x2300
movsd 0x80(%rsp), %xmm0
leaq 0x13d13(%rip), %rdi     # 0x287a4
movb $0x1, %al
callq 0x2030
movsd 0x90(%rsp), %xmm0
leaq 0x13d16(%rip), %rdi     # 0x287be
movb $0x1, %al
callq 0x2030
leaq 0x120(%rsp), %rdi
movq %r14, %rsi
callq 0x1646c
movsd 0xc8(%rsp), %xmm0
addsd 0xb8(%rsp), %xmm0
movsd 0xd0(%rsp), %xmm2
addsd 0xb0(%rsp), %xmm2
movsd 0xd8(%rsp), %xmm1
addsd 0x20(%rsp), %xmm1
movq 0xc0(%rsp), %rdx
incq %rdx
movl 0x44(%rsp), %r15d
leaq 0x100(%rsp), %r14
jmp 0x14646
cvtsi2sdl 0x40(%rsp), %xmm3
divsd %xmm3, %xmm0
divsd %xmm3, %xmm2
movsd %xmm3, (%rsp)
divsd %xmm3, %xmm1
leaq 0x13ca8(%rip), %rdi     # 0x287d5
movb $0x3, %al
callq 0x2030
leaq 0x140(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x163c6
leaq 0x140(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0x160(%rsp), %r8
leaq 0x158(%rsp), %r9
callq 0x26ad4
leaq 0x140(%rsp), %rdi
callq 0x5754
movsd 0x38(%rsp), %xmm1
mulsd 0x13628(%rip), %xmm1    # 0x281b8
xorpd %xmm0, %xmm0
movsd (%rsp), %xmm2
ucomisd %xmm0, %xmm2
movapd %xmm2, %xmm0
jb 0x14ba9
sqrtsd %xmm0, %xmm0
jmp 0x14bb8
movsd %xmm1, (%rsp)
callq 0x21d0
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movsd 0x48(%rsp), %xmm2
movapd %xmm2, %xmm0
subsd %xmm1, %xmm0
addsd %xmm2, %xmm1
leaq 0x137f5(%rip), %rdi     # 0x283ca
movb $0x2, %al
callq 0x2030
leaq 0xe0(%rsp), %rdi
callq 0x5754
leaq 0x120(%rsp), %rdi
callq 0x16c2c
leaq 0x168(%rsp), %rdi
callq 0xb070
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x14c3c
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0xb070
jmp 0x14c66
jmp 0x14c3c
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0x5754
jmp 0x14c4c
jmp 0x14c49
movq %rax, %rbx
jmp 0x14c66
jmp 0x14c49
jmp 0x14c49
jmp 0x14c49
jmp 0x14c49
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x5754
leaq 0x120(%rsp), %rdi
callq 0x16c2c
leaq 0x168(%rsp), %rdi
callq 0xb070
movq %rbx, %rdi
callq 0x23d0