// File: /workspace/github_cpp_makefile_star2_O1/sharmaeklavya2[P]ddos-on-anycast/src/lib/place_victims.cpp
// Function: place_victims_using_toposort(Network const&, int, std::vector<int, std::allocator<int>>&, int, int, double)
void place_victims_using_toposort(const Network& network, int n_victims, ivec& victim_list, int seed, int tries, double max_noise) {
    int n = network.size();
    Graph graph(0);
    make_network_dag(network, graph);
    ivec rtopolist;
    rtoposort(graph, rtopolist);
    ivec sources, sinks;
    graph.get_sources_and_sinks(sources, sinks);
    // cerr << "rtopolist: " << rtopolist << endl;

    // compute score
    vector<double> score(n, 0.0);
    for(int u: rtopolist) {
        if(graph.succs(u).empty()) {
            // u is a leaf
            score[u] = 1;
        }
        int m = graph.preds(u).size();
        for(int v: graph.preds(u)) {
            score[v] += score[u] / m;
        }
    }

    // cerr << "score: " << score << endl;
    rng_t rng(seed);
    ivec victims(n, 0);

    // divide victims among sources
    vector<double> weights;
    ivec xvec, best_xvec;
    weights.reserve(sources.size());
    for(int u: sources) {
        weights.push_back(score[u]);
    }
    noisy_normalize(weights, n_victims, max_noise, rng);
    distribute(weights, n_victims, xvec, rng);
    int s = sources.size();
    for(int i=0; i<s; ++i) {
        int u = sources[i];
        victims[u] = xvec[i];
    }
    weights.clear();
    xvec.clear();

    // divide victims
    int dijkstra_calls = 0;
    std::reverse(rtopolist.begin(), rtopolist.end());
    for(int u: rtopolist) {
        if(victims[u] > 0) {
            const ivec& succs = graph.succs(u);
            int s = succs.size();
            if(s > 0) {
                weights.reserve(s);
                for(int v: succs) {
                    weights.push_back(score[v] / graph.preds(v).size());
                }
                noisy_normalize(weights, victims[u], max_noise, rng);
                if(!network.is_virtual(u) || victims[u] == 1 || tries == 1) {
                    distribute(weights, victims[u], best_xvec, rng);
                }
                else {
                    double minmaxload = 1e50;
                    for(int i=0; i<tries; ++i) {
                        distribute(weights, victims[u], xvec, rng);
                        bool found_zero=false, found_one=false;
                        for(int x: xvec) {
                            if(x == 0) {found_zero = true;}
                            else if(x == 1) {found_one = true;}
                        }
                        bool best = !(found_one && found_zero);
                        if(!best) {
                            std::map<int, int> local_id;
                            for(int i=0; i<s; ++i) {
                                local_id[succs[i]] = i;
                            }
                            // cerr << "local_id" << local_id << endl;
                            vector<ivec> adj(s);
                            PQ pq;
                            ivec target(s, -1), target_dist(s, -1);
                            vector<bool> visited(s, false);
                            for(int i=0; i<s; ++i) {
                                int v = succs[i];
                                adj[i].reserve(network.in_nbrs[v].size());
                                for(int v2: network.in_nbrs[v]) {
                                    adj[i].push_back(local_id[v2]);
                                }
                                if(xvec[i] > 0) {
                                    pq.emplace(0, i);
                                    target[i] = i;
                                    target_dist[i] = 0;
                                }
                            }
                            dijkstra(adj, pq, target, target_dist, visited);
                            dijkstra_calls++;
                            vector<double> load(s, 0.0);
                            for(int i=0; i<s; ++i) {
                                load[target[i]] += weights[i];
                            }
                            double maxload = 0;
                            for(int i=0; i<s; ++i) {
                                if(xvec[i] > 0) {
                                    load[i] /= xvec[i];
                                    maxload = std::max(maxload, load[i]);
                                }
                                else if(load[i] != 0.0) {
                                    fprintf(stderr, "xvec[%d] = 0 but load[%d] = %lf\n", i, i, load[i]);
                                }
                            }
                            /*
                            print_icont(stderr, xvec, ", ", "xvec: [", "]\n");
                            cerr << "target: " << target << endl;
                            fprintf(stderr, "maxload: %lf\n", maxload);
                            */
                            if(maxload < minmaxload) {
                                best = true;
                                minmaxload = maxload;
                            }
                        }
                        if(best) {
                            std::swap(xvec, best_xvec);
                        }
                        xvec.clear();
                    }
                }
                for(int i=0; i<s; ++i) {
                    int v = succs[i];
                    victims[v] += best_xvec[i];
                }
                weights.clear();
                best_xvec.clear();
            }
        }
    }

    // fprintf(stderr, "dijkstra was called %d times\n", dijkstra_calls);
    victim_list.reserve(n_victims);
    for(int u: network.depthwise.back()) {
        if(victims[u] > 0 && !network.is_virtual(u)) {
            victim_list.push_back(u);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movsd %xmm0, 0x128(%rsp)
movl %r8d, 0x28(%rsp)
movl %ecx, %ebx
movq %rdx, %r12
movl %esi, %ebp
movq %rdi, %r13
movq 0x20(%rdi), %r14
subq 0x18(%rdi), %r14
leaq 0x208(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0xa51e
movq %r13, 0x50(%rsp)
movq %r13, %rdi
movq %r15, %rsi
callq 0x8f8b
xorpd %xmm0, %xmm0
leaq 0x130(%rsp), %rsi
movapd %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
leaq 0x208(%rsp), %rdi
callq 0xb8ce
leaq 0x110(%rsp), %rsi
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsi)
xorl %eax, %eax
movq %rax, 0x10(%rsi)
leaq 0x260(%rsp), %rdx
movq %rax, 0x10(%rdx)
movapd %xmm0, (%rdx)
leaq 0x208(%rsp), %rdi
callq 0xb680
shrq $0x2, %r14
movslq %r14d, %r15
leaq 0x150(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x1d8(%rsp), %rdi
leaq 0xe8(%rsp), %rcx
movq %r15, %rsi
callq 0x6850
movq 0x130(%rsp), %rax
movq 0x138(%rsp), %rcx
cmpq %rcx, %rax
je 0x974b
movq 0x210(%rsp), %rdx
movq 0x228(%rsp), %rsi
movq 0x1d8(%rsp), %rdi
movabsq $0x3ff0000000000000, %r8 # imm = 0x3FF0000000000000
movslq (%rax), %r9
leaq (%r9,%r9,2), %r11
movq (%rsi,%r11,8), %r10
cmpq 0x8(%rsi,%r11,8), %r10
jne 0x9700
movq %r8, (%rdi,%r9,8)
movq (%rdx,%r11,8), %r10
movq 0x8(%rdx,%r11,8), %r11
cmpq %r11, %r10
je 0x9742
movq %r11, %r14
subq %r10, %r14
shrq $0x2, %r14
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
movslq (%r10), %r14
movsd (%rdi,%r9,8), %xmm1
divsd %xmm0, %xmm1
addsd (%rdi,%r14,8), %xmm1
movsd %xmm1, (%rdi,%r14,8)
addq $0x4, %r10
cmpq %r11, %r10
jne 0x9720
addq $0x4, %rax
cmpq %rcx, %rax
jne 0x96ea
movslq %ebx, %rcx
movabsq $0x200000005, %rdx      # imm = 0x200000005
movq %rcx, %rax
mulq %rdx
movq %rcx, %rax
subq %rdx, %rax
shrq %rax
addq %rdx, %rax
shrq $0x1e, %rax
movq %rax, %rdx
shlq $0x1f, %rdx
subq %rdx, %rax
leaq (%rcx,%rax), %rdx
cmpq $0x1, %rdx
adcq %rcx, %rax
movq %rax, 0x58(%rsp)
leaq 0x150(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0xd0(%rsp), %rdi
leaq 0xe8(%rsp), %rcx
movq %r15, %rsi
callq 0x3c10
xorl %eax, %eax
leaq 0x10(%rsp), %rdi
movq %rax, 0x10(%rdi)
xorpd %xmm0, %xmm0
movapd %xmm0, (%rdi)
movq %rax, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movq %rax, 0x90(%rsp)
movapd %xmm0, 0x80(%rsp)
movq 0x118(%rsp), %rsi
subq 0x110(%rsp), %rsi
sarq $0x2, %rsi
callq 0x6afa
movq 0x110(%rsp), %r14
movq 0x118(%rsp), %r15
cmpq %r15, %r14
je 0x984f
leaq 0x10(%rsp), %rbx
movslq (%r14), %rdx
shlq $0x3, %rdx
addq 0x1d8(%rsp), %rdx
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x983e
movsd (%rdx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x9846
movq %rbx, %rdi
callq 0x7858
addq $0x4, %r14
cmpq %r15, %r14
jne 0x9810
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rdx
movl %ebp, %esi
movsd 0x128(%rsp), %xmm0
callq 0x9100
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
leaq 0x58(%rsp), %rcx
movl %ebp, %esi
callq 0x91f4
movq 0x110(%rsp), %rax
movq 0x118(%rsp), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
testl %ecx, %ecx
jle 0x98c3
movq 0x30(%rsp), %rdx
movq 0xd0(%rsp), %rsi
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %edi, %edi
movslq (%rax,%rdi,4), %r8
movl (%rdx,%rdi,4), %r9d
movl %r9d, (%rsi,%r8,4)
incq %rdi
cmpq %rdi, %rcx
jne 0x98af
movq 0x10(%rsp), %rax
cmpq %rax, 0x18(%rsp)
je 0x98d4
movq %rax, 0x18(%rsp)
movl %ebp, 0xc8(%rsp)
movq %r12, 0x180(%rsp)
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x98f4
movq %rax, 0x38(%rsp)
movq 0x130(%rsp), %rdi
movq 0x138(%rsp), %r8
cmpq %r8, %rdi
setne %cl
leaq -0x4(%r8), %rax
cmpq %rdi, %rax
seta %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x9939
leaq 0x4(%rdi), %rcx
movl -0x4(%rcx), %edx
movl (%rax), %esi
movl %esi, -0x4(%rcx)
movl %edx, (%rax)
addq $-0x4, %rax
leaq 0x4(%rcx), %rdx
cmpq %rax, %rcx
movq %rdx, %rcx
jb 0x991f
cmpq %r8, %rdi
je 0xa0d5
leaq 0x150(%rsp), %rbx
leaq 0xc0(%rsp), %rbp
movq %r8, 0x188(%rsp)
movslq (%rdi), %rcx
movq 0xd0(%rsp), %rax
cmpl $0x0, (%rax,%rcx,4)
jle 0xa0c8
movq 0x228(%rsp), %r14
leaq (%rcx,%rcx,2), %r15
movq 0x8(%r14,%r15,8), %rax
subq (%r14,%r15,8), %rax
sarq $0x2, %rax
testl %eax, %eax
jle 0xa0c8
movq %rcx, 0xa0(%rsp)
movq %rdi, 0x190(%rsp)
movq %rax, 0xb0(%rsp)
movl %eax, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
leaq 0x10(%rsp), %rdi
movq %rsi, 0x60(%rsp)
callq 0x6afa
leaq (%r14,%r15,8), %rax
movq (%rax), %r14
movq %rax, 0xb8(%rsp)
movq 0x8(%rax), %r12
cmpq %r12, %r14
movq 0xa0(%rsp), %r15
je 0x9a6f
movslq (%r14), %rax
movq 0x1d8(%rsp), %rcx
movsd (%rcx,%rax,8), %xmm0
movq 0x210(%rsp), %rcx
leaq (%rax,%rax,2), %rax
movq 0x8(%rcx,%rax,8), %rdx
subq (%rcx,%rax,8), %rdx
sarq $0x2, %rdx
movq %rdx, %xmm1
punpckldq 0x3ad7(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x3adf(%rip), %xmm1     # 0xd500
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movsd %xmm0, 0x150(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x9a55
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x9a62
leaq 0x10(%rsp), %rdi
movq %rbx, %rdx
callq 0xb3ac
addq $0x4, %r14
cmpq %r12, %r14
jne 0x99e3
movq 0xd0(%rsp), %rax
movl (%rax,%r15,4), %esi
leaq 0x10(%rsp), %rdi
movsd 0x128(%rsp), %xmm0
leaq 0x58(%rsp), %rdx
callq 0x9100
movq 0x50(%rsp), %r12
movq 0x18(%r12), %rax
movq 0xa0(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jle 0xa027
cmpl $0x1, 0x28(%rsp)
je 0xa027
movq 0xd0(%rsp), %rax
cmpl $0x1, (%rax,%rcx,4)
je 0xa027
cmpl $0x0, 0x28(%rsp)
jle 0xa049
movq 0xb0(%rsp), %rax
cmpl $0x2, %eax
movl $0x1, %r15d
cmovgel %eax, %r15d
leaq (,%r15,4), %rax
movq %rax, 0x1a0(%rsp)
xorl %ecx, %ecx
movsd 0x3bfa(%rip), %xmm0     # 0xd700
movsd %xmm0, 0xa8(%rsp)
movq %r15, 0x198(%rsp)
movl %ecx, 0xcc(%rsp)
movq 0xd0(%rsp), %rax
movq 0xa0(%rsp), %rcx
movl (%rax,%rcx,4), %esi
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
leaq 0x58(%rsp), %rcx
callq 0x91f4
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
je 0x9b76
xorl %esi, %esi
movl (%rcx), %edi
testl %edi, %edi
je 0x9b67
cmpl $0x1, %edi
jne 0x9b6a
movb $0x1, %al
jmp 0x9b6a
movb $0x1, %sil
addq $0x4, %rcx
cmpq %rdx, %rcx
jne 0x9b58
andb %sil, %al
movl %eax, %r14d
xorb $0x1, %r14b
testb $0x1, %al
je 0x9fc3
movl %r14d, %r13d
movl $0x0, 0x158(%rsp)
xorl %r14d, %r14d
movq %r14, 0x160(%rsp)
leaq 0x158(%rsp), %rax
movq %rax, 0x168(%rsp)
movq %rax, 0x170(%rsp)
movq %r14, 0x178(%rsp)
xorl %r15d, %r15d
movq 0xb8(%rsp), %rax
movq (%rax), %rsi
addq %r14, %rsi
movq %rbx, %rdi
callq 0xa8ce
movl %r15d, (%rax)
incl %r15d
addq $0x4, %r14
cmpq %r14, 0x1a0(%rsp)
jne 0x9bc1
leaq 0x1c0(%rsp), %rdi
movq 0x60(%rsp), %r15
movq %r15, %rsi
leaq 0xe8(%rsp), %r14
movq %r14, %rdx
callq 0xa932
xorpd %xmm0, %xmm0
movapd %xmm0, 0x240(%rsp)
movq $0x0, 0x250(%rsp)
movl $0xffffffff, 0xe8(%rsp) # imm = 0xFFFFFFFF
leaq 0x1a8(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
leaq 0x1f0(%rsp), %r15
movq %r15, %rcx
callq 0x3c10
movl $0xffffffff, 0xe8(%rsp) # imm = 0xFFFFFFFF
movq %r15, %rdi
movq 0x60(%rsp), %rsi
movq %r14, %rdx
leaq 0x68(%rsp), %r15
movq %r15, %rcx
callq 0x3c10
movb $0x0, 0x68(%rsp)
movq %r14, %rdi
movq 0x60(%rsp), %rsi
movq %r15, %rdx
movq %rbp, %rcx
callq 0x851c
movl $0x0, 0x68(%rsp)
xorl %eax, %eax
cltq
movq 0xb8(%rsp), %rcx
movq (%rcx), %rcx
movslq (%rcx,%rax,4), %rcx
leaq (%rax,%rax,2), %rdi
shlq $0x3, %rdi
addq 0x1c0(%rsp), %rdi
movq 0x48(%r12), %rax
leaq (%rcx,%rcx,2), %r15
movq 0x8(%rax,%r15,8), %rsi
subq (%rax,%r15,8), %rsi
sarq $0x2, %rsi
callq 0x58be
movq 0x48(%r12), %rax
movq (%rax,%r15,8), %r14
movq 0x8(%rax,%r15,8), %r15
cmpq %r15, %r14
je 0x9d37
movl (%r14), %eax
movl %eax, 0xc0(%rsp)
movslq 0x68(%rsp), %rax
leaq (%rax,%rax,2), %r12
shlq $0x3, %r12
addq 0x1c0(%rsp), %r12
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xa8ce
movq 0x8(%r12), %rsi
cmpq 0x10(%r12), %rsi
je 0x9d26
movl (%rax), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r12)
jmp 0x9d31
movq %r12, %rdi
movq %rax, %rdx
callq 0x3e1c
addq $0x4, %r14
jmp 0x9cdc
movslq 0x68(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpl $0x0, (%rcx,%rax,4)
movl %r13d, %r14d
jle 0x9d8e
movl $0x0, 0xc0(%rsp)
leaq 0x240(%rsp), %rdi
movq %rbp, %rsi
leaq 0x68(%rsp), %rdx
callq 0x84ae
movslq 0x68(%rsp), %rax
movq 0x1a8(%rsp), %rcx
movl %eax, (%rcx,%rax,4)
movslq 0x68(%rsp), %rax
movq 0x1f0(%rsp), %rcx
movl $0x0, (%rcx,%rax,4)
movl 0x68(%rsp), %eax
incl %eax
movl %eax, 0x68(%rsp)
cmpl 0xb0(%rsp), %eax
movq 0x50(%rsp), %r12
jl 0x9c92
leaq 0x1c0(%rsp), %rdi
leaq 0x240(%rsp), %rsi
leaq 0x1a8(%rsp), %rdx
leaq 0x1f0(%rsp), %rcx
leaq 0xe8(%rsp), %r8
callq 0x943b
movq $0x0, 0xc0(%rsp)
leaq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq %rbp, %rdx
leaq 0x2f(%rsp), %rcx
callq 0x6850
movq 0x198(%rsp), %r15
movq 0x10(%rsp), %rax
movq 0x1a8(%rsp), %rcx
movq 0x68(%rsp), %rdx
xorl %esi, %esi
xorpd %xmm2, %xmm2
movsd (%rax,%rsi,8), %xmm0
movslq (%rcx,%rsi,4), %rdi
addsd (%rdx,%rdi,8), %xmm0
movsd %xmm0, (%rdx,%rdi,8)
incq %rsi
cmpq %rsi, %r15
jne 0x9e1a
xorpd %xmm3, %xmm3
xorl %r12d, %r12d
movq 0x30(%rsp), %rax
movl (%rax,%r12,4), %eax
testl %eax, %eax
jle 0x9e6f
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movq 0x68(%rsp), %rax
movsd (%rax,%r12,8), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rax,%r12,8)
maxsd %xmm3, %xmm1
movapd %xmm1, %xmm3
jmp 0x9e82
movq 0x68(%rsp), %rax
movsd (%rax,%r12,8), %xmm0
ucomisd %xmm2, %xmm0
jne 0x9e8c
jp 0x9e8c
incq %r12
cmpq %r12, %r15
jne 0x9e3c
jmp 0x9ebc
movq 0x813d(%rip), %rax      # 0x11fd0
movq (%rax), %rdi
leaq 0x386b(%rip), %rsi      # 0xd708
movl %r12d, %edx
movl %r12d, %ecx
movb $0x1, %al
movsd %xmm3, 0x8(%rsp)
callq 0x21b0
movsd 0x8(%rsp), %xmm3
xorpd %xmm2, %xmm2
jmp 0x9e82
movsd 0xa8(%rsp), %xmm0
ucomisd %xmm3, %xmm0
seta %r12b
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x9ee8
movsd %xmm3, 0x8(%rsp)
callq 0x2150
movsd 0x8(%rsp), %xmm3
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x9f2e
movsd %xmm3, 0x8(%rsp)
callq 0x2150
movsd 0x8(%rsp), %xmm3
xorl %eax, %eax
movq %rax, 0xe8(%rsp)
movl %eax, 0xf0(%rsp)
movq %rax, 0xf8(%rsp)
movl %eax, 0x100(%rsp)
movq %rax, 0x108(%rsp)
movq 0x1f0(%rsp), %rdi
testq %rdi, %rdi
je 0x9f4c
movsd %xmm3, 0x8(%rsp)
callq 0x2150
movsd 0x8(%rsp), %xmm3
movq 0x1a8(%rsp), %rdi
testq %rdi, %rdi
je 0x9f6a
movsd %xmm3, 0x8(%rsp)
callq 0x2150
movsd 0x8(%rsp), %xmm3
movq 0x240(%rsp), %rdi
testq %rdi, %rdi
je 0x9f88
movsd %xmm3, 0x8(%rsp)
callq 0x2150
movsd 0x8(%rsp), %xmm3
minsd 0xa8(%rsp), %xmm3
movsd %xmm3, 0x8(%rsp)
orb %r12b, %r14b
leaq 0x1c0(%rsp), %rdi
callq 0xa9ba
movq %rbx, %rdi
callq 0xa9fa
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0xa8(%rsp)
movq 0x50(%rsp), %r12
testb $0x1, %r14b
je 0xa001
movq 0x40(%rsp), %rax
movapd 0x80(%rsp), %xmm0
movq 0x90(%rsp), %rcx
movq %rcx, 0x40(%rsp)
movapd 0x30(%rsp), %xmm1
movapd %xmm0, 0x30(%rsp)
movapd %xmm1, 0x80(%rsp)
movq %rax, 0x90(%rsp)
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
movl 0xcc(%rsp), %ecx
je 0xa019
movq %rax, 0x38(%rsp)
incl %ecx
cmpl 0x28(%rsp), %ecx
jne 0x9b17
jmp 0xa049
movq 0xd0(%rsp), %rax
movl (%rax,%rcx,4), %esi
leaq 0x10(%rsp), %rdi
leaq 0x80(%rsp), %rdx
leaq 0x58(%rsp), %rcx
callq 0x91f4
movq 0xb8(%rsp), %rax
movq (%rax), %rax
movq 0x80(%rsp), %rcx
movq 0xd0(%rsp), %rdx
movq 0xb0(%rsp), %rdi
cmpl $0x2, %edi
movl $0x1, %esi
cmovgel %edi, %esi
xorl %edi, %edi
movslq (%rax,%rdi,4), %r8
movl (%rcx,%rdi,4), %r9d
addl %r9d, (%rdx,%r8,4)
incq %rdi
cmpq %rdi, %rsi
jne 0xa079
movq 0x10(%rsp), %rax
cmpq %rax, 0x18(%rsp)
je 0xa09e
movq %rax, 0x18(%rsp)
movq 0x80(%rsp), %rax
cmpq %rax, 0x88(%rsp)
movq 0x190(%rsp), %rdi
movq 0x188(%rsp), %r8
je 0xa0c8
movq %rax, 0x88(%rsp)
addq $0x4, %rdi
cmpq %r8, %rdi
jne 0x995a
movslq 0xc8(%rsp), %rsi
movq 0x180(%rsp), %r12
movq %r12, %rdi
callq 0x58be
movq 0x50(%rsp), %rax
movq 0xb0(%rax), %rax
movq -0x18(%rax), %r14
movq -0x10(%rax), %r15
cmpq %r15, %r14
je 0xa165
leaq 0x150(%rsp), %rbx
movl (%r14), %eax
movl %eax, 0x150(%rsp)
movslq %eax, %rcx
movq 0xd0(%rsp), %rdx
cmpl $0x0, (%rdx,%rcx,4)
jle 0xa15c
movq 0x50(%rsp), %rdx
movq 0x18(%rdx), %rdx
cmpl $0x0, (%rdx,%rcx,4)
jg 0xa15c
movq 0x8(%r12), %rsi
cmpq 0x10(%r12), %rsi
je 0xa151
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r12)
jmp 0xa15c
movq %r12, %rdi
movq %rbx, %rdx
callq 0x3e1c
addq $0x4, %r14
cmpq %r15, %r14
jne 0xa10e
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0xa177
callq 0x2150
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xa186
callq 0x2150
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xa195
callq 0x2150
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0xa1a7
callq 0x2150
movq 0x1d8(%rsp), %rdi
testq %rdi, %rdi
je 0xa1b9
callq 0x2150
movq 0x260(%rsp), %rdi
testq %rdi, %rdi
je 0xa1cb
callq 0x2150
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0xa1dd
callq 0x2150
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0xa1ef
callq 0x2150
leaq 0x228(%rsp), %rdi
callq 0xa9ba
leaq 0x210(%rsp), %rdi
callq 0xa9ba
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa25e
movq %rax, %rbx
jmp 0xa341
jmp 0xa227
movq %rax, %rbx
jmp 0xa353
movq %rax, %rbx
jmp 0xa377
movq %rax, %rbx
jmp 0xa389
jmp 0xa25e
jmp 0xa25e
jmp 0xa25e
jmp 0xa25e
jmp 0xa272
jmp 0xa272
movq %rax, %rbx
jmp 0xa2af
jmp 0xa26a
movq %rax, %rbx
jmp 0xa2d3
movq %rax, %rbx
jmp 0xa2c1
jmp 0xa25e
movq %rax, %rbx
jmp 0xa2ff
jmp 0xa272
jmp 0xa272
movq %rax, %rbx
jmp 0xa2f2
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0xa2af
callq 0x2150
xorl %eax, %eax
movq %rax, 0xe8(%rsp)
movl %eax, 0xf0(%rsp)
movq %rax, 0xf8(%rsp)
movl %eax, 0x100(%rsp)
movq %rax, 0x108(%rsp)
movq 0x1f0(%rsp), %rdi
testq %rdi, %rdi
je 0xa2c1
callq 0x2150
movq 0x1a8(%rsp), %rdi
testq %rdi, %rdi
je 0xa2d3
callq 0x2150
movq 0x240(%rsp), %rdi
testq %rdi, %rdi
je 0xa2e5
callq 0x2150
leaq 0x1c0(%rsp), %rdi
callq 0xa9ba
leaq 0x150(%rsp), %rdi
callq 0xa9fa
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0xa311
callq 0x2150
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xa320
callq 0x2150
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xa32f
callq 0x2150
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0xa341
callq 0x2150
movq 0x1d8(%rsp), %rdi
testq %rdi, %rdi
je 0xa353
callq 0x2150
movq 0x260(%rsp), %rdi
testq %rdi, %rdi
je 0xa365
callq 0x2150
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0xa377
callq 0x2150
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0xa389
callq 0x2150
leaq 0x228(%rsp), %rdi
callq 0xa9ba
leaq 0x210(%rsp), %rdi
callq 0xa9ba
movq %rbx, %rdi
callq 0x2220