// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/main.cpp
// Function: main
int main(int argc, char** argv){

    bool run_mst_algo = false;
    bool run_mst_clust = false;
    bool run_mst_inc = false;
    bool run_mpi_prim = false;

    if (argc <= 1) 
    {
        exit_with_help();
    }
    
	for (int i = 1; i<argc; i++)
	{
		if(argv[i][0] != '-') exit_with_help();
		++i;
		switch(argv[i-1][1])
		{
			case 'a': run_mst_algo = true; break;
			case 'c': run_mst_clust = true; break;
			case 'i': run_mst_inc = true; break;
            case 'm': run_mpi_prim = true; break;
			default:
				std::fprintf(stderr,"unknown option\n");
				exit_with_help();
		}
	}

    /*
     * Tasks 
     */

    // TASKS 1 & 2

    if (run_mst_algo) 
    {
        // Comparing MST algorithms on Erdos-Rényi graphs

        std::vector<int> ER_graph_sizes({4, 8, 100, 250, 500, 1000});

        for (int n : ER_graph_sizes) 
        {
            Graph gER = Graph("data/ERn" + std::to_string(n) + "p10.txt");

            std::cout << "\nComparing MST algorithms with Erdos-Rényi graphs of size " << n << "." << std::endl;
            std::cout << "The graph contains " << gER.get_number_of_edges() << " edges." << std::endl;

            PrimAlgorithm primER = PrimAlgorithm(&gER);
            primER.compute_mst();

            BoruvkaAlgorithm boruvkaER = BoruvkaAlgorithm(&gER);
            boruvkaER.compute_mst();

            KruskalAlgorithm kruskalER = KruskalAlgorithm(&gER);
            kruskalER.compute_mst();
        }

        // Comparing MST algorithms on Barabasi-Albert graphs

        std::vector<int> BA_graph_sizes({100, 250, 500, 1000});

        for (int n : BA_graph_sizes) 
        {
            Graph gBA = Graph("data/BAn" + std::to_string(n) + "mo20m2.txt");

            std::cout << "\nComparing MST algorithms with Barabasi-Albert graphs of size " << n << "." << std::endl;
            std::cout << "The graph contains " << gBA.get_number_of_edges() << " edges." << std::endl;

            PrimAlgorithm primBA = PrimAlgorithm(&gBA);
            primBA.compute_mst();

            BoruvkaAlgorithm boruvkaBA = BoruvkaAlgorithm(&gBA);
            boruvkaBA.compute_mst();

            KruskalAlgorithm kruskalBA = KruskalAlgorithm(&gBA);
            kruskalBA.compute_mst();
        }
    }

    if (run_mpi_prim) 
    {
        // Comparing MST algorithms on Erdos-Rényi graphs

        std::vector<int> ER_graph_sizes({4, 8, 100, 250, 500, 1000});
    
        MPI_Init(NULL, NULL);

        int world_size;
        MPI_Comm_size(MPI_COMM_WORLD, &world_size);

        int world_rank;
        MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);

        
        

        for (int n : ER_graph_sizes) 
        {
            Graph gER = Graph("data/ERn" + std::to_string(n) + "p10.txt");

            std::cout << "\nComparing MST algorithms with Erdos-Rényi graphs of size " << n << "." << std::endl;
            std::cout << "The graph contains " << gER.get_number_of_edges() << " edges." << std::endl;

            PrimKumarAlgorithm primER = PrimKumarAlgorithm(&gER, world_rank, world_size);
            primER.compute_mst();


        }

        // Comparing MST algorithms on Barabasi-Albert graphs

        std::vector<int> BA_graph_sizes({100, 250, 500, 1000});

        for (int n : BA_graph_sizes) 
        {
            Graph gBA = Graph("data/BAn" + std::to_string(n) + "mo20m2.txt");

            std::cout << "\nComparing MST algorithms with Barabasi-Albert graphs of size " << n << "." << std::endl;
            std::cout << "The graph contains " << gBA.get_number_of_edges() << " edges." << std::endl;

            PrimKumarAlgorithm primBA = PrimKumarAlgorithm(&gBA, world_rank, world_size);
            primBA.compute_mst();
        }
        
        MPI_Finalize();
    }

    
    // TASK 5

    if (run_mst_clust) 
    {
        // Comparing MST clustering and k-means on Walmart dataset 

        std::vector<int> walmart_graph_sizes({100, 250, 500, 1000});
        std::vector<int> nb_clusters({3, 4, 5, 6, 7, 8});

        for (int n : walmart_graph_sizes)
        {
            for (int k : nb_clusters)
            {
                std::cout << "\nComparing MST clustering and k-means on graph of size " << n;
                std::cout << " and with " << k << " clusters" << std::endl;

                compare_clustering("data/scaled_n" + std::to_string(n) + "_walmart_features.txt", k);
            }
        }
    }

    // TASK 6 

    if (run_mst_inc)
    {
        // with Erdos-Rényi graphs 

        std::cout << "\nComparing different cutoffs on Erdos-Rényi graphs" << std::endl;
        std::vector<double> ER_cutoffs({1, 5, 10, 50, 100, 500, 1000});

        for (double c : ER_cutoffs) {
            Graph g = Graph("data/ERn1000p10.txt");
            KruskalAlgorithm k = KruskalAlgorithm(&g);

            std::unordered_map<Node*, Node*> clusters = k.compute_clustering(c);

            std::unordered_map<Node*, int> clusters_size;
            for (auto kv : clusters) {
                if(clusters_size.find(kv.second) != clusters_size.end()) {
                    clusters_size.at(kv.second) += 1;
                } else {
                    clusters_size.insert(std::pair<Node*, int>(kv.second, 1));
                }
            }
            std::cout << "In total, there are : " << clusters_size.size() << " clusters when cutoff = " << c << std::endl;

            int big_clusters = 0;
            std::cout << "The cluster sizes above 1 are the following : ";
            for (auto kv : clusters_size) {
                if (kv.second > 1) {
                    std::cout << kv.second << " ";
                    big_clusters += 1;
                }
            }
            std::cout << std::endl;
            std::cout << "There are " << big_clusters << " clusters of size above 1." << std::endl;
        }

        // with Walmart dataset

        std::cout << "\nComparing different cutoffs on Walmart dataset" << std::endl;
        std::vector<double> walmart_cutoffs({1, 5, 10, 50, 100, 500, 1000});

        for (double c : walmart_cutoffs) {
            compare_inconsistency("data/scaled_n1000_walmart_features.txt", c);
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x558, %rsp            # imm = 0x558
cmpl $0x2, %edi
jl 0x78aa
movl %edi, %eax
pushq $0x1
popq %rcx
xorl %r9d, %r9d
leaq 0x851e(%rip), %rdx      # 0xf180
xorl %ebx, %ebx
xorl %ebp, %ebp
xorl %edi, %edi
cmpq %rax, %rcx
jae 0x6cb2
movq (%rsi,%rcx,8), %r8
cmpb $0x2d, (%r8)
jne 0x78aa
movsbl 0x1(%r8), %r8d
addl $-0x61, %r8d
rorl %r8d
cmpl $0x6, %r8d
ja 0x78af
movslq (%rdx,%r8,4), %r8
addq %rdx, %r8
jmpq *%r8
movb $0x1, %dil
jmp 0x6cac
movb $0x1, %bl
jmp 0x6cac
movb $0x1, %r9b
jmp 0x6cac
movb $0x1, %bpl
addq $0x2, %rcx
jmp 0x6c68
movabsq $0x3e8000001f4, %rax    # imm = 0x3E8000001F4
testb $0x1, %dil
movl %ebx, 0x14(%rsp)
movl %ebp, 0x18(%rsp)
je 0x7066
movl %r9d, 0x3c(%rsp)
movups 0x84c2(%rip), %xmm0     # 0xf19c
leaq 0x170(%rsp), %rsi
movaps %xmm0, (%rsi)
movq %rax, 0x10(%rsi)
leaq 0x20(%rsp), %rdi
pushq $0x6
popq %rdx
leaq 0x68(%rsp), %rcx
callq 0x7c1a
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x68(%rsp), %r15
leaq 0x170(%rsp), %r12
leaq 0x538(%rsp), %rbx
leaq 0x288(%rsp), %r13
cmpq 0x8(%rsp), %rcx
je 0x6e89
movq %r13, %r14
movq %r12, %r13
movq %r15, %r12
movq %rcx, (%rsp)
movl (%rcx), %r15d
movq %r12, %rdi
movl %r15d, %esi
callq 0x7c93
movq %r13, %rbp
movq %r13, %rdi
leaq 0x84be(%rip), %rsi      # 0xf218
movq %r12, %rdx
callq 0x7c6f
movq %rbx, %r12
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0x85f5(%rip), %rdx      # 0xf367
callq 0x7c50
movq %r14, %rdi
movq %r12, %rsi
callq 0x42f0
movq %r12, %rdi
callq 0x3110
movq %r13, %r12
movq %r13, %rdi
callq 0x3110
leaq 0x68(%rsp), %rdi
callq 0x3110
movq 0x1020a(%rip), %rdi     # 0x16fb0
leaq 0x8474(%rip), %rsi      # 0xf221
callq 0x32a0
movq %r14, %r13
movq %rax, %rdi
movl %r15d, %esi
callq 0x34a0
movq %rax, %rdi
leaq 0x8c6c(%rip), %rsi      # 0xfa36
callq 0x32a0
movq %rax, %rdi
callq 0x3130
movq 0x101d2(%rip), %rdi     # 0x16fb0
leaq 0x8478(%rip), %rsi      # 0xf25d
callq 0x32a0
movq %rax, %r14
movq %r13, %rdi
callq 0x46e0
movq %r14, %rdi
movl %eax, %esi
callq 0x34a0
movq %rax, %rdi
leaq 0x8468(%rip), %rsi      # 0xf271
callq 0x32a0
movq %rax, %rdi
callq 0x3130
movq %r12, %rdi
movq %r13, %rsi
callq 0x9f54
movq %r12, %rdi
callq 0x9f6a
leaq 0x68(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0xaf34
movq %r15, %rdi
callq 0xaf4a
leaq 0x390(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0xb3a4
movq %r14, %rdi
callq 0xb3ba
movq %r14, %rdi
callq 0x7cec
movq %r15, %rdi
callq 0x7cec
movq %r12, %rdi
callq 0x7cec
movq %r13, %rdi
callq 0x481a
movq (%rsp), %rcx
addq $0x4, %rcx
jmp 0x6d27
movaps 0x82e0(%rip), %xmm0     # 0xf170
leaq 0x170(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0x40(%rsp), %rdi
pushq $0x4
popq %rdx
leaq 0x68(%rsp), %rcx
callq 0x7c1a
movq 0x40(%rsp), %rcx
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x68(%rsp), %r15
leaq 0x170(%rsp), %r12
leaq 0x518(%rsp), %rbx
leaq 0x288(%rsp), %r13
cmpq 0x8(%rsp), %rcx
je 0x703b
movq %r13, %r14
movq %r12, %r13
movq %r15, %r12
movq %rcx, (%rsp)
movl (%rcx), %r15d
movq %r12, %rdi
movl %r15d, %esi
callq 0x7c93
movq %r13, %rbp
movq %r13, %rdi
leaq 0x836d(%rip), %rsi      # 0xf279
movq %r12, %rdx
callq 0x7c6f
movq %rbx, %r12
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0x835e(%rip), %rdx      # 0xf282
callq 0x7c50
movq %r14, %rdi
movq %r12, %rsi
callq 0x42f0
movq %r12, %rdi
callq 0x3110
movq %r13, %r12
movq %r13, %rdi
callq 0x3110
leaq 0x68(%rsp), %rdi
callq 0x3110
movq 0x10058(%rip), %rdi     # 0x16fb0
leaq 0x832e(%rip), %rsi      # 0xf28d
callq 0x32a0
movq %r14, %r13
movq %rax, %rdi
movl %r15d, %esi
callq 0x34a0
movq %rax, %rdi
leaq 0x8aba(%rip), %rsi      # 0xfa36
callq 0x32a0
movq %rax, %rdi
callq 0x3130
movq 0x10020(%rip), %rdi     # 0x16fb0
leaq 0x82c6(%rip), %rsi      # 0xf25d
callq 0x32a0
movq %rax, %r14
movq %r13, %rdi
callq 0x46e0
movq %r14, %rdi
movl %eax, %esi
callq 0x34a0
movq %rax, %rdi
leaq 0x82b6(%rip), %rsi      # 0xf271
callq 0x32a0
movq %rax, %rdi
callq 0x3130
movq %r12, %rdi
movq %r13, %rsi
callq 0x9f54
movq %r12, %rdi
callq 0x9f6a
leaq 0x68(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0xaf34
movq %r15, %rdi
callq 0xaf4a
leaq 0x390(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0xb3a4
movq %r14, %rdi
callq 0xb3ba
movq %r14, %rdi
callq 0x7cec
movq %r15, %rdi
callq 0x7cec
movq %r12, %rdi
callq 0x7cec
movq %r13, %rdi
callq 0x481a
movq (%rsp), %rcx
addq $0x4, %rcx
jmp 0x6ed9
leaq 0x40(%rsp), %rdi
callq 0x7f7c
leaq 0x20(%rsp), %rdi
callq 0x7f7c
movl 0x14(%rsp), %ebx
movl 0x18(%rsp), %ebp
movl 0x3c(%rsp), %r9d
movabsq $0x3e8000001f4, %rax    # imm = 0x3E8000001F4
testb $0x1, %r9b
je 0x7378
movups 0x8125(%rip), %xmm0     # 0xf19c
leaq 0x170(%rsp), %rsi
movaps %xmm0, (%rsi)
movq %rax, 0x10(%rsi)
leaq 0x288(%rsp), %rdi
pushq $0x6
popq %rdx
leaq 0x68(%rsp), %rcx
callq 0x7c1a
xorl %edi, %edi
xorl %esi, %esi
callq 0x33e0
movq 0xfeed(%rip), %rdi      # 0x16f98
leaq 0x40(%rsp), %rsi
callq 0x3310
movq 0xfedc(%rip), %rdi      # 0x16f98
leaq 0x58(%rsp), %rsi
callq 0x33d0
movq 0x288(%rsp), %r14
movq 0x290(%rsp), %rax
movq %rax, (%rsp)
leaq 0x390(%rsp), %rbx
leaq 0x170(%rsp), %r15
leaq 0x4f8(%rsp), %r13
leaq 0x68(%rsp), %rbp
cmpq (%rsp), %r14
je 0x71fe
movl (%r14), %r12d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x7c93
movq %r15, %rdi
leaq 0x80ff(%rip), %rsi      # 0xf218
movq %rbx, %rdx
callq 0x7c6f
movq %r13, %rdi
movq %r15, %rsi
leaq 0x8239(%rip), %rdx      # 0xf367
callq 0x7c50
movq %rbp, %rdi
movq %r13, %rsi
callq 0x42f0
movq %r13, %rdi
callq 0x3110
movq %r15, %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x3110
movq 0xfe53(%rip), %rdi      # 0x16fb0
leaq 0x80bd(%rip), %rsi      # 0xf221
callq 0x32a0
movq %rax, %rdi
movl %r12d, %esi
callq 0x34a0
movq %rax, %rdi
leaq 0x88b8(%rip), %rsi      # 0xfa36
callq 0x32a0
movq %rax, %rdi
callq 0x3130
movq 0xfe1e(%rip), %rdi      # 0x16fb0
leaq 0x80c4(%rip), %rsi      # 0xf25d
callq 0x32a0
movq %rax, %r12
movq %rbp, %rdi
callq 0x46e0
movq %r12, %rdi
movl %eax, %esi
callq 0x34a0
movq %rax, %rdi
leaq 0x80b4(%rip), %rsi      # 0xf271
callq 0x32a0
movq %rax, %rdi
callq 0x3130
movl 0x58(%rsp), %edx
movl 0x40(%rsp), %ecx
movq %r15, %rdi
movq %rbp, %rsi
callq 0xb778
movq %r15, %rdi
callq 0xb7a6
movq %r15, %rdi
callq 0x7cec
movq %rbp, %rdi
callq 0x481a
addq $0x4, %r14
jmp 0x70f7
movaps 0x7f6b(%rip), %xmm0     # 0xf170
leaq 0x170(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0x20(%rsp), %rdi
pushq $0x4
popq %rdx
leaq 0x68(%rsp), %rcx
callq 0x7c1a
movq 0x20(%rsp), %r14
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
leaq 0x390(%rsp), %rbx
leaq 0x170(%rsp), %r15
leaq 0x4d8(%rsp), %r13
leaq 0x68(%rsp), %rbp
cmpq (%rsp), %r14
je 0x7354
movl (%r14), %r12d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x7c93
movq %r15, %rdi
leaq 0x800a(%rip), %rsi      # 0xf279
movq %rbx, %rdx
callq 0x7c6f
movq %r13, %rdi
movq %r15, %rsi
leaq 0x7ffe(%rip), %rdx      # 0xf282
callq 0x7c50
movq %rbp, %rdi
movq %r13, %rsi
callq 0x42f0
movq %r13, %rdi
callq 0x3110
movq %r15, %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x3110
movq 0xfcfd(%rip), %rdi      # 0x16fb0
leaq 0x7fd3(%rip), %rsi      # 0xf28d
callq 0x32a0
movq %rax, %rdi
movl %r12d, %esi
callq 0x34a0
movq %rax, %rdi
leaq 0x8762(%rip), %rsi      # 0xfa36
callq 0x32a0
movq %rax, %rdi
callq 0x3130
movq 0xfcc8(%rip), %rdi      # 0x16fb0
leaq 0x7f6e(%rip), %rsi      # 0xf25d
callq 0x32a0
movq %rax, %r12
movq %rbp, %rdi
callq 0x46e0
movq %r12, %rdi
movl %eax, %esi
callq 0x34a0
movq %rax, %rdi
leaq 0x7f5e(%rip), %rsi      # 0xf271
callq 0x32a0
movq %rax, %rdi
callq 0x3130
movl 0x58(%rsp), %edx
movl 0x40(%rsp), %ecx
movq %r15, %rdi
movq %rbp, %rsi
callq 0xb778
movq %r15, %rdi
callq 0xb7a6
movq %r15, %rdi
callq 0x7cec
movq %rbp, %rdi
callq 0x481a
addq $0x4, %r14
jmp 0x724d
callq 0x3220
leaq 0x20(%rsp), %rdi
callq 0x7f7c
leaq 0x288(%rsp), %rdi
callq 0x7f7c
movl 0x14(%rsp), %ebx
movl 0x18(%rsp), %ebp
testb $0x1, %bpl
je 0x7513
movaps 0x7de7(%rip), %xmm0     # 0xf170
leaq 0x170(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0x390(%rsp), %rdi
pushq $0x4
popq %rdx
leaq 0x68(%rsp), %rcx
callq 0x7c1a
movups 0x7e04(%rip), %xmm0     # 0xf1b4
leaq 0x170(%rsp), %rsi
movaps %xmm0, (%rsi)
movabsq $0x800000007, %rax      # imm = 0x800000007
movq %rax, 0x10(%rsi)
leaq 0x288(%rsp), %rdi
pushq $0x6
popq %rdx
leaq 0x68(%rsp), %rcx
callq 0x7c1a
movq 0x390(%rsp), %rax
movq 0x398(%rsp), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x68(%rsp), %r13
leaq 0x170(%rsp), %r14
leaq 0x4b8(%rsp), %r12
cmpq 0x18(%rsp), %rax
je 0x74f5
movq %rax, 0x8(%rsp)
movl (%rax), %ebp
movq 0x288(%rsp), %rbx
movq 0x290(%rsp), %rax
movq %rax, (%rsp)
cmpq (%rsp), %rbx
je 0x74e7
movl (%rbx), %r15d
movq 0xfb6e(%rip), %rdi      # 0x16fb0
leaq 0x7e83(%rip), %rsi      # 0xf2cc
callq 0x32a0
movq %rax, %rdi
movl %ebp, %esi
callq 0x34a0
movq 0xfb51(%rip), %rdi      # 0x16fb0
leaq 0x7e9e(%rip), %rsi      # 0xf304
callq 0x32a0
movq %rax, %rdi
movl %r15d, %esi
callq 0x34a0
movq %rax, %rdi
leaq 0x7e8f(%rip), %rsi      # 0xf30f
callq 0x32a0
movq %rax, %rdi
callq 0x3130
movq %r13, %rdi
movl %ebp, %esi
callq 0x7c93
movq %r14, %rdi
leaq 0x7e78(%rip), %rsi      # 0xf319
movq %r13, %rdx
callq 0x7c6f
movq %r12, %rdi
movq %r14, %rsi
leaq 0x7f7f(%rip), %rdx      # 0xf435
callq 0x7c50
movq %r12, %rdi
movl %r15d, %esi
callq 0xd59f
movq %r12, %rdi
callq 0x3110
movq %r14, %rdi
callq 0x3110
movq %r13, %rdi
callq 0x3110
addq $0x4, %rbx
jmp 0x742e
movq 0x8(%rsp), %rax
addq $0x4, %rax
jmp 0x7408
leaq 0x288(%rsp), %rdi
callq 0x7f7c
leaq 0x390(%rsp), %rdi
callq 0x7f7c
movl 0x14(%rsp), %ebx
testb $0x1, %bl
je 0x7896
movq 0xfa8d(%rip), %rdi      # 0x16fb0
leaq 0x7dfd(%rip), %rsi      # 0xf327
callq 0x32a0
movq %rax, %rdi
callq 0x3130
movups 0x7cb2(%rip), %xmm0     # 0xf1f0
leaq 0x170(%rsp), %rsi
movaps %xmm0, 0x20(%rsi)
movups 0x7c8f(%rip), %xmm0     # 0xf1e0
movaps %xmm0, 0x10(%rsi)
movups 0x7c74(%rip), %xmm0     # 0xf1d0
movaps %xmm0, (%rsi)
movabsq $0x408f400000000000, %rax # imm = 0x408F400000000000
movq %rax, 0x30(%rsi)
leaq 0x20(%rsp), %rdi
pushq $0x7
popq %rdx
leaq 0x68(%rsp), %rcx
callq 0x7d00
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x298(%rsp), %r14
leaq 0x48(%rsp), %rbx
leaq 0x370(%rsp), %r12
leaq 0x288(%rsp), %rbp
leaq 0x58(%rsp), %r15
cmpq 0x18(%rsp), %rcx
je 0x77c2
movq %rcx, 0x8(%rsp)
movsd (%rcx), %xmm0
movsd %xmm0, (%rsp)
movq %r12, %rdi
leaq 0x7d88(%rip), %rsi      # 0xf35b
leaq 0x170(%rsp), %rdx
callq 0x50d8
leaq 0x68(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x42f0
movq %r12, %rdi
callq 0x3110
leaq 0x170(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0xb3a4
leaq 0x390(%rsp), %rdi
movq %r12, %rsi
movsd (%rsp), %xmm0
callq 0x96d6
leaq 0x2b8(%rsp), %rax
movq %rax, 0x288(%rsp)
movq $0x1, 0x290(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movl $0x3f800000, 0x2a8(%rsp) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
leaq 0x3a0(%rsp), %r13
movq (%r13), %r13
testq %r13, %r13
je 0x76ab
movups 0x8(%r13), %xmm0
movaps %xmm0, 0x40(%rsp)
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x80ec
testq %rax, %rax
je 0x768c
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x8168
incl (%rax)
jmp 0x765a
movq 0x48(%rsp), %rax
movq %rax, 0x58(%rsp)
movl $0x1, 0x60(%rsp)
movq %rbp, %rdi
movq %r15, %rsi
callq 0x8186
jmp 0x765a
movq 0xf8fe(%rip), %rdi      # 0x16fb0
leaq 0x7cb6(%rip), %rsi      # 0xf36f
callq 0x32a0
movq 0x2a0(%rsp), %rsi
movq %rax, %rdi
callq 0x31d0
movq %rax, %rdi
leaq 0x7cae(%rip), %rsi      # 0xf386
callq 0x32a0
movq %rax, %rdi
movsd (%rsp), %xmm0
callq 0x3430
movq %rax, %rdi
callq 0x3130
movq 0xf8b7(%rip), %rdi      # 0x16fb0
leaq 0x7c9f(%rip), %rsi      # 0xf39f
callq 0x32a0
xorl %r13d, %r13d
movq %r14, %r12
movq (%r14), %r14
testq %r14, %r14
je 0x773c
movl 0x10(%r14), %esi
cmpl $0x2, %esi
jl 0x770b
movq 0xf88d(%rip), %rdi      # 0x16fb0
callq 0x34a0
movq %rax, %rdi
leaq 0x7c52(%rip), %rsi      # 0xf384
callq 0x32a0
incl %r13d
jmp 0x770b
movq 0xf86d(%rip), %rdi      # 0x16fb0
callq 0x3130
movq %r12, %r14
movq 0xf85e(%rip), %rdi      # 0x16fb0
leaq 0x7c75(%rip), %rsi      # 0xf3ce
callq 0x32a0
movq %rax, %rdi
movl %r13d, %esi
callq 0x34a0
movq %rax, %rdi
leaq 0x7c66(%rip), %rsi      # 0xf3d9
callq 0x32a0
movq %rax, %rdi
callq 0x3130
movq %rbp, %rdi
callq 0x7dd0
leaq 0x390(%rsp), %rdi
callq 0x7e78
leaq 0x170(%rsp), %rdi
callq 0x7cec
leaq 0x68(%rsp), %rdi
callq 0x481a
movq 0x8(%rsp), %rcx
addq $0x8, %rcx
leaq 0x370(%rsp), %r12
jmp 0x75b0
movq 0xf7e7(%rip), %rdi      # 0x16fb0
leaq 0x7c24(%rip), %rsi      # 0xf3f4
callq 0x32a0
movq %rax, %rdi
callq 0x3130
leaq 0x170(%rsp), %rsi
movups 0x7a04(%rip), %xmm0     # 0xf1f0
movaps %xmm0, 0x20(%rsi)
movups 0x79e9(%rip), %xmm0     # 0xf1e0
movaps %xmm0, 0x10(%rsi)
movups 0x79ce(%rip), %xmm0     # 0xf1d0
movaps %xmm0, (%rsi)
movabsq $0x408f400000000000, %rax # imm = 0x408F400000000000
movq %rax, 0x30(%rsi)
leaq 0x68(%rsp), %rdi
pushq $0x7
popq %rdx
leaq 0x390(%rsp), %rcx
callq 0x7d00
movq 0x68(%rsp), %r12
movq 0x70(%rsp), %r13
leaq 0x7beb(%rip), %rbx      # 0xf424
leaq 0x498(%rsp), %r14
leaq 0x170(%rsp), %r15
cmpq %r13, %r12
je 0x7882
movsd (%r12), %xmm0
movsd %xmm0, (%rsp)
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x50d8
movq %r14, %rdi
movsd (%rsp), %xmm0
callq 0xdb6b
movq %r14, %rdi
callq 0x3110
addq $0x8, %r12
jmp 0x7849
leaq 0x68(%rsp), %rdi
callq 0x8062
leaq 0x20(%rsp), %rdi
callq 0x8062
xorl %eax, %eax
addq $0x558, %rsp            # imm = 0x558
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x6c24
movq 0xf702(%rip), %rax      # 0x16fb8
movq (%rax), %rcx
leaq 0x7948(%rip), %rdi      # 0xf208
pushq $0xf
popq %rsi
pushq $0x1
popq %rdx
callq 0x34f0
callq 0x6c24
jmp 0x792c
jmp 0x78fe
jmp 0x7985
jmp 0x7a5d
movq %rax, %rbx
jmp 0x7c04
jmp 0x78fe
jmp 0x7a5d
jmp 0x7a5d
jmp 0x7a5d
jmp 0x7ab1
jmp 0x78fe
movq %rax, %rbx
jmp 0x7c11
jmp 0x792c
movq %rax, %rbx
jmp 0x791d
movq %rax, %rbx
leaq 0x498(%rsp), %rdi
callq 0x3110
leaq 0x68(%rsp), %rdi
callq 0x8062
jmp 0x7be8
movq %rax, %rbx
jmp 0x7be8
movq %rax, %rbx
leaq 0x370(%rsp), %rdi
callq 0x3110
jmp 0x7be8
movq %rax, %rbx
jmp 0x7bde
movq %rax, %rbx
jmp 0x7bd1
movq %rax, %rbx
leaq 0x4d8(%rsp), %rdi
callq 0x3110
jmp 0x7995
jmp 0x7b12
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
callq 0x7cec
jmp 0x7b15
movq %rax, %rbx
jmp 0x7b1f
movq %rax, %rbx
jmp 0x79a2
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
callq 0x3110
leaq 0x390(%rsp), %rdi
callq 0x3110
jmp 0x7b1f
jmp 0x79ca
movq %rax, %rbx
leaq 0x390(%rsp), %rdi
callq 0x7cec
jmp 0x79cd
jmp 0x7a1c
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x7cec
jmp 0x7a1f
movq %rax, %rbx
jmp 0x7b3b
movq %rax, %rbx
jmp 0x7a08
movq %rax, %rbx
jmp 0x79fb
movq %rax, %rbx
leaq 0x518(%rsp), %rdi
callq 0x3110
leaq 0x170(%rsp), %rdi
callq 0x3110
leaq 0x68(%rsp), %rdi
callq 0x3110
jmp 0x7b3b
jmp 0x7b2b
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
callq 0x7cec
jmp 0x7b2e
movq %rax, %rbx
leaq 0x4f8(%rsp), %rdi
callq 0x3110
jmp 0x7a6d
jmp 0x7b47
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
callq 0x7cec
jmp 0x7b4a
movq %rax, %rbx
jmp 0x7b54
movq %rax, %rbx
jmp 0x7a7a
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
callq 0x3110
leaq 0x390(%rsp), %rdi
callq 0x3110
jmp 0x7b54
jmp 0x7aa2
movq %rax, %rbx
leaq 0x390(%rsp), %rdi
callq 0x7cec
jmp 0x7aa5
jmp 0x7af1
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x7cec
jmp 0x7af4
movq %rax, %rbx
jmp 0x7b71
movq %rax, %rbx
jmp 0x7ae0
movq %rax, %rbx
jmp 0x7ad3
movq %rax, %rbx
leaq 0x538(%rsp), %rdi
callq 0x3110
leaq 0x170(%rsp), %rdi
callq 0x3110
leaq 0x68(%rsp), %rdi
callq 0x3110
jmp 0x7b71
jmp 0x7b61
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
callq 0x7cec
jmp 0x7b64
jmp 0x7bb4
jmp 0x7bb4
jmp 0x7bb4
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x481a
leaq 0x20(%rsp), %rdi
callq 0x7f7c
jmp 0x7b54
movq %rax, %rbx
leaq 0x288(%rsp), %rdi
callq 0x481a
leaq 0x40(%rsp), %rdi
callq 0x7f7c
jmp 0x7b71
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x481a
leaq 0x288(%rsp), %rdi
jmp 0x7c0c
movq %rax, %rbx
leaq 0x288(%rsp), %rdi
callq 0x481a
leaq 0x20(%rsp), %rdi
jmp 0x7c0c
jmp 0x7bb4
jmp 0x7bb4
jmp 0x7bf4
movq %rax, %rbx
jmp 0x7ba8
movq %rax, %rbx
jmp 0x7b9b
movq %rax, %rbx
leaq 0x4b8(%rsp), %rdi
callq 0x3110
leaq 0x170(%rsp), %rdi
callq 0x3110
leaq 0x68(%rsp), %rdi
callq 0x3110
jmp 0x7bf7
movq %rax, %rbx
leaq 0x288(%rsp), %rdi
callq 0x7dd0
leaq 0x390(%rsp), %rdi
callq 0x7e78
leaq 0x170(%rsp), %rdi
callq 0x7cec
leaq 0x68(%rsp), %rdi
callq 0x481a
leaq 0x20(%rsp), %rdi
callq 0x8062
jmp 0x7c11
movq %rax, %rbx
leaq 0x288(%rsp), %rdi
callq 0x7f7c
leaq 0x390(%rsp), %rdi
callq 0x7f7c
movq %rbx, %rdi
callq 0x34b0
nop