// File: fjamour[P]icentral/src/main.cc
// Function: kdd_exp_main(int, char**, int, int)
void kdd_exp_main(int argc, char** argv, int rank, int size)
{
    int                     num_edges, rand_seed, num_threads;
    bool                    do_icent, do_bcc_icent, ext_edges;
    bool                    do_fast_brandes, do_brandes, do_qube, do_inc_qube;
    operation_t             op;
    //for qube and incremental qube, old implementation will be used, and
    //no parallelization
    vector<string>          path_vec;
    vector<vector<edge_t> > edge_vec2;
    vector<double>          brandes_tm_vec;
    
    MPI_Status    status;
    
    if(argc != 2) {
        if(rank == 0) {
            printf("Pass one parameter, path with experiment details\n");
            printf("deletion\n");
            printf("num_edges, num_threads, rand_seed\n");
            printf("external_edges, do_icent, do_bcc_icent\n");
            printf("do_fast_brandes, do_brandes, do_qube, do_inc_qube\n");
            printf("list of graph paths\n");
            printf("if external_edges is nonzero a file with graph_name.edges is expected\n");
            printf("external edges are assumed to be in the graph\n");
            printf("external edges should not be bridges\n");
            printf("if deletion is 1, bcc_icent with deletions will be invoked");
        }
        return;
        //exit(1);
    } else {
        FILE* fin = fopen(argv[1], "r");
        int del_int;
        fscanf(fin, "%d", &del_int);
        if(del_int == 1) {
            op = DELETION;
        } else {
            op = INSERTION;
        }
        fscanf(fin, "%d, %d, %d\n", &num_edges, &num_threads, &rand_seed);
        int t1, t2, t3, t4;
        fscanf(fin, "%d, %d, %d\n", &t1, &t2, &t3);
        ext_edges       = (t1 != 0);
        do_icent        = (t2 != 0);
        do_bcc_icent    = (t3 != 0);
        fscanf(fin, "%d, %d, %d, %d\n", &t1, &t2, &t3, &t4);
        do_fast_brandes = (t1 != 0);
        do_brandes      = (t2 != 0);
        do_qube         = (t3 != 0);
        do_inc_qube     = (t4 != 0);
        
        char buff[1024*4];
        while(fscanf(fin, "%s\n", buff) != EOF) {
            string path = buff;
            path_vec.push_back(path);
        }
        fclose(fin);
        //fill edges, read from file if needed
        if(ext_edges) {
            //these are edges in the graph, and have to be removed then inserted
            //in order
            for(int i = 0; i < path_vec.size(); ++i) {
                vector<edge_t> edge_vec;
                string edge_file_path = path_vec[i] + ".edges";
                fin = fopen(edge_file_path.c_str(), "r");
                int v1, v2;
                while(fscanf(fin, "%d %d\n", &v1, &v2) != EOF) {
                    edge_vec.push_back(make_pair(v1, v2));
                }
                edge_vec2.push_back(edge_vec);
                fclose(fin);
            }
        } else {
            for(int p = 0; p < path_vec.size(); ++p) {
                string graph_path = path_vec[p];
                graph_t graph;
                graph.read_graph(graph_path);
                graph.graph_name = extract_graph_name(graph_path);
                vector<edge_t> edge_vec;
                
                //gen_rand_edges(num_edges, graph, edge_vec);
                //edge_vec2.push_back(edge_vec);
                if(rank == 0) {
                    srand(rand_seed);
                    //master generates random edges and sends to everyone
                    if(op == INSERTION) {
                        gen_rand_edges(num_edges, graph, edge_vec);
                    } else if(op == DELETION) {
                        gen_rand_edges_deletions(num_edges, graph, edge_vec);
                    }
                    
                    //TMP code to make sure new random edges are generated.. Safely remove!
                    //for(int re = 0; re < edge_vec.size(); ++re) {
                    //    printf("e(%d, %d)\n", edge_vec[re].first, edge_vec[re].second);
                    //}
                    /////
                    //printf("RANK[%d] -- e[0]: %u %u\n", rank, edge_vec[4].first, edge_vec[4].second);
                    for(int p = 1; p < size; ++p) {
                        MPI_Send(&edge_vec[0], edge_vec.size()*sizeof(edge_t), MPI_CHAR, p, 0, MPI_COMM_WORLD);
                    }
                } else {
                    //slaves get random edges from the master
                    edge_vec.resize(num_edges);
                    MPI_Recv(&edge_vec[0], edge_vec.size()*sizeof(edge_t), MPI_CHAR, 0, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
                    //printf("RANK[%d] -- e[0]: %u %u\n", rank, edge_vec[4].first, edge_vec[4].second);
                }
                edge_vec2.push_back(edge_vec);
            }
        }
    }
    
    int num_graphs = path_vec.size();
    brandes_tm_vec.resize(num_graphs);
    fill(brandes_tm_vec.begin(), brandes_tm_vec.end(), 1.0);
    
    timer tm;
    vector<double> BC_vec;
    double brandes_time;
    
    if(do_bcc_icent) {
        if(rank == 0) {
            printf("\n\n\n");
            printf("Starting BCC+iCentral [%d threads] [%s]...\n", num_threads, (op==DELETION?"DELETION":"INSERTION"));
            printf("========================================\n");
        }
        for(int i = 0; i < path_vec.size(); ++i) {
            graph_t graph;
            string path = path_vec[i].c_str();
            graph.read_graph(path);
            graph.graph_name = extract_graph_name(path_vec[i]);
            timing__Update_BC_graph(
                graph,
                edge_vec2[i], 
                -1,//do all sources (not approximation) 
                BCC, 
                false, 
                brandes_tm_vec[i], 
                num_threads,
                ext_edges,
                op
                );
            //synchronization barrier so that no one starts next graph before others
            MPI_Barrier(MPI_COMM_WORLD);
        }
    }
    

    

}

// Assembly:
subq $0x15d8, %rsp           # imm = 0x15D8
movl %edi, 0x15d4(%rsp)
movq %rsi, 0x15c8(%rsp)
movl %edx, 0x15c4(%rsp)
movl %ecx, 0x15c0(%rsp)
leaq 0x1590(%rsp), %rdi
callq 0x5f3f0
leaq 0x1578(%rsp), %rdi
callq 0x5f0e0
leaq 0x1560(%rsp), %rdi
callq 0xfa00
cmpl $0x2, 0x15d4(%rsp)
je 0x5e082
cmpl $0x0, 0x15c4(%rsp)
jne 0x5e072
leaq 0x1dede(%rip), %rdi     # 0x7be9c
xorl %eax, %eax
callq 0x9040
jmp 0x5dfc7
leaq 0x1e034(%rip), %rdi     # 0x7c002
xorl %eax, %eax
callq 0x9040
jmp 0x5dfd7
leaq 0x1e02e(%rip), %rdi     # 0x7c00c
xorl %eax, %eax
callq 0x9040
jmp 0x5dfe7
leaq 0x1e041(%rip), %rdi     # 0x7c02f
xorl %eax, %eax
callq 0x9040
jmp 0x5dff7
leaq 0x1e059(%rip), %rdi     # 0x7c057
xorl %eax, %eax
callq 0x9040
jmp 0x5e007
leaq 0x1df19(%rip), %rdi     # 0x7bf27
xorl %eax, %eax
callq 0x9040
jmp 0x5e017
leaq 0x1e06c(%rip), %rdi     # 0x7c08a
xorl %eax, %eax
callq 0x9040
jmp 0x5e027
leaq 0x1e0a3(%rip), %rdi     # 0x7c0d1
xorl %eax, %eax
callq 0x9040
jmp 0x5e037
leaq 0x1e0c2(%rip), %rdi     # 0x7c100
xorl %eax, %eax
callq 0x9040
jmp 0x5e047
leaq 0x1e0d8(%rip), %rdi     # 0x7c126
xorl %eax, %eax
callq 0x9040
jmp 0x5e057
jmp 0x5e072
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1540(%rsp)
movl %eax, 0x153c(%rsp)
jmp 0x5ecbd
movl $0x1, 0x1538(%rsp)
jmp 0x5ec81
movq 0x15c8(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x1dea7(%rip), %rsi     # 0x7bf3c
callq 0x9890
movq %rax, 0xb0(%rsp)
jmp 0x5e0a4
movq 0xb0(%rsp), %rax
movq %rax, 0x1530(%rsp)
movq 0x1530(%rsp), %rdi
leaq 0x1e09e(%rip), %rsi     # 0x7c161
xorl %eax, %eax
leaq 0x152c(%rsp), %rdx
callq 0x9d90
jmp 0x5e0d4
cmpl $0x1, 0x152c(%rsp)
jne 0x5e0eb
movl $0x1, 0x15a8(%rsp)
jmp 0x5e0f6
movl $0x0, 0x15a8(%rsp)
movq 0x1530(%rsp), %rdi
leaq 0x1de4e(%rip), %rsi     # 0x7bf53
xorl %eax, %eax
leaq 0x15bc(%rsp), %rdx
leaq 0x15b4(%rsp), %rcx
leaq 0x15b8(%rsp), %r8
callq 0x9d90
jmp 0x5e126
movq 0x1530(%rsp), %rdi
leaq 0x1de1e(%rip), %rsi     # 0x7bf53
xorl %eax, %eax
leaq 0x1528(%rsp), %rdx
leaq 0x1524(%rsp), %rcx
leaq 0x1520(%rsp), %r8
callq 0x9d90
jmp 0x5e156
movl 0x1528(%rsp), %eax
testl %eax, %eax
setne 0x15b1(%rsp)
movl 0x1524(%rsp), %eax
testl %eax, %eax
setne 0x15b3(%rsp)
movl 0x1520(%rsp), %eax
testl %eax, %eax
setne 0x15b2(%rsp)
movq 0x1530(%rsp), %rdi
leaq 0x1ddb7(%rip), %rsi     # 0x7bf4f
xorl %eax, %eax
leaq 0x1528(%rsp), %rdx
leaq 0x1524(%rsp), %rcx
leaq 0x1520(%rsp), %r8
leaq 0x151c(%rsp), %r9
callq 0x9d90
jmp 0x5e1c1
cmpl $0x0, 0x1528(%rsp)
setne %al
andb $0x1, %al
movb %al, 0x15b0(%rsp)
cmpl $0x0, 0x1524(%rsp)
setne %al
andb $0x1, %al
movb %al, 0x15af(%rsp)
cmpl $0x0, 0x1520(%rsp)
setne %al
andb $0x1, %al
movb %al, 0x15ae(%rsp)
cmpl $0x0, 0x151c(%rsp)
setne %al
andb $0x1, %al
movb %al, 0x15ad(%rsp)
movq 0x1530(%rsp), %rdi
leaq 0x1d106(%rip), %rsi     # 0x7b326
xorl %eax, %eax
leaq 0x510(%rsp), %rdx
callq 0x9d90
movl %eax, 0xac(%rsp)
jmp 0x5e238
movl 0xac(%rsp), %eax
cmpl $-0x1, %eax
je 0x5e2fe
leaq 0x4ef(%rsp), %rdi
movq %rdi, 0xa0(%rsp)
callq 0x9d00
movq 0xa0(%rsp), %rdx
leaq 0x4f0(%rsp), %rdi
leaq 0x510(%rsp), %rsi
callq 0x5ef00
jmp 0x5e27c
leaq 0x4ef(%rsp), %rdi
callq 0x97d0
leaq 0x1590(%rsp), %rdi
leaq 0x4f0(%rsp), %rsi
callq 0x5f400
jmp 0x5e2a0
leaq 0x4f0(%rsp), %rdi
callq 0x9410
jmp 0x5e211
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1540(%rsp)
movl %eax, 0x153c(%rsp)
leaq 0x4ef(%rsp), %rdi
callq 0x97d0
jmp 0x5ecbd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1540(%rsp)
movl %eax, 0x153c(%rsp)
leaq 0x4f0(%rsp), %rdi
callq 0x9410
jmp 0x5ecbd
movq 0x1530(%rsp), %rdi
callq 0x9710
jmp 0x5e30d
testb $0x1, 0x15b1(%rsp)
je 0x5e50f
movl $0x0, 0x4e8(%rsp)
movslq 0x4e8(%rsp), %rax
movq %rax, 0x98(%rsp)
leaq 0x1590(%rsp), %rdi
callq 0x5f0f0
movq %rax, %rcx
movq 0x98(%rsp), %rax
cmpq %rcx, %rax
jae 0x5e50a
leaq 0x4d0(%rsp), %rdi
callq 0x4db80
movslq 0x4e8(%rsp), %rsi
leaq 0x1590(%rsp), %rdi
callq 0x5f110
movq %rax, %rsi
leaq 0x1dde1(%rip), %rdx     # 0x7c164
leaq 0x4b0(%rsp), %rdi
callq 0x5f660
jmp 0x5e392
leaq 0x4b0(%rsp), %rdi
callq 0x9250
movq %rax, %rdi
leaq 0x1db93(%rip), %rsi     # 0x7bf3c
callq 0x9890
movq %rax, 0x90(%rsp)
jmp 0x5e3b8
movq 0x90(%rsp), %rax
movq %rax, 0x1530(%rsp)
movq 0x1530(%rsp), %rdi
leaq 0x1dd94(%rip), %rsi     # 0x7c16b
xorl %eax, %eax
leaq 0x4ac(%rsp), %rdx
leaq 0x4a8(%rsp), %rcx
callq 0x9d90
movl %eax, 0x8c(%rsp)
jmp 0x5e3f7
movl 0x8c(%rsp), %eax
cmpl $-0x1, %eax
je 0x5e4a2
leaq 0x4ac(%rsp), %rdi
leaq 0x4a8(%rsp), %rsi
callq 0x5f6f0
movq %rax, 0x80(%rsp)
jmp 0x5e426
movq 0x80(%rsp), %rax
movq %rax, 0x498(%rsp)
leaq 0x4a0(%rsp), %rdi
leaq 0x498(%rsp), %rsi
callq 0x5f090
jmp 0x5e44d
leaq 0x4d0(%rsp), %rdi
leaq 0x4a0(%rsp), %rsi
callq 0x4db90
jmp 0x5e464
jmp 0x5e3c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1540(%rsp)
movl %eax, 0x153c(%rsp)
jmp 0x5e4f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1540(%rsp)
movl %eax, 0x153c(%rsp)
leaq 0x4b0(%rsp), %rdi
callq 0x9410
jmp 0x5e4f8
leaq 0x1578(%rsp), %rdi
leaq 0x4d0(%rsp), %rsi
callq 0x5f130
jmp 0x5e4b9
movq 0x1530(%rsp), %rdi
callq 0x9710
jmp 0x5e4c8
leaq 0x4b0(%rsp), %rdi
callq 0x9410
leaq 0x4d0(%rsp), %rdi
callq 0x4dc40
movl 0x4e8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4e8(%rsp)
jmp 0x5e326
leaq 0x4d0(%rsp), %rdi
callq 0x4dc40
jmp 0x5ecbd
jmp 0x5e8b6
movl $0x0, 0x494(%rsp)
movslq 0x494(%rsp), %rax
movq %rax, 0x78(%rsp)
leaq 0x1590(%rsp), %rdi
callq 0x5f0f0
movq %rax, %rcx
movq 0x78(%rsp), %rax
cmpq %rcx, %rax
jae 0x5e8b4
movslq 0x494(%rsp), %rsi
leaq 0x1590(%rsp), %rdi
callq 0x5f110
movq %rax, %rsi
leaq 0x470(%rsp), %rdi
callq 0x9270
jmp 0x5e56c
leaq 0x348(%rsp), %rdi
callq 0x5eda0
jmp 0x5e57b
leaq 0x328(%rsp), %rdi
leaq 0x470(%rsp), %rsi
callq 0x9270
jmp 0x5e592
leaq 0x348(%rsp), %rdi
leaq 0x328(%rsp), %rsi
callq 0x56b50
jmp 0x5e5a9
leaq 0x328(%rsp), %rdi
callq 0x9410
leaq 0x2e8(%rsp), %rdi
leaq 0x470(%rsp), %rsi
callq 0x9270
jmp 0x5e5cd
leaq 0x308(%rsp), %rdi
leaq 0x2e8(%rsp), %rsi
callq 0x789e0
jmp 0x5e5e4
leaq 0x348(%rsp), %rdi
addq $0x108, %rdi            # imm = 0x108
leaq 0x308(%rsp), %rsi
callq 0x98e0
leaq 0x308(%rsp), %rdi
callq 0x9410
leaq 0x2e8(%rsp), %rdi
callq 0x9410
leaq 0x2d0(%rsp), %rdi
callq 0x4db80
cmpl $0x0, 0x15c4(%rsp)
jne 0x5e7c8
movl 0x15b8(%rsp), %edi
callq 0x96f0
cmpl $0x0, 0x15a8(%rsp)
jne 0x5e716
movl 0x15bc(%rsp), %edi
leaq 0x348(%rsp), %rsi
leaq 0x2d0(%rsp), %rdx
callq 0x47910
jmp 0x5e66d
jmp 0x5e742
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1540(%rsp)
movl %eax, 0x153c(%rsp)
jmp 0x5e8a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1540(%rsp)
movl %eax, 0x153c(%rsp)
jmp 0x5e895
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1540(%rsp)
movl %eax, 0x153c(%rsp)
leaq 0x328(%rsp), %rdi
callq 0x9410
jmp 0x5e895
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1540(%rsp)
movl %eax, 0x153c(%rsp)
leaq 0x2e8(%rsp), %rdi
callq 0x9410
jmp 0x5e895
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1540(%rsp)
movl %eax, 0x153c(%rsp)
leaq 0x2d0(%rsp), %rdi
callq 0x4dc40
jmp 0x5e895
cmpl $0x1, 0x15a8(%rsp)
jne 0x5e740
movl 0x15bc(%rsp), %edi
leaq 0x348(%rsp), %rsi
leaq 0x2d0(%rsp), %rdx
callq 0x47a60
jmp 0x5e73e
jmp 0x5e740
jmp 0x5e742
movl $0x1, 0x2cc(%rsp)
movl 0x2cc(%rsp), %eax
cmpl 0x15c0(%rsp), %eax
jge 0x5e7c6
xorl %eax, %eax
movl %eax, 0x74(%rsp)
movl %eax, %esi
leaq 0x2d0(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0x4dbc0
movq 0x60(%rsp), %rdi
movq %rax, 0x68(%rsp)
callq 0x47680
movq 0x68(%rsp), %rdi
movl 0x74(%rsp), %r8d
movl %eax, %esi
shll $0x3, %esi
movl 0x2cc(%rsp), %ecx
movq 0x3c805(%rip), %rdx     # 0x9afa8
movq 0x3c80e(%rip), %r9      # 0x9afb8
callq 0x9220
jmp 0x5e7b1
jmp 0x5e7b3
movl 0x2cc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2cc(%rsp)
jmp 0x5e74d
jmp 0x5e841
movslq 0x15bc(%rsp), %rsi
leaq 0x2d0(%rsp), %rdi
callq 0x5f720
jmp 0x5e7df
xorl %eax, %eax
movl %eax, 0x5c(%rsp)
movl %eax, %esi
leaq 0x2d0(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x4dbc0
movq 0x48(%rsp), %rdi
movq %rax, 0x50(%rsp)
callq 0x47680
movq 0x50(%rsp), %rdi
movl 0x5c(%rsp), %ecx
movl %eax, %esi
shll $0x3, %esi
movq %rsp, %rax
leaq 0x1548(%rsp), %rdx
movq %rdx, (%rax)
movq 0x3c77d(%rip), %rdx     # 0x9afa8
movq 0x3c786(%rip), %r9      # 0x9afb8
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x95f0
jmp 0x5e83f
jmp 0x5e841
leaq 0x1578(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
callq 0x5f130
jmp 0x5e858
leaq 0x2d0(%rsp), %rdi
callq 0x4dc40
leaq 0x348(%rsp), %rdi
callq 0x5efc0
leaq 0x470(%rsp), %rdi
callq 0x9410
movl 0x494(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x494(%rsp)
jmp 0x5e51a
leaq 0x348(%rsp), %rdi
callq 0x5efc0
leaq 0x470(%rsp), %rdi
callq 0x9410
jmp 0x5ecbd
jmp 0x5e8b6
jmp 0x5e8b8
leaq 0x1590(%rsp), %rdi
callq 0x5f0f0
movl %eax, 0x2c8(%rsp)
movslq 0x2c8(%rsp), %rsi
leaq 0x1560(%rsp), %rdi
callq 0xf680
jmp 0x5e8e3
leaq 0x1560(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0xf760
movq 0x40(%rsp), %rdi
movq %rax, 0x2c0(%rsp)
callq 0xf790
movq %rax, 0x2b8(%rsp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x2b0(%rsp)
movq 0x2c0(%rsp), %rdi
movq 0x2b8(%rsp), %rsi
leaq 0x2b0(%rsp), %rdx
callq 0xf720
jmp 0x5e940
leaq 0x278(%rsp), %rdi
callq 0xfa00
testb $0x1, 0x15b2(%rsp)
je 0x5ec69
cmpl $0x0, 0x15c4(%rsp)
jne 0x5e9d3
leaq 0x1d4b4(%rip), %rdi     # 0x7be20
xorl %eax, %eax
callq 0x9040
jmp 0x5e975
movl 0x15b4(%rsp), %esi
movl 0x15a8(%rsp), %eax
subl $0x1, %eax
leaq 0x1d811(%rip), %rax     # 0x7c19e
leaq 0x1d813(%rip), %rdx     # 0x7c1a7
cmoveq %rax, %rdx
leaq 0x1d7d3(%rip), %rdi     # 0x7c172
xorl %eax, %eax
callq 0x9040
jmp 0x5e9a8
leaq 0x1c943(%rip), %rdi     # 0x7b2f2
xorl %eax, %eax
callq 0x9040
jmp 0x5e9b8
jmp 0x5e9d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1540(%rsp)
movl %eax, 0x153c(%rsp)
jmp 0x5ecb0
movl $0x0, 0x26c(%rsp)
movslq 0x26c(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x1590(%rsp), %rdi
callq 0x5f0f0
movq %rax, %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
jae 0x5ec67
leaq 0x140(%rsp), %rdi
callq 0x5eda0
jmp 0x5ea18
movslq 0x26c(%rsp), %rsi
leaq 0x1590(%rsp), %rdi
callq 0x5f110
movq %rax, %rdi
callq 0x9250
movq %rax, 0x28(%rsp)
leaq 0x11f(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x9d00
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0x120(%rsp), %rdi
callq 0x5ef00
jmp 0x5ea65
leaq 0x11f(%rsp), %rdi
callq 0x97d0
leaq 0xf8(%rsp), %rdi
leaq 0x120(%rsp), %rsi
callq 0x9270
jmp 0x5ea89
leaq 0x140(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x56b50
jmp 0x5eaa0
leaq 0xf8(%rsp), %rdi
callq 0x9410
movslq 0x26c(%rsp), %rsi
leaq 0x1590(%rsp), %rdi
callq 0x5f110
movq %rax, %rsi
leaq 0xb8(%rsp), %rdi
callq 0x9270
jmp 0x5ead4
leaq 0xd8(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x789e0
jmp 0x5eaeb
leaq 0x248(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
movq %rsi, 0x18(%rsp)
callq 0x98e0
movq 0x18(%rsp), %rdi
callq 0x9410
leaq 0xb8(%rsp), %rdi
callq 0x9410
movslq 0x26c(%rsp), %rsi
leaq 0x1578(%rsp), %rdi
callq 0x58990
movq %rax, 0x20(%rsp)
movslq 0x26c(%rsp), %rsi
leaq 0x1560(%rsp), %rdi
callq 0xfa30
movq 0x20(%rsp), %rsi
movsd (%rax), %xmm0
movl 0x15b4(%rsp), %r9d
movl 0x15a8(%rsp), %edx
movzbl 0x15b1(%rsp), %ecx
movq %rsp, %rax
movl %edx, 0x8(%rax)
andl $0x1, %ecx
movl %ecx, (%rax)
leaq 0x140(%rsp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x5a720
jmp 0x5eb90
movq 0x3c421(%rip), %rdi     # 0x9afb8
callq 0x94e0
jmp 0x5eb9e
leaq 0x120(%rsp), %rdi
callq 0x9410
leaq 0x140(%rsp), %rdi
callq 0x5efc0
movl 0x26c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x26c(%rsp)
jmp 0x5e9de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1540(%rsp)
movl %eax, 0x153c(%rsp)
leaq 0x11f(%rsp), %rdi
callq 0x97d0
jmp 0x5ec58
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1540(%rsp)
movl %eax, 0x153c(%rsp)
jmp 0x5ec4b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1540(%rsp)
movl %eax, 0x153c(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x9410
jmp 0x5ec4b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1540(%rsp)
movl %eax, 0x153c(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0x9410
leaq 0x120(%rsp), %rdi
callq 0x9410
leaq 0x140(%rsp), %rdi
callq 0x5efc0
jmp 0x5ecb0
jmp 0x5ec69
leaq 0x278(%rsp), %rdi
callq 0xfa50
movl $0x0, 0x1538(%rsp)
leaq 0x1560(%rsp), %rdi
callq 0xfa50
leaq 0x1578(%rsp), %rdi
callq 0x5f1a0
leaq 0x1590(%rsp), %rdi
callq 0x5f570
addq $0x15d8, %rsp           # imm = 0x15D8
retq
leaq 0x278(%rsp), %rdi
callq 0xfa50
leaq 0x1560(%rsp), %rdi
callq 0xfa50
leaq 0x1578(%rsp), %rdi
callq 0x5f1a0
leaq 0x1590(%rsp), %rdi
callq 0x5f570
movq 0x1540(%rsp), %rdi
callq 0x9cf0
nopw %cs:(%rax,%rax)