// File: /workspace/github_cpp_makefile_star2_O2/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 $0x278, %rsp            # imm = 0x278
movq %rsi, %rbx
cmpl $0x2, %edi
je 0xb17c
cmpl $0x14, %edi
jne 0xb1a9
leaq 0xb1d4(%rip), %r14      # 0x161b0
xorl %r12d, %r12d
leaq 0xbdaa(%rip), %r15      # 0x16d90
cmpq $0x13, %r12
je 0xb018
leaq 0x1(%r12), %r13
movq 0x8(%rbx,%r12,8), %rsi
movq %r14, %rdi
callq 0xbd08
movq %r15, %rdi
movq %r14, %rsi
callq 0xbd82
movl %r12d, (%rax)
addq $0xa0, %r14
movq %r13, %r12
jmp 0xafe6
leaq 0x3711(%rip), %rdi      # 0xe730
callq 0xaf44
movl %eax, %ebp
leaq 0x3725(%rip), %rdi      # 0xe752
callq 0xaf44
movl %eax, %ebx
leaq 0x3742(%rip), %rdi      # 0xe77d
callq 0xaf60
movsd %xmm0, 0x40(%rsp)
leaq 0x3763(%rip), %rdi      # 0xe7b0
callq 0xaf60
movsd %xmm0, 0x38(%rsp)
leaq 0x3764(%rip), %rdi      # 0xe7c3
callq 0xaf44
movl %eax, 0x170(%rsp)
leaq 0x376b(%rip), %rdi      # 0xe7dd
callq 0xaf60
movsd %xmm0, 0x178(%rsp)
leaq 0x3763(%rip), %rdi      # 0xe7ea
callq 0xaf60
movsd %xmm0, 0x180(%rsp)
leaq 0x3790(%rip), %rdi      # 0xe82c
callq 0xaf60
movsd %xmm0, 0x188(%rsp)
leaq 0x37d4(%rip), %rdi      # 0xe885
callq 0xaf60
movsd %xmm0, 0x190(%rsp)
leaq 0x37e0(%rip), %rdi      # 0xe8a6
callq 0xaf60
movsd %xmm0, 0x198(%rsp)
leaq 0x3805(%rip), %rdi      # 0xe8e0
callq 0xaf44
movl %eax, 0x50(%rsp)
leaq 0x383b(%rip), %rdi      # 0xe926
callq 0xaf44
movl %eax, 0x5c(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x60(%rsp)
andq $0x0, 0x70(%rsp)
leaq 0x3840(%rip), %rsi      # 0xe94b
leaq 0x1a0(%rsp), %rdi
callq 0xaf7e
leaq 0x1a0(%rsp), %r14
movq (%r14), %rsi
leaq 0xbc96(%rip), %r12      # 0x16dc0
movq %r12, %rdi
callq 0x2160
movq %r14, %rdi
callq 0x20a0
leaq 0x39df(%rip), %r15      # 0xeb20
movq %r12, %rdi
movq %r15, %rsi
callq 0x2260
leaq 0x60(%rsp), %r12
testq %rax, %rax
je 0xb1c4
movq %rax, %rdi
callq 0x2250
movl %eax, 0x1a0(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x3c5e
xorl %edi, %edi
movq %r15, %rsi
callq 0x2260
jmp 0xb151
movq 0x8(%rbx), %rdi
cmpb $0x2d, (%rdi)
jne 0xb195
cmpb $0x68, 0x1(%rdi)
jne 0xb195
cmpb $0x0, 0x2(%rdi)
je 0xba17
leaq 0x397d(%rip), %rsi      # 0xeb19
callq 0x2200
testl %eax, %eax
je 0xba17
movq 0xae20(%rip), %rax      # 0x15fd0
movq (%rax), %rdi
movq (%rbx), %rsi
callq 0xbb8a
pushq $0x2
popq %r13
jmp 0xbaaa
leaq 0x37a6(%rip), %rdi      # 0xe971
callq 0xaf44
movl %eax, 0x58(%rsp)
leaq 0x37ce(%rip), %rdi      # 0xe9a9
callq 0xaf44
movl %eax, 0x54(%rsp)
leaq 0x385d(%rip), %rdi      # 0xea48
callq 0xaf44
movl %eax, 0x8(%rsp)
leaq 0x3822(%rip), %rdi      # 0xea1d
callq 0xaf44
movl %eax, %r14d
testl %eax, %eax
jne 0xb211
xorl %edi, %edi
callq 0x2150
movq %rax, %r14
leaq 0x382b(%rip), %rdi      # 0xea43
callq 0xaf44
movl %eax, 0x1c(%rsp)
leaq 0x3854(%rip), %rdi      # 0xea7c
callq 0xaf44
movl %eax, %r12d
movl %ebp, 0x168(%rsp)
leaq 0xaada(%rip), %rax      # 0x15d18
movq %rax, 0x160(%rsp)
leaq 0x260(%rsp), %rax
movl %ebx, 0x8(%rax)
leaq 0xab00(%rip), %rcx      # 0x15d58
movq %rcx, (%rax)
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x10(%rax)
movl %ebx, 0x148(%rsp)
leaq 0xab14(%rip), %rcx      # 0x15d88
movq %rcx, 0x140(%rsp)
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x150(%rsp)
movq %rax, 0x158(%rsp)
movq %r14, 0x88(%rsp)
movslq %r14d, %rax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %edx, %edx
divq %rcx
movq %rdx, %rbx
cmpq $0x1, %rdx
adcq $0x0, %rbx
movq 0x68(%rsp), %r15
subq 0x60(%rsp), %r15
shrq $0x2, %r15
movslq %r15d, %r14
leaq 0xe8(%rsp), %rdi
leaq 0x1a0(%rsp), %rdx
movq %r14, %rsi
callq 0xbde8
movl %r12d, 0x18(%rsp)
leaq 0xd0(%rsp), %rdi
leaq 0x1a0(%rsp), %rdx
movq %r14, %rsi
callq 0xbde8
movl 0x8(%rsp), %eax
movslq %eax, %rcx
xorl %r12d, %r12d
testl %r15d, %r15d
movl $0x0, %eax
cmovgl %r15d, %eax
movq %rax, 0x48(%rsp)
imulq $0x18, %rax, %r13
leaq 0x1a0(%rsp), %r14
movq %rcx, 0x80(%rsp)
cmpq %r12, %r13
je 0xb37c
movq 0xe8(%rsp), %rdi
addq %r12, %rdi
andq $0x0, 0x1a0(%rsp)
movq %rcx, %rbp
movq %rcx, %rsi
movq %r14, %rdx
callq 0xbe3a
movq 0xd0(%rsp), %rdi
addq %r12, %rdi
andq $0x0, 0x1a0(%rsp)
movq %rbp, %rsi
movq %r14, %rdx
callq 0xbe3a
addq $0x18, %r12
movq 0x80(%rsp), %rcx
jmp 0xb328
movl 0x8(%rsp), %esi
movl %esi, %eax
xorl $0x1, %eax
xorl $0x1, %r15d
orl %eax, %r15d
orl 0x18(%rsp), %r15d
setne 0x6(%rsp)
cmpl $0x2, %esi
setge %al
cmpl $0x0, 0x1c(%rsp)
setg %dl
andb %al, %dl
movb %dl, 0x7(%rsp)
testl %esi, %esi
movl $0x0, %eax
cmovgl %esi, %eax
movq %rax, 0xc8(%rsp)
movl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
leaq 0x98(%rsp), %r12
leaq 0x100(%rsp), %rbp
xorl %eax, %eax
movq $0x0, 0x10(%rsp)
movq %rax, %r8
cmpq 0xc8(%rsp), %rax
je 0xb948
cmpb $0x0, 0x7(%rsp)
movq %r8, 0x90(%rsp)
je 0xb40e
movl %r8d, %eax
xorl %edx, %edx
divl 0x1c(%rsp)
testl %edx, %edx
je 0xb928
imulq $0xbc8f, %rbx, %rax     # imm = 0xBC8F
xorl %edx, %edx
divq %r13
movq %rdx, %rbx
leaq 0x1a0(%rsp), %r15
movq %r15, %rdi
leaq 0x160(%rsp), %rsi
xorl %ecx, %ecx
movl 0x50(%rsp), %r8d
callq 0xbe6e
movq %r15, %rdi
callq 0x3214
testb %al, %al
je 0xb4d2
imulq $0xbc8f, %rbx, %rax     # imm = 0xBC8F
xorl %edx, %edx
divq %r13
movq %rdx, %rbx
leaq 0x1a0(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x46d4
pushq $0x1
popq %r15
cmpl 0x5c(%rsp), %r15d
jge 0xb4ee
imulq $0xbc8f, %rbx, %rax     # imm = 0xBC8F
xorl %edx, %edx
divq %r13
movq %rdx, %rbx
movl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
leaq 0x1a0(%rsp), %r13
movq %r13, %rdi
leaq 0x170(%rsp), %rsi
callq 0x4790
imulq $0xbc8f, %rbx, %rax     # imm = 0xBC8F
xorl %edx, %edx
divq %r14
movq %rdx, %rbx
movq %r13, %rdi
leaq 0x140(%rsp), %rsi
callq 0x46d4
incl %r15d
movl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
jmp 0xb474
leaq 0x3653(%rip), %rdi      # 0xeb2c
callq 0x2240
xorl %r14d, %r14d
pushq $0x1
popq %rax
movq %rax, 0x10(%rsp)
jmp 0xb8fc
movq 0x1b8(%rsp), %rax
movq 0x250(%rsp), %rdx
movq -0x18(%rdx), %rcx
movq -0x10(%rdx), %rdx
xorl %r15d, %r15d
cmpq %rdx, %rcx
je 0xb524
movslq (%rcx), %rsi
xorl %edi, %edi
cmpl $0x0, (%rax,%rsi,4)
setle %dil
addl %edi, %r15d
addq $0x4, %rcx
jmp 0xb509
cmpb $0x0, 0x6(%rsp)
jne 0xb576
leaq 0x1a0(%rsp), %rdi
callq 0x2c04
leaq 0x360a(%rip), %rdi      # 0xeb49
movl %eax, %esi
xorl %eax, %eax
callq 0x2040
leaq 0x1a0(%rsp), %rdi
callq 0x2c20
leaq 0x35fb(%rip), %rdi      # 0xeb57
movl %eax, %esi
xorl %eax, %eax
callq 0x2040
leaq 0x35f6(%rip), %rdi      # 0xeb62
movl %r15d, %esi
xorl %eax, %eax
callq 0x2040
leaq 0x1a0(%rsp), %rdi
callq 0x3214
testb %al, %al
je 0xb8c7
cvtsi2sd %r15d, %xmm0
movsd %xmm0, 0x40(%rsp)
xorl %r15d, %r15d
cmpq 0x48(%rsp), %r15
je 0xb8f9
movq 0x60(%rsp), %rax
movl (%rax,%r15,4), %esi
andq $0x0, 0x30(%rsp)
andq $0x0, 0xc0(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movapd %xmm0, 0xb0(%rsp)
cmpl $0x0, 0x58(%rsp)
je 0xb602
leaq 0x1a0(%rsp), %r14
movq %r14, %rdi
leaq 0x20(%rsp), %rdx
movq 0x88(%rsp), %rcx
movl 0x54(%rsp), %r8d
movsd 0x3125(%rip), %xmm0     # 0xe720
callq 0x862c
jmp 0xb61f
leaq 0x1a0(%rsp), %r14
movq %r14, %rdi
leaq 0x20(%rsp), %rdx
movq 0x88(%rsp), %rcx
callq 0x807c
cmpb $0x0, 0x6(%rsp)
jne 0xb642
movq 0x28(%rsp), %rsi
subq 0x20(%rsp), %rsi
shrq $0x2, %rsi
leaq 0x3533(%rip), %rdi      # 0xeb6e
xorl %eax, %eax
callq 0x2040
movq %r14, %rdi
leaq 0x20(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
pushq $0x1
popq %rcx
pushq $0x64
popq %r8
callq 0x7094
andl $0x0, 0x108(%rsp)
andq $0x0, 0x110(%rsp)
leaq 0x108(%rsp), %rax
movq %rax, 0x118(%rsp)
movq %rax, 0x120(%rsp)
andq $0x0, 0x128(%rsp)
movq 0x20(%rsp), %r14
movq 0x28(%rsp), %r13
cmpq %r13, %r14
je 0xb6bd
movl (%r14), %eax
movl %eax, 0x98(%rsp)
movq %rbp, %rdi
movq %r12, %rsi
callq 0x969a
andl $0x0, (%rax)
addq $0x4, %r14
jmp 0xb69a
movq 0x250(%rsp), %rax
movq -0x18(%rax), %r14
movq -0x10(%rax), %r13
cmpq %r13, %r14
je 0xb6ff
movslq (%r14), %rsi
movq 0x1b8(%rsp), %rax
cmpl $0x0, (%rax,%rsi,4)
jne 0xb6f9
shlq $0x2, %rsi
addq 0xb0(%rsp), %rsi
movq %rbp, %rdi
callq 0x969a
incl (%rax)
addq $0x4, %r14
jmp 0xb6cd
movq 0x118(%rsp), %rsi
movq %r12, %rdi
leaq 0x108(%rsp), %rdx
leaq 0xf(%rsp), %rcx
callq 0xbf6c
movq 0x98(%rsp), %rdi
movq 0xa0(%rsp), %rsi
leaq 0x4c3(%rip), %rdx       # 0xbbf6
callq 0xcd5b
movq 0x98(%rsp), %rax
movslq 0x4(%rax), %rdx
cvtsi2sd %edx, %xmm0
movq 0x28(%rsp), %rcx
subq 0x20(%rsp), %rcx
movsd 0x40(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x38(%rsp)
sarq $0x2, %rcx
movq %rdx, %rsi
imulq %rcx, %rsi
movq %rsi, %xmm0
punpckldq 0x2d46(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x2d4e(%rip), %xmm0     # 0xe4d0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
divsd %xmm1, %xmm2
movapd %xmm2, 0x130(%rsp)
cmpb $0x0, 0x6(%rsp)
jne 0xb855
cmpq $0x64, %rcx
ja 0xb836
leaq 0x3492(%rip), %rdi      # 0xec49
callq 0x2240
movq 0x98(%rsp), %r13
movq 0xa0(%rsp), %r14
cmpq %r14, %r13
je 0xb855
movslq 0x4(%r13), %rdx
cvtsi2sd %edx, %xmm0
movsd 0x40(%rsp), %xmm3
divsd %xmm3, %xmm0
movq 0x28(%rsp), %rax
subq 0x20(%rsp), %rax
sarq $0x2, %rax
imulq %rdx, %rax
movq %rax, %xmm2
punpckldq 0x2cba(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x2cc2(%rip), %xmm2     # 0xe4d0
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
divsd %xmm3, %xmm1
movl (%r13), %esi
leaq 0x3353(%rip), %rdi      # 0xeb7c
movb $0x2, %al
callq 0x2040
addq $0x8, %r13
jmp 0xb7cc
movl (%rax), %esi
leaq 0x3353(%rip), %rdi      # 0xeb92
movsd 0x38(%rsp), %xmm0
movapd 0x130(%rsp), %xmm1
movb $0x2, %al
callq 0x2040
movq 0xe8(%rsp), %rax
imulq $0x18, %r15, %rcx
movq (%rax,%rcx), %rax
movq 0x90(%rsp), %rdx
movsd 0x38(%rsp), %xmm0
movsd %xmm0, (%rax,%rdx,8)
movq 0xd0(%rsp), %rax
movq (%rax,%rcx), %rax
movapd 0x130(%rsp), %xmm0
movsd %xmm0, (%rax,%rdx,8)
movq %r12, %rdi
callq 0x3b0e
movq %rbp, %rdi
callq 0x977a
leaq 0xb0(%rsp), %rdi
callq 0x3b00
leaq 0x20(%rsp), %rdi
callq 0x3b00
incq %r15
movl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
jmp 0xb599
leaq 0x325e(%rip), %rdi      # 0xeb2c
callq 0x2240
movq 0xa6de(%rip), %rax      # 0x15fb8
movq (%rax), %rsi
xorl %r14d, %r14d
leaq 0x1a0(%rsp), %rdi
xorl %edx, %edx
callq 0x2eea
pushq $0x1
popq %rax
movq %rax, 0x10(%rsp)
jmp 0xb8fc
movb $0x1, %r14b
leaq 0x1a0(%rsp), %rdi
callq 0xbf9e
movq 0x90(%rsp), %r8
leaq 0x1(%r8), %rax
testb %r14b, %r14b
movq 0x80(%rsp), %rcx
jne 0xb3dd
jmp 0xb951
movq 0xa6a1(%rip), %rax      # 0x15fd0
movq (%rax), %rdi
leaq 0x31e9(%rip), %rsi      # 0xeb22
movl %r8d, %edx
xorl %eax, %eax
callq 0x2210
jmp 0xb40e
movq $0x0, 0x10(%rsp)
cmpq %rcx, %r8
setl %al
movb 0x6(%rsp), %cl
xorb $0x1, %cl
orb %al, %cl
jne 0xba81
movl 0x8(%rsp), %edx
cmpl $0x2, %edx
jge 0xbabf
movl 0x18(%rsp), %ebp
testl %ebp, %ebp
je 0xb987
leaq 0x328f(%rip), %rdi      # 0xec11
callq 0x2240
xorl %r14d, %r14d
leaq 0x3245(%rip), %rbx      # 0xebd6
xorl %r15d, %r15d
cmpq %r15, 0x48(%rsp)
je 0xb9c7
xorl %ecx, %ecx
testl %ebp, %ebp
setne %cl
movq 0x60(%rsp), %rax
movl (%rax,%r15,4), %esi
movq 0xe8(%rsp), %rdx
addq %r14, %rdx
movq %rbx, %rdi
callq 0xad74
incq %r15
addq $0x18, %r14
jmp 0xb994
movq $0x0, 0x10(%rsp)
testl %ebp, %ebp
jne 0xba81
leaq 0x3202(%rip), %rbx      # 0xebe1
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq %r15, 0x48(%rsp)
je 0xba78
movq 0x60(%rsp), %rax
movl (%rax,%r15,4), %esi
movq 0xd0(%rsp), %rdx
addq %r14, %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0xad74
incq %r15
addq $0x18, %r14
jmp 0xb9e5
movq 0xa59a(%rip), %r14      # 0x15fb8
movq (%r14), %rdi
movq (%rbx), %rsi
callq 0xbb8a
pushq $0xa
popq %rdi
callq 0x21f0
movq (%r14), %rbx
xorl %r13d, %r13d
leaq 0xa772(%rip), %r15      # 0x161b0
leaq 0x31bb(%rip), %r14      # 0xec00
xorl %r12d, %r12d
cmpq $0xbe0, %r12            # imm = 0xBE0
je 0xbaaa
movq (%r12,%r15), %rdx
movq 0x28(%r12,%r15), %rcx
movq 0x80(%r12,%r15), %r8
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x2210
addq $0xa0, %r12
jmp 0xba48
movq $0x0, 0x10(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0xbff0
leaq 0xe8(%rsp), %rdi
callq 0xbff0
leaq 0x60(%rsp), %rdi
callq 0x3b00
movq 0x10(%rsp), %r13
movl %r13d, %eax
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xa50a(%rip), %rax      # 0x15fd0
movq (%rax), %rdi
leaq 0x30fc(%rip), %rsi      # 0xebcc
xorl %eax, %eax
callq 0x2210
jmp 0xb973
movq %rax, %rbx
jmp 0xbb6b
jmp 0xbb05
jmp 0xbb05
jmp 0xbb05
jmp 0xbb05
jmp 0xbb05
jmp 0xbb05
jmp 0xbb05
jmp 0xbb05
jmp 0xbb00
jmp 0xbb00
jmp 0xbb00
jmp 0xbb23
jmp 0xbb23
jmp 0xbb00
movq %rax, %rbx
jmp 0xbb5e
movq %rax, %rbx
jmp 0xbb78
jmp 0xbb2a
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x3b0e
jmp 0xbb2d
movq %rax, %rbx
jmp 0xbb3a
movq %rax, %rbx
jmp 0xbb51
jmp 0xbb2a
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
callq 0x977a
leaq 0xb0(%rsp), %rdi
callq 0x3b00
leaq 0x20(%rsp), %rdi
callq 0x3b00
leaq 0x1a0(%rsp), %rdi
callq 0xbf9e
leaq 0xd0(%rsp), %rdi
callq 0xbff0
leaq 0xe8(%rsp), %rdi
callq 0xbff0
leaq 0x60(%rsp), %rdi
callq 0x3b00
movq %rbx, %rdi
callq 0x22a0