// File: /workspace/github_cpp_makefile_star2_O3/sharmaeklavya2[P]ddos-on-anycast/src/simulate.cpp
// Function: main
int main(int argc, char* argv[]) {

    if(argc == 2 && (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0)) {
        print_usage(stdout, argv[0]);
        printf("\n");
        print_help(stdout);
        return 0;
    }
    else if(argc != n_arg_list+1) {
        print_usage(stderr, argv[0]);
        return 2;
    }
    else {
        for(int i=0; i<n_arg_list; ++i) {
            arg_list[i].set_from_string(argv[i+1]);
            arg_name_to_index[arg_list[i].name] = i;
        }
    }

    GrowParams grow_params;

    int n_top = get_arg_i("n_top");
    int n_expand = get_arg_i("n_expand");
    double expand_degree = get_arg_f("expand_degree");
    double n_expand_sigma = get_arg_f("n_expand_sigma");
    grow_params.num_children = get_arg_i("n_down");
    grow_params.num_children_sigma = get_arg_f("n_down_sigma");
    grow_params.prob_multi_upstream = get_arg_f("p_upstream");
    grow_params.prob_self_multi_upstream = get_arg_f("p_self_upstream");
    grow_params.prob_side_peering = get_arg_f("p_peering");
    grow_params.prob_self_side_peering = get_arg_f("p_local_peering");
    int top_side_conns = get_arg_i("top_side_conns");
    int n_layers = get_arg_i("n_layers");
    ivec n_victims_list;
    strcpy(buffer, get_arg_s("n_victims").c_str());
    fill_ivec_from_str(buffer, n_victims_list, ",");
    int smart_distr = get_arg_i("smart_distr");
    int tries = get_arg_i("tries");
    int reps = get_arg_i("reps");
    int seed = get_arg_i("seed");
    if(seed == 0) {
        seed = int(time(NULL));
    }
    int prog_reps = get_arg_i("prog_reps");
    bool csvout = get_arg_i("csvout");

    CompleteGraphGen complete_gen(n_top);
    RandomConnectedGraphGen rcgen(n_expand, expand_degree);
    NormalOrderGraphGen explode_graph_gen(n_expand_sigma, rcgen);

    rng_t rng(seed);

    int n_n_victims = n_victims_list.size();
    vector<vector<double> > relcatches(n_n_victims), misdisfacts(n_n_victims);
    for(int i=0; i<n_n_victims; ++i) {
        relcatches[i].resize(reps, 0.0);
        misdisfacts[i].resize(reps, 0.0);
    }
    bool single_simulation = (reps == 1 && n_n_victims == 1 && (!csvout));

    for(int repi=0; repi < reps; ++repi) {
        if(reps > 1 && prog_reps > 0 && repi % prog_reps == 0) {
            fprintf(stderr, "reps: %d\r", repi);
        }
        Network network(complete_gen, rng(), false, top_side_conns);
        if(!network.long_sanity_check()) {
            puts("Network has inconsistencies!");
            return 1;
        }

        network.hgrow(explode_graph_gen, rng());

        for(int i=1; i<n_layers; ++i) {
            network.vgrow(grow_params, rng());
            network.hgrow(explode_graph_gen, rng());
        }

        int leaves = 0;
        for(int u: network.depthwise.back()) {
            if(!network.is_virtual(u)) {
                leaves++;
            }
        }
        if(single_simulation) {
            printf("Vertices: %d\n", network.num_vertices());
            printf("Edges: %d\n", network.num_edges());
            printf("Leaves: %d\n", leaves);
        }

        if(!network.long_sanity_check()) {
            puts("Network has inconsistencies!");
            network.print(stdout, false);
            return 1;
        }

        for(int i=0; i<n_n_victims; ++i) {
            int n_victims = n_victims_list[i];

            ivec victims, targets;
            if(smart_distr) {
                place_victims_using_toposort(network, n_victims, victims, seed, tries, 0.01);
            }
            else {
                place_victims_randomly(network, n_victims, victims, seed);
            }
            if(single_simulation) {
                printf("victims: %d\n\n", int(victims.size()));
            }
            attack(network, victims, targets, 1, 100);

            std::map<int, int> freq;
            for(int v: victims) {
                freq[v] = 0;
            }
            for(int u: network.depthwise.back()) {
                if(network.netsize[u] == 0) {
                    freq[targets[u]]++;
                }
            }
            vector<iipair> freq2(freq.begin(), freq.end());
            std::sort(freq2.begin(), freq2.end(), iipair_second_rcmp);
            double relcatch = double(freq2[0].second) / leaves;
            double misdisfact = double(freq2[0].second * victims.size()) / leaves;
            if(single_simulation) {
                if(victims.size() <= MAX_VICTIMS_TO_DISPLAY) {
                    printf("freqs (victim_id, attackers, relcatch, misdisfact):\n");
                    for(const iipair& p: freq2) {
                        double relcatch = double(p.second) / leaves;
                        double misdisfact = double(lli(p.second) * victims.size()) / leaves;
                        printf("  %5d: %4d: %lf: %lf\n", p.first, p.second, relcatch, misdisfact);
                    }
                }
                else {
                    printf("victim_id=%d, attackers=%d, relcatch=%lf, misdisfact=%lf\n",
                        freq2[0].first, freq2[0].second, relcatch, misdisfact);
                }
            }
            relcatches[i][repi] = relcatch;
            misdisfacts[i][repi] = misdisfact;
        }
    }

    if(!single_simulation) {
        if(reps > 1) {
            fprintf(stderr, "reps: %d\n", reps);
        }
        if(csvout) {
            printf("n_victims,r_mean,r_max,r_90p,r_75p,r_50p,r_stddev,r_iqd\n");
        }
        for(int i=0; i<n_n_victims; ++i) {
            int n_victims = n_victims_list[i];
            print_stats("relcatches", n_victims, relcatches[i], csvout);
        }
        if(!csvout) {
            for(int i=0; i<n_n_victims; ++i) {
                int n_victims = n_victims_list[i];
                print_stats("misdisfacts", n_victims, misdisfacts[i], csvout);
            }
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rsi, %rbx
cmpl $0x2, %edi
je 0xd246
cmpl $0x14, %edi
jne 0xd26b
leaq 0x8bda(%rip), %r14      # 0x151d0
xorl %r12d, %r12d
leaq 0x97b0(%rip), %r15      # 0x15db0
leaq 0x1(%r12), %r13
movq 0x8(%rbx,%r12,8), %rsi
movq %r14, %rdi
callq 0xd6b0
movq %r15, %rdi
movq %r14, %rsi
callq 0xd74c
movl %r12d, (%rax)
addq $0xa0, %r14
movq %r13, %r12
cmpq $0x13, %r13
jne 0xc600
leaq 0x3129(%rip), %rdi      # 0xf760
callq 0xc4b3
cltq
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
leaq 0x8b83(%rip), %r12      # 0x151d0
movl 0x50(%rax,%r12), %ebp
leaq 0x3129(%rip), %rdi      # 0xf782
callq 0xc4b3
cltq
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
movl 0x50(%rax,%r12), %r13d
leaq 0x3139(%rip), %rdi      # 0xf7ad
callq 0xc4b3
cltq
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
movsd 0x50(%rax,%r12), %xmm0
movsd %xmm0, 0x68(%rsp)
leaq 0x3149(%rip), %rdi      # 0xf7e0
callq 0xc4b3
cltq
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
movsd 0x50(%rax,%r12), %xmm0
movsd %xmm0, 0x60(%rsp)
leaq 0x3139(%rip), %rdi      # 0xf7f3
callq 0xc4b3
cltq
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
movl 0x50(%rax,%r12), %eax
movl %eax, 0x250(%rsp)
leaq 0x3131(%rip), %rdi      # 0xf80d
callq 0xc4b3
cltq
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
movsd 0x50(%rax,%r12), %xmm0
movsd %xmm0, 0x258(%rsp)
leaq 0x3118(%rip), %rdi      # 0xf81a
callq 0xc4b3
cltq
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
movsd 0x50(%rax,%r12), %xmm0
movsd %xmm0, 0x260(%rsp)
leaq 0x3134(%rip), %rdi      # 0xf85c
callq 0xc4b3
cltq
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
movsd 0x50(%rax,%r12), %xmm0
movsd %xmm0, 0x268(%rsp)
leaq 0x3167(%rip), %rdi      # 0xf8b5
callq 0xc4b3
cltq
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
movsd 0x50(%rax,%r12), %xmm0
movsd %xmm0, 0x270(%rsp)
leaq 0x3162(%rip), %rdi      # 0xf8d6
callq 0xc4b3
cltq
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
movsd 0x50(%rax,%r12), %xmm0
movsd %xmm0, 0x278(%rsp)
leaq 0x3176(%rip), %rdi      # 0xf910
callq 0xc4b3
cltq
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
movl 0x50(%rax,%r12), %eax
movl %eax, 0xc(%rsp)
leaq 0x319d(%rip), %rdi      # 0xf956
callq 0xc4b3
cltq
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
movl 0x50(%rax,%r12), %eax
movq %rax, 0xb8(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
leaq 0x3189(%rip), %rdi      # 0xf97b
callq 0xc4b3
cltq
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
leaq 0x1a0(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x58(%rax,%r12), %rsi
movq 0x60(%rax,%r12), %rdx
addq %rsi, %rdx
leaq 0x190(%rsp), %rdi
callq 0xdc3c
movq 0x190(%rsp), %rbx
leaq 0x95aa(%rip), %rdi      # 0x15de0
movq %rbx, %rsi
callq 0x21a0
cmpq %r14, %rbx
je 0xc84b
movq %rbx, %rdi
callq 0x21b0
leaq 0x958e(%rip), %rdi      # 0x15de0
leaq 0x32f7(%rip), %rsi      # 0xfb50
callq 0x22b0
testq %rax, %rax
je 0xc8bc
leaq 0x70(%rsp), %rbx
leaq 0x190(%rsp), %r14
leaq 0x32d9(%rip), %r15      # 0xfb50
movq %rax, %rdi
callq 0x22a0
movl %eax, 0x190(%rsp)
movq 0x78(%rsp), %rsi
cmpq 0x80(%rsp), %rsi
je 0xc8a2
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x78(%rsp)
jmp 0xc8ad
movq %rbx, %rdi
movq %r14, %rdx
callq 0x43fc
xorl %edi, %edi
movq %r15, %rsi
callq 0x22b0
testq %rax, %rax
jne 0xc877
leaq 0x30de(%rip), %rdi      # 0xf9a1
callq 0xc4b3
cltq
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
movl 0x50(%rax,%r12), %eax
movl %eax, 0x9c(%rsp)
leaq 0x30f4(%rip), %rdi      # 0xf9d9
callq 0xc4b3
cltq
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
movl 0x50(%rax,%r12), %eax
movl %eax, 0x98(%rsp)
leaq 0x3171(%rip), %rdi      # 0xfa78
callq 0xc4b3
cltq
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
movslq 0x50(%rax,%r12), %rax
movq %rax, 0x50(%rsp)
leaq 0x3126(%rip), %rdi      # 0xfa4d
callq 0xc4b3
cltq
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
movl 0x50(%rax,%r12), %eax
movq %rax, 0x58(%rsp)
testl %eax, %eax
jne 0xc950
xorl %edi, %edi
callq 0x2190
movq %rax, 0x58(%rsp)
leaq 0x311c(%rip), %rdi      # 0xfa73
callq 0xc4b3
cltq
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
movl 0x50(%rax,%r12), %eax
movl %eax, 0x2c(%rsp)
leaq 0x3136(%rip), %rdi      # 0xfaac
callq 0xc4b3
cltq
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
movl 0x50(%rax,%r12), %eax
movl %eax, 0x28(%rsp)
movl %ebp, 0x188(%rsp)
leaq 0x837c(%rip), %rax      # 0x14d18
movq %rax, 0x180(%rsp)
leaq 0x280(%rsp), %rax
movl %r13d, 0x8(%rax)
leaq 0x83a1(%rip), %rcx      # 0x14d58
movq %rcx, (%rax)
movsd 0x68(%rsp), %xmm0
movsd %xmm0, 0x10(%rax)
movl %r13d, 0x168(%rsp)
leaq 0x83b4(%rip), %rcx      # 0x14d88
movq %rcx, 0x160(%rsp)
movsd 0x60(%rsp), %xmm0
movsd %xmm0, 0x170(%rsp)
movq %rax, 0x178(%rsp)
movslq 0x58(%rsp), %rcx
movabsq $0x200000005, %rdx      # imm = 0x200000005
movq %rcx, %rax
mulq %rdx
movq %rcx, %r12
subq %rdx, %r12
shrq %r12
addq %rdx, %r12
shrq $0x1e, %r12
movq %r12, %rax
shlq $0x1f, %rax
subq %rax, %r12
leaq (%rcx,%r12), %rax
cmpq $0x1, %rax
adcq %rcx, %r12
movq 0x78(%rsp), %rax
subq 0x70(%rsp), %rax
shrq $0x2, %rax
movq %rax, 0x18(%rsp)
movslq %eax, %rbx
leaq 0x108(%rsp), %rdi
leaq 0x190(%rsp), %rdx
movq %rbx, %rsi
callq 0xd7c8
leaq 0xf0(%rsp), %rdi
leaq 0x190(%rsp), %rdx
movq %rbx, %rsi
callq 0xd7c8
movl 0xc(%rsp), %r13d
cmpl $0x0, 0x18(%rsp)
jle 0xcae8
movq 0x18(%rsp), %r14
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
xorl %r15d, %r15d
leaq 0x190(%rsp), %rbx
movq 0x50(%rsp), %rbp
movq 0x108(%rsp), %rdi
addq %r15, %rdi
movq $0x0, 0x190(%rsp)
movq %rbp, %rsi
movq %rbx, %rdx
callq 0xd846
movq 0xf0(%rsp), %rdi
addq %r15, %rdi
movq $0x0, 0x190(%rsp)
movq %rbp, %rsi
movq %rbx, %rdx
callq 0xd846
addq $0x18, %r15
decq %r14
jne 0xca9b
movq 0x50(%rsp), %rsi
movl %esi, %eax
xorl $0x1, %eax
movq 0x18(%rsp), %rdx
movl %edx, %ecx
xorl $0x1, %ecx
orl %eax, %ecx
orl 0x28(%rsp), %ecx
setne 0x6(%rsp)
testl %esi, %esi
jle 0xd2ee
cmpl $0x1, %esi
setne %al
cmpl $0x0, 0x2c(%rsp)
setg %cl
andb %al, %cl
movb %cl, 0x7(%rsp)
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq %rdx, 0xe8(%rsp)
movq 0xb8(%rsp), %rax
decl %eax
movl %eax, 0x94(%rsp)
leaq 0x190(%rsp), %rbp
leaq 0xa0(%rsp), %r14
leaq 0x120(%rsp), %r15
movq $0x0, 0x20(%rsp)
xorl %ecx, %ecx
movl $0x0, 0x8(%rsp)
movq %rcx, 0xe0(%rsp)
cmpb $0x0, 0x7(%rsp)
je 0xcb8f
movq 0x20(%rsp), %rax
xorl %edx, %edx
divl 0x2c(%rsp)
testl %edx, %edx
je 0xd224
imulq $0xbc8f, %r12, %rcx     # imm = 0xBC8F
movq %rcx, %rax
movabsq $0x200000005, %rdx      # imm = 0x200000005
mulq %rdx
movq %rcx, %r12
subq %rdx, %r12
shrq %r12
addq %rdx, %r12
shrq $0x1e, %r12
movq %r12, %rax
shlq $0x1f, %rax
subq %rax, %r12
addq %rcx, %r12
movq %rbp, %rdi
leaq 0x180(%rsp), %rsi
movl %r12d, %edx
xorl %ecx, %ecx
movl %r13d, %r8d
callq 0xd87a
movq %rbp, %rdi
callq 0x37a0
testb %al, %al
je 0xcd1b
imulq $0xbc8f, %r12, %rcx     # imm = 0xBC8F
movq %rcx, %rax
movabsq $0x200000005, %rdx      # imm = 0x200000005
mulq %rdx
movq %rcx, %r12
subq %rdx, %r12
shrq %r12
addq %rdx, %r12
shrq $0x1e, %r12
movq %r12, %rax
shlq $0x1f, %rax
subq %rax, %r12
addq %rcx, %r12
movq %rbp, %rdi
leaq 0x160(%rsp), %rsi
movl %r12d, %edx
callq 0x52ce
movl 0x94(%rsp), %ebp
cmpl $0x2, 0xb8(%rsp)
jl 0xccda
imulq $0xbc8f, %r12, %rcx     # imm = 0xBC8F
movq %rcx, %rax
movabsq $0x200000005, %r12      # imm = 0x200000005
mulq %r12
movq %rcx, %rbx
subq %rdx, %rbx
shrq %rbx
addq %rdx, %rbx
shrq $0x1e, %rbx
movq %rbx, %rax
shlq $0x1f, %rax
subq %rax, %rbx
addq %rcx, %rbx
leaq 0x190(%rsp), %r13
movq %r13, %rdi
leaq 0x250(%rsp), %rsi
movl %ebx, %edx
callq 0x53d8
imulq $0xbc8f, %rbx, %rcx     # imm = 0xBC8F
movq %rcx, %rax
mulq %r12
movq %rcx, %r12
subq %rdx, %r12
shrq %r12
addq %rdx, %r12
shrq $0x1e, %r12
movq %r12, %rax
shlq $0x1f, %rax
subq %rax, %r12
addq %rcx, %r12
movq %r13, %rdi
leaq 0x160(%rsp), %rsi
movl %r12d, %edx
callq 0x52ce
decl %ebp
jne 0xcc47
movq 0x240(%rsp), %rcx
movq -0x18(%rcx), %rax
movq -0x10(%rcx), %rcx
xorl %ebx, %ebx
cmpq %rcx, %rax
je 0xcd3c
movq 0x1a8(%rsp), %rdx
leaq 0x190(%rsp), %rbp
movslq (%rax), %rsi
xorl %edi, %edi
cmpl $0x0, (%rdx,%rsi,4)
setle %dil
addl %edi, %ebx
addq $0x4, %rax
cmpq %rcx, %rax
jne 0xcd01
jmp 0xcd44
leaq 0x2e3a(%rip), %rdi      # 0xfb5c
callq 0x2280
movl $0x1, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
jmp 0xd17c
leaq 0x190(%rsp), %rbp
cmpb $0x0, 0x6(%rsp)
movl 0xc(%rsp), %r13d
jne 0xcd90
movq %rbp, %rdi
callq 0x30b2
leaq 0x2e1a(%rip), %rdi      # 0xfb79
movl %eax, %esi
xorl %eax, %eax
callq 0x2050
movq %rbp, %rdi
callq 0x30ce
leaq 0x2e10(%rip), %rdi      # 0xfb87
movl %eax, %esi
xorl %eax, %eax
callq 0x2050
leaq 0x2e0b(%rip), %rdi      # 0xfb92
movl %ebx, %esi
xorl %eax, %eax
callq 0x2050
movq %rbp, %rdi
callq 0x37a0
testb %al, %al
je 0xd14c
movb $0x1, %al
movl %eax, 0x10(%rsp)
cmpl $0x0, 0x18(%rsp)
jle 0xd17c
cvtsi2sd %ebx, %xmm0
movsd %xmm0, 0x68(%rsp)
xorl %r13d, %r13d
movq 0x70(%rsp), %rax
movl (%rax,%r13,4), %esi
xorl %eax, %eax
movq %rax, 0x40(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movq %rax, 0xd0(%rsp)
movapd %xmm0, 0xc0(%rsp)
cmpl $0x0, 0x9c(%rsp)
je 0xce17
movq %rbp, %rdi
leaq 0x30(%rsp), %rdx
movq 0x58(%rsp), %rcx
movl 0x98(%rsp), %r8d
movsd 0x2940(%rip), %xmm0     # 0xf750
callq 0x9a50
jmp 0xce29
movq %rbp, %rdi
leaq 0x30(%rsp), %rdx
movq 0x58(%rsp), %rcx
callq 0x92ec
cmpb $0x0, 0x6(%rsp)
jne 0xce4c
movq 0x38(%rsp), %rsi
subq 0x30(%rsp), %rsi
shrq $0x2, %rsi
leaq 0x2d59(%rip), %rdi      # 0xfb9e
xorl %eax, %eax
callq 0x2050
movq %rbp, %rdi
leaq 0x30(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
movl $0x1, %ecx
movl $0x64, %r8d
callq 0x824e
movl $0x0, 0x128(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x130(%rsp)
leaq 0x128(%rsp), %rax
movq %rax, 0x138(%rsp)
movq %rax, 0x140(%rsp)
movq %rcx, 0x148(%rsp)
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %rbp
cmpq %rbp, %rbx
je 0xced0
movl (%rbx), %eax
movl %eax, 0xa0(%rsp)
movq %r15, %rdi
movq %r14, %rsi
callq 0xaca8
movl $0x0, (%rax)
addq $0x4, %rbx
jmp 0xceab
movq 0x240(%rsp), %rax
movq -0x18(%rax), %rbx
movq -0x10(%rax), %rbp
cmpq %rbp, %rbx
je 0xcf12
movslq (%rbx), %rsi
movq 0x1a8(%rsp), %rax
cmpl $0x0, (%rax,%rsi,4)
jne 0xcf0c
shlq $0x2, %rsi
addq 0xc0(%rsp), %rsi
movq %r15, %rdi
callq 0xaca8
incl (%rax)
addq $0x4, %rbx
jmp 0xcee0
movq 0x138(%rsp), %rsi
movq %r14, %rdi
leaq 0x128(%rsp), %rdx
leaq 0x17(%rsp), %rcx
callq 0xd996
movq 0xa0(%rsp), %rbx
movq 0xa8(%rsp), %rbp
cmpq %rbp, %rbx
leaq 0x617(%rip), %r14       # 0xd560
je 0xcf86
movq %rbp, %rax
subq %rbx, %rax
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r14, %rcx
callq 0xe926
movq %rbx, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0xe9f1
movq 0xa0(%rsp), %rbx
movslq 0x4(%rbx), %rdx
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
movq 0x38(%rsp), %rax
subq 0x30(%rsp), %rax
movsd 0x68(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x60(%rsp)
sarq $0x2, %rax
movq %rdx, %rcx
imulq %rax, %rcx
movq %rcx, %xmm0
punpckldq 0x252d(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x2535(%rip), %xmm0     # 0xf500
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
divsd %xmm1, %xmm2
movapd %xmm2, 0x150(%rsp)
cmpb $0x0, 0x6(%rsp)
jne 0xd0a7
cmpq $0x64, %rax
ja 0xd088
leaq 0x2ca3(%rip), %rdi      # 0xfca3
callq 0x2280
movq 0xa0(%rsp), %rbx
movq 0xa8(%rsp), %rbp
cmpq %rbp, %rbx
leaq 0x2b8d(%rip), %r14      # 0xfbac
je 0xd0a7
movslq 0x4(%rbx), %rdx
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
movsd 0x68(%rsp), %xmm3
divsd %xmm3, %xmm0
movq 0x38(%rsp), %rax
subq 0x30(%rsp), %rax
sarq $0x2, %rax
imulq %rdx, %rax
movq %rax, %xmm2
punpckldq 0x2497(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x249f(%rip), %xmm2     # 0xf500
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
divsd %xmm3, %xmm1
movl (%rbx), %esi
movq %r14, %rdi
movb $0x2, %al
callq 0x2050
addq $0x8, %rbx
cmpq %rbp, %rbx
jne 0xd025
jmp 0xd0a7
movl (%rbx), %esi
leaq 0x2b31(%rip), %rdi      # 0xfbc2
movsd 0x60(%rsp), %xmm0
movapd 0x150(%rsp), %xmm1
movb $0x2, %al
callq 0x2050
movq 0x108(%rsp), %rax
leaq (,%r13,8), %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx), %rax
movq 0x20(%rsp), %rdx
movsd 0x60(%rsp), %xmm0
movsd %xmm0, (%rax,%rdx,8)
movq 0xf0(%rsp), %rax
movq (%rax,%rcx), %rax
movapd 0x150(%rsp), %xmm0
movsd %xmm0, (%rax,%rdx,8)
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0xd0fb
callq 0x21b0
movq %r15, %rdi
callq 0xadd2
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
leaq 0x190(%rsp), %rbp
je 0xd11d
callq 0x21b0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
leaq 0xa0(%rsp), %r14
je 0xd134
callq 0x21b0
incq %r13
cmpq 0xe8(%rsp), %r13
jne 0xcdbe
movl 0xc(%rsp), %r13d
jmp 0xd17c
leaq 0x2a09(%rip), %rdi      # 0xfb5c
callq 0x2280
movq 0x7e59(%rip), %rax      # 0x14fb8
movq (%rax), %rsi
movl $0x0, 0x10(%rsp)
movq %rbp, %rdi
xorl %edx, %edx
callq 0x3438
movl $0x1, 0x8(%rsp)
leaq 0x238(%rsp), %rdi
callq 0xad8c
leaq 0x220(%rsp), %rdi
callq 0xad8c
leaq 0x208(%rsp), %rdi
callq 0xad8c
leaq 0x1f0(%rsp), %rdi
callq 0xad8c
leaq 0x1d8(%rsp), %rdi
callq 0xad8c
movq 0x1c0(%rsp), %rdi
testq %rdi, %rdi
je 0xd1cf
callq 0x21b0
movq 0x1a8(%rsp), %rdi
testq %rdi, %rdi
je 0xd1e1
callq 0x21b0
movq 0x190(%rsp), %rdi
testq %rdi, %rdi
je 0xd1f3
callq 0x21b0
cmpb $0x0, 0x10(%rsp)
je 0xd2f5
movq 0x20(%rsp), %rdx
incq %rdx
movq 0x50(%rsp), %rsi
cmpq %rsi, %rdx
setae %cl
movq %rdx, 0x20(%rsp)
cmpq %rsi, %rdx
jne 0xcb6d
jmp 0xd309
movq 0x7da5(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
leaq 0x291d(%rip), %rsi      # 0xfb52
movq 0x20(%rsp), %rdx
xorl %eax, %eax
callq 0x2250
jmp 0xcb8f
movq 0x8(%rbx), %rdi
cmpb $0x2d, (%rdi)
jne 0xd25b
cmpb $0x68, 0x1(%rdi)
jne 0xd25b
cmpb $0x0, 0x2(%rdi)
je 0xd288
leaq 0x28e7(%rip), %rsi      # 0xfb49
callq 0x2240
testl %eax, %eax
je 0xd288
movq 0x7d5e(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
movq (%rbx), %rsi
callq 0xd4f5
movl $0x2, %r13d
jmp 0xd3fb
movq 0x7d29(%rip), %r14      # 0x14fb8
movq (%r14), %rdi
movq (%rbx), %rsi
callq 0xd4f5
movl $0xa, %edi
callq 0x2230
movq (%r14), %rbx
movl $0x80, %r15d
leaq 0x7f1c(%rip), %r12      # 0x151d0
leaq 0x2975(%rip), %r14      # 0xfc30
xorl %r13d, %r13d
movq -0x80(%r15,%r12), %rdx
movq -0x58(%r15,%r12), %rcx
movq (%r15,%r12), %r8
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x2250
addq $0xa0, %r15
cmpq $0xc60, %r15            # imm = 0xC60
jne 0xd2be
jmp 0xd3fb
xorl %r13d, %r13d
movb $0x1, %cl
jmp 0xd30c
movq 0x50(%rsp), %rsi
movl 0x8(%rsp), %r13d
movq 0xe0(%rsp), %rcx
jmp 0xd30c
xorl %r13d, %r13d
movb 0x6(%rsp), %al
andb %cl, %al
cmpb $0x1, %al
movq 0x18(%rsp), %r14
movl 0x28(%rsp), %ebp
jne 0xd3d2
cmpl $0x2, %esi
jge 0xd410
testl %ebp, %ebp
je 0xd33c
leaq 0x2934(%rip), %rdi      # 0xfc6b
callq 0x2280
testl %r14d, %r14d
jle 0xd3cf
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
xorl %r15d, %r15d
leaq 0x28b0(%rip), %rbx      # 0xfc06
xorl %r12d, %r12d
xorl %ecx, %ecx
testl %ebp, %ebp
setne %cl
movq 0x70(%rsp), %rax
movl (%rax,%r12,4), %esi
movq 0x108(%rsp), %rdx
addq %r15, %rdx
movq %rbx, %rdi
callq 0xc308
incq %r12
addq $0x18, %r15
cmpq %r12, %r14
jne 0xd359
testl %ebp, %ebp
jne 0xd3cf
movq 0x18(%rsp), %r12
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %r14d, %r14d
leaq 0x286f(%rip), %rbx      # 0xfc11
xorl %r15d, %r15d
movq 0x70(%rsp), %rax
movl (%rax,%r15,4), %esi
movq 0xf0(%rsp), %rdx
addq %r14, %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0xc308
incq %r15
addq $0x18, %r14
cmpq %r15, %r12
jne 0xd3a5
xorl %r13d, %r13d
leaq 0xf0(%rsp), %rdi
callq 0xda34
leaq 0x108(%rsp), %rdi
callq 0xda34
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0xd3fb
callq 0x21b0
movl %r13d, %eax
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x7bb9(%rip), %rax      # 0x14fd0
movq %rsi, %rdx
movq (%rax), %rdi
leaq 0x27d8(%rip), %rsi      # 0xfbfc
xorl %eax, %eax
callq 0x2250
jmp 0xd32c
movq %rax, %rbx
jmp 0xd4d1
jmp 0xd44a
jmp 0xd44a
jmp 0xd44a
jmp 0xd44a
jmp 0xd44a
jmp 0xd44a
jmp 0xd44a
jmp 0xd44a
jmp 0xd45c
movq %rax, %rbx
jmp 0xd4de
jmp 0xd45c
jmp 0xd45c
jmp 0xd47f
jmp 0xd47f
jmp 0xd45c
movq %rax, %rbx
jmp 0xd4c4
jmp 0xd486
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0xd489
callq 0x21b0
jmp 0xd489
movq %rax, %rbx
jmp 0xd496
movq %rax, %rbx
jmp 0xd4b7
jmp 0xd486
movq %rax, %rbx
leaq 0x120(%rsp), %rdi
callq 0xadd2
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0xd4a8
callq 0x21b0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xd4b7
callq 0x21b0
leaq 0x190(%rsp), %rdi
callq 0xd9d0
leaq 0xf0(%rsp), %rdi
callq 0xda34
leaq 0x108(%rsp), %rdi
callq 0xda34
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0xd4ed
callq 0x21b0
movq %rbx, %rdi
callq 0x22f0