// File: ekg[P]sgd2/src/sgd2.hpp
// Function: sgd2::MSSP_weighted(std::vector<std::vector<sgd2::edge, std::allocator<sgd2::edge>>, std::allocator<std::vector<sgd2::edge, std::allocator<sgd2::edge>>>> const&, std::vector<unsigned long, std::allocator<unsigned long>> const&)
std::vector<term_sparse> MSSP_weighted(const std::vector<std::vector<edge>>& graph, const std::vector<uint64_t>& closest_pivots)
{
    uint64_t n = graph.size();

    // get pivots and their regions, but in sets
    std::unordered_map<uint64_t, std::unordered_set<uint64_t>> regions;
    for (uint64_t i = 0; i < n; i++)
    {
        if (regions.find(closest_pivots[i]) == regions.end())
        {
            regions[closest_pivots[i]] = std::unordered_set<uint64_t>();
        }
        regions[closest_pivots[i]].insert(i);
    }

    std::unordered_map<uint64_t, std::unordered_map<uint64_t, term_sparse>> termsDict;
    for (const auto& region : regions)
    {
        uint64_t p = region.first;

        std::vector<bool> visited(n, false);
        std::vector<double> d(n, std::numeric_limits<double>::max()); // init 'tentative' distances to infinity

        // edges are used 'invisibly' in this queue
        std::priority_queue<edge, std::vector<edge>, edge_comp> pq;

        // init initial edges so that pivot-pivot term is avoided
        for (edge e : graph[p])
        {
            // here the edge is not 'invisible'
            uint64_t next = e.target;
            double weight = e.weight;

            d[next] = weight; // init tentative value of d
            pq.push(edge(next, d[next]));
        }
        d[p] = 0;
        visited[p] = true;

        // q2 contains visited vertices' distances for s calculation
        std::queue<double> q2;
        uint64_t s = 1;

        while (!pq.empty())
        {
            uint64_t current = pq.top().target;
            double d_pi = pq.top().weight;
            pq.pop();
            
            if (!visited[current]) // ignore redundant elements in queue
            {
                visited[current] = true;

                // empty the second queue enough to calculate s
                while (!q2.empty() && q2.front() <= d_pi/2)
                {
                    q2.pop();
                    s += 1;
                }
                if (region.second.find(current) != region.second.end())
                {
                    q2.push(d_pi);
                }

                uint64_t i = current;
                if (i < p)
                {
                    if (termsDict.find(i) == termsDict.end())
                        termsDict[i] = std::unordered_map<uint64_t, term_sparse>();
                    if (termsDict[i].find(p) == termsDict[i].end())
                        termsDict[i].insert({ p, term_sparse(i, p, d_pi) });

                    termsDict[i].at(p).w_ij = s / ((double)d_pi * d_pi);
                }
                else
                {
                    if (termsDict.find(p) == termsDict.end())
                        termsDict[p] = std::unordered_map<uint64_t, term_sparse>();
                    if (termsDict[p].find(i) == termsDict[p].end())
                        termsDict[p].insert({ i, term_sparse(p, i, d_pi) });

                    termsDict[p].at(i).w_ji = s / ((double)d_pi * d_pi);
                }

                // update tentative distances
                for (edge e : graph[current])
                {
                    // here the edge is not 'invisible'
                    uint64_t next = e.target;
                    double weight = e.weight;

                    if (d_pi + weight < d[next]) 
                    {
                        d[next] = d_pi + weight; // update tentative value of d
                        pq.push(edge(next, d[next]));
                    }
                }
            }
        }
    }
    // 1-stress
    for (uint64_t i=0; i<n; i++)
    {
        for (edge e : graph[i])
        {
            uint64_t j = e.target;
            double d_ij = e.weight;
            if (i < j)
            {
                if (termsDict.find(i) == termsDict.end())
                    termsDict[i] = std::unordered_map<uint64_t, term_sparse>();
                if (termsDict[i].find(j) == termsDict[i].end())
                    termsDict[i].insert({ j, term_sparse(i, j, d_ij) });
                else
                    termsDict[i].at(j).d = d_ij;

                termsDict[i].at(j).w_ij = termsDict[i].at(j).w_ji = 1/(d_ij*d_ij);
            }
        }
    }
    std::vector<term_sparse> terms;
    for (const auto& i : termsDict)
    {
        for (const auto& j : i.second)
        {
            terms.push_back(j.second);
        }
    }
    return terms;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x7e0, %rsp            # imm = 0x7E0
movq %rdi, -0x5d0(%rbp)
movq %rdi, %rax
movq %rax, -0x5c8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0xbaa0
movq %rax, -0x20(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xb1f0
movq $0x0, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x7220
movq -0x18(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0xb270
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0xb240
movq %rax, -0x5d8(%rbp)
jmp 0x70e6
movq -0x5d8(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xb290
movq %rax, -0x80(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0xb210
testb $0x1, %al
jne 0x7114
jmp 0x71b4
xorps %xmm0, %xmm0
movaps %xmm0, -0xa0(%rbp)
movaps %xmm0, -0xb0(%rbp)
movaps %xmm0, -0xc0(%rbp)
movq $0x0, -0x90(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0xb2c0
movq -0x18(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0xb270
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0xb2e0
movq %rax, -0x5e0(%rbp)
jmp 0x7165
movq -0x5e0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0xb310
leaq -0xc0(%rbp), %rdi
callq 0xb340
jmp 0x71b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x8490
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0xb340
jmp 0x8490
movq -0x18(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0xb270
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0xb2e0
movq %rax, -0x5e8(%rbp)
jmp 0x71d6
movq -0x5e8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x9b40
movb %dl, -0x5f1(%rbp)
movq %rax, -0x5f0(%rbp)
jmp 0x71f5
movb -0x5f1(%rbp), %al
movq -0x5f0(%rbp), %rcx
movq %rcx, -0xd0(%rbp)
movb %al, -0xc8(%rbp)
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x70b6
leaq -0x108(%rbp), %rdi
callq 0xb360
leaq -0x58(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rdi
callq 0xb380
movq %rax, -0x118(%rbp)
movq -0x110(%rbp), %rdi
callq 0xb290
movq %rax, -0x120(%rbp)
leaq -0x118(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0xb3b0
testb $0x1, %al
jne 0x7279
jmp 0x7eed
leaq -0x118(%rbp), %rdi
callq 0xb3e0
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x130(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x608(%rbp)
movb $0x0, -0x159(%rbp)
leaq -0x15a(%rbp), %rdi
movq %rdi, -0x600(%rbp)
callq 0xa5e0
movq -0x608(%rbp), %rsi
movq -0x600(%rbp), %rcx
leaq -0x158(%rbp), %rdi
leaq -0x159(%rbp), %rdx
callq 0xa600
jmp 0x72e5
leaq -0x15a(%rbp), %rdi
callq 0xa680
movq -0x20(%rbp), %rax
movq %rax, -0x618(%rbp)
callq 0xa6a0
movsd %xmm0, -0x180(%rbp)
leaq -0x181(%rbp), %rdi
movq %rdi, -0x610(%rbp)
callq 0xa6b0
movq -0x618(%rbp), %rsi
movq -0x610(%rbp), %rcx
leaq -0x178(%rbp), %rdi
leaq -0x180(%rbp), %rdx
callq 0xa6d0
jmp 0x733f
leaq -0x181(%rbp), %rdi
callq 0xa750
leaq -0x1a8(%rbp), %rdi
callq 0xa770
jmp 0x7359
movq -0x10(%rbp), %rdi
movq -0x130(%rbp), %rsi
callq 0xbad0
movq %rax, -0x1b0(%rbp)
movq -0x1b0(%rbp), %rdi
callq 0xbaf0
movq %rax, -0x1b8(%rbp)
movq -0x1b0(%rbp), %rdi
callq 0xbb20
movq %rax, -0x1c0(%rbp)
leaq -0x1b8(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0xbb50
testb $0x1, %al
jne 0x73b2
jmp 0x74d3
leaq -0x1b8(%rbp), %rdi
callq 0xbb90
movups (%rax), %xmm0
movaps %xmm0, -0x1d0(%rbp)
movq -0x1d0(%rbp), %rax
movq %rax, -0x1d8(%rbp)
movsd -0x1c8(%rbp), %xmm0
movsd %xmm0, -0x1e0(%rbp)
movsd -0x1e0(%rbp), %xmm0
movsd %xmm0, -0x630(%rbp)
movq -0x1d8(%rbp), %rsi
leaq -0x178(%rbp), %rdi
movq %rdi, -0x628(%rbp)
callq 0xa7a0
movsd -0x630(%rbp), %xmm0
movq -0x628(%rbp), %rdi
movsd %xmm0, (%rax)
movq -0x1d8(%rbp), %rsi
movq %rsi, -0x620(%rbp)
callq 0xa7a0
movq -0x620(%rbp), %rsi
movsd (%rax), %xmm0
leaq -0x1f0(%rbp), %rdi
callq 0xa4c0
jmp 0x744f
leaq -0x1a8(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0xa7c0
jmp 0x7464
jmp 0x7466
leaq -0x1b8(%rbp), %rdi
callq 0xbbb0
jmp 0x7396
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x15a(%rbp), %rdi
callq 0xa680
jmp 0x8484
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x181(%rbp), %rdi
callq 0xa750
jmp 0x7edc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x7ed0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x7ec4
movq -0x130(%rbp), %rsi
leaq -0x178(%rbp), %rdi
callq 0xa7a0
movq $0x0, (%rax)
movq -0x130(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0xa8a0
movq %rdx, -0x640(%rbp)
movq %rax, -0x638(%rbp)
jmp 0x7510
movq -0x640(%rbp), %rax
movq -0x638(%rbp), %rcx
movq %rcx, -0x200(%rbp)
movq %rax, -0x1f8(%rbp)
leaq -0x200(%rbp), %rdi
movl $0x1, %esi
callq 0xa930
leaq -0x250(%rbp), %rdi
callq 0xbbd0
jmp 0x754b
movq $0x1, -0x258(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0xa810
movb %al, -0x641(%rbp)
jmp 0x756a
movb -0x641(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x757b
jmp 0x7e77
leaq -0x1a8(%rbp), %rdi
callq 0xa830
movq %rax, -0x650(%rbp)
jmp 0x7590
movq -0x650(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x260(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0xa830
movq %rax, -0x658(%rbp)
jmp 0x75b6
movq -0x658(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x268(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0xa850
jmp 0x75d8
movq -0x260(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0xa8a0
movq %rdx, -0x668(%rbp)
movq %rax, -0x660(%rbp)
jmp 0x75fb
movq -0x668(%rbp), %rax
movq -0x660(%rbp), %rcx
movq %rcx, -0x278(%rbp)
movq %rax, -0x270(%rbp)
leaq -0x278(%rbp), %rdi
callq 0xa900
xorb $-0x1, %al
testb $0x1, %al
jne 0x762e
jmp 0x7e72
movq -0x260(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0xa8a0
movq %rdx, -0x678(%rbp)
movq %rax, -0x670(%rbp)
jmp 0x7651
movq -0x678(%rbp), %rax
movq -0x670(%rbp), %rcx
movq %rcx, -0x288(%rbp)
movq %rax, -0x280(%rbp)
leaq -0x288(%rbp), %rdi
movl $0x1, %esi
callq 0xa930
leaq -0x250(%rbp), %rdi
callq 0xbc00
movb %al, -0x679(%rbp)
jmp 0x7692
movb -0x679(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x67a(%rbp)
jne 0x76e8
jmp 0x76a7
leaq -0x250(%rbp), %rdi
callq 0xbc20
movq %rax, -0x688(%rbp)
jmp 0x76bc
movq -0x688(%rbp), %rax
movsd (%rax), %xmm1
movsd -0x268(%rbp), %xmm0
movsd 0x16939(%rip), %xmm2    # 0x1e010
divsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
setae %al
movb %al, -0x67a(%rbp)
movb -0x67a(%rbp), %al
testb $0x1, %al
jne 0x76f4
jmp 0x772a
leaq -0x250(%rbp), %rdi
callq 0xbc40
jmp 0x7702
movq -0x258(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x258(%rbp)
jmp 0x767e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x7eb8
movq -0x128(%rbp), %rdi
addq $0x8, %rdi
leaq -0x260(%rbp), %rsi
callq 0xb470
movq %rax, -0x690(%rbp)
jmp 0x774a
movq -0x690(%rbp), %rax
movq %rax, -0x290(%rbp)
movq -0x128(%rbp), %rdi
addq $0x8, %rdi
callq 0xb4a0
movq %rax, -0x298(%rbp)
leaq -0x290(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0xb440
testb $0x1, %al
jne 0x7788
jmp 0x779f
leaq -0x250(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0xbc60
jmp 0x779d
jmp 0x779f
movq -0x260(%rbp), %rax
movq %rax, -0x2a0(%rbp)
movq -0x2a0(%rbp), %rax
cmpq -0x130(%rbp), %rax
jae 0x7a5f
leaq -0x108(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0xb500
movq %rax, -0x698(%rbp)
jmp 0x77dd
movq -0x698(%rbp), %rax
movq %rax, -0x2a8(%rbp)
leaq -0x108(%rbp), %rdi
callq 0xb530
movq %rax, -0x2b0(%rbp)
leaq -0x2a8(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0xb4d0
testb $0x1, %al
jne 0x781a
jmp 0x78a3
xorps %xmm0, %xmm0
movaps %xmm0, -0x2d0(%rbp)
movaps %xmm0, -0x2e0(%rbp)
movaps %xmm0, -0x2f0(%rbp)
movq $0x0, -0x2c0(%rbp)
leaq -0x2f0(%rbp), %rdi
callq 0xb560
leaq -0x108(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0xb580
movq %rax, -0x6a0(%rbp)
jmp 0x7865
movq -0x6a0(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
callq 0xb5b0
leaq -0x2f0(%rbp), %rdi
callq 0xb5e0
jmp 0x78a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x2f0(%rbp), %rdi
callq 0xb5e0
jmp 0x7eb8
leaq -0x108(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0xb580
movq %rax, -0x6a8(%rbp)
jmp 0x78bf
movq -0x6a8(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xb630
movq %rax, -0x6b0(%rbp)
jmp 0x78db
movq -0x6b0(%rbp), %rax
movq %rax, -0x2f8(%rbp)
leaq -0x108(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0xb580
movq %rax, -0x6b8(%rbp)
jmp 0x7905
movq -0x6b8(%rbp), %rdi
callq 0xb660
movq %rax, -0x300(%rbp)
leaq -0x2f8(%rbp), %rdi
leaq -0x300(%rbp), %rsi
callq 0xb600
testb $0x1, %al
jne 0x7934
jmp 0x79cc
leaq -0x108(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0xb580
movq %rax, -0x6c0(%rbp)
jmp 0x7950
movq -0x2a0(%rbp), %rsi
movq -0x130(%rbp), %rdx
movsd -0x268(%rbp), %xmm0
leaq -0x358(%rbp), %rdi
callq 0xb6d0
jmp 0x7974
leaq -0x330(%rbp), %rdi
leaq -0x130(%rbp), %rsi
leaq -0x358(%rbp), %rdx
callq 0xb720
jmp 0x7990
movq -0x6c0(%rbp), %rdi
leaq -0x330(%rbp), %rsi
callq 0xb690
movb %dl, -0x6c9(%rbp)
movq %rax, -0x6c8(%rbp)
jmp 0x79b2
movb -0x6c9(%rbp), %al
movq -0x6c8(%rbp), %rcx
movq %rcx, -0x368(%rbp)
movb %al, -0x360(%rbp)
movaps 0x1666d(%rip), %xmm1    # 0x1e040
movq -0x258(%rbp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x16669(%rip), %xmm1    # 0x1e050
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd -0x268(%rbp), %xmm1
mulsd %xmm1, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x6e0(%rbp)
leaq -0x108(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0xb580
movq %rax, -0x6d8(%rbp)
jmp 0x7a2a
movq -0x6d8(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xb760
movq %rax, -0x6e8(%rbp)
jmp 0x7a46
movq -0x6e8(%rbp), %rax
movsd -0x6e0(%rbp), %xmm0
movsd %xmm0, 0x18(%rax)
jmp 0x7cf8
leaq -0x108(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xb500
movq %rax, -0x6f0(%rbp)
jmp 0x7a7b
movq -0x6f0(%rbp), %rax
movq %rax, -0x370(%rbp)
leaq -0x108(%rbp), %rdi
callq 0xb530
movq %rax, -0x378(%rbp)
leaq -0x370(%rbp), %rdi
leaq -0x378(%rbp), %rsi
callq 0xb4d0
testb $0x1, %al
jne 0x7ab8
jmp 0x7b41
xorps %xmm0, %xmm0
movaps %xmm0, -0x390(%rbp)
movaps %xmm0, -0x3a0(%rbp)
movaps %xmm0, -0x3b0(%rbp)
movq $0x0, -0x380(%rbp)
leaq -0x3b0(%rbp), %rdi
callq 0xb560
leaq -0x108(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xb580
movq %rax, -0x6f8(%rbp)
jmp 0x7b03
movq -0x6f8(%rbp), %rdi
leaq -0x3b0(%rbp), %rsi
callq 0xb5b0
leaq -0x3b0(%rbp), %rdi
callq 0xb5e0
jmp 0x7b41
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x3b0(%rbp), %rdi
callq 0xb5e0
jmp 0x7eb8
leaq -0x108(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xb580
movq %rax, -0x700(%rbp)
jmp 0x7b5d
movq -0x700(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0xb630
movq %rax, -0x708(%rbp)
jmp 0x7b79
movq -0x708(%rbp), %rax
movq %rax, -0x3b8(%rbp)
leaq -0x108(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xb580
movq %rax, -0x710(%rbp)
jmp 0x7ba3
movq -0x710(%rbp), %rdi
callq 0xb660
movq %rax, -0x3c0(%rbp)
leaq -0x3b8(%rbp), %rdi
leaq -0x3c0(%rbp), %rsi
callq 0xb600
testb $0x1, %al
jne 0x7bd2
jmp 0x7c6a
leaq -0x108(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xb580
movq %rax, -0x718(%rbp)
jmp 0x7bee
movq -0x130(%rbp), %rsi
movq -0x2a0(%rbp), %rdx
movsd -0x268(%rbp), %xmm0
leaq -0x418(%rbp), %rdi
callq 0xb6d0
jmp 0x7c12
leaq -0x3f0(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
leaq -0x418(%rbp), %rdx
callq 0xb720
jmp 0x7c2e
movq -0x718(%rbp), %rdi
leaq -0x3f0(%rbp), %rsi
callq 0xb690
movb %dl, -0x721(%rbp)
movq %rax, -0x720(%rbp)
jmp 0x7c50
movb -0x721(%rbp), %al
movq -0x720(%rbp), %rcx
movq %rcx, -0x428(%rbp)
movb %al, -0x420(%rbp)
movaps 0x163cf(%rip), %xmm1    # 0x1e040
movq -0x258(%rbp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x163cb(%rip), %xmm1    # 0x1e050
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd -0x268(%rbp), %xmm1
mulsd %xmm1, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x738(%rbp)
leaq -0x108(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xb580
movq %rax, -0x730(%rbp)
jmp 0x7cc8
movq -0x730(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0xb760
movq %rax, -0x740(%rbp)
jmp 0x7ce4
movq -0x740(%rbp), %rax
movsd -0x738(%rbp), %xmm0
movsd %xmm0, 0x20(%rax)
movq -0x10(%rbp), %rdi
movq -0x260(%rbp), %rsi
callq 0xbad0
movq %rax, -0x430(%rbp)
movq -0x430(%rbp), %rdi
callq 0xbaf0
movq %rax, -0x438(%rbp)
movq -0x430(%rbp), %rdi
callq 0xbb20
movq %rax, -0x440(%rbp)
leaq -0x438(%rbp), %rdi
leaq -0x440(%rbp), %rsi
callq 0xbb50
testb $0x1, %al
jne 0x7d51
jmp 0x7e70
leaq -0x438(%rbp), %rdi
callq 0xbb90
movq (%rax), %rcx
movq %rcx, -0x450(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x448(%rbp)
movq -0x450(%rbp), %rax
movq %rax, -0x458(%rbp)
movsd -0x448(%rbp), %xmm0
movsd %xmm0, -0x460(%rbp)
movsd -0x268(%rbp), %xmm0
addsd -0x460(%rbp), %xmm0
movsd %xmm0, -0x748(%rbp)
movq -0x458(%rbp), %rsi
leaq -0x178(%rbp), %rdi
callq 0xa7a0
movsd -0x748(%rbp), %xmm1
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x7e5d
movsd -0x268(%rbp), %xmm0
movsd -0x460(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x760(%rbp)
movq -0x458(%rbp), %rsi
leaq -0x178(%rbp), %rdi
movq %rdi, -0x758(%rbp)
callq 0xa7a0
movsd -0x760(%rbp), %xmm0
movq -0x758(%rbp), %rdi
movsd %xmm0, (%rax)
movq -0x458(%rbp), %rsi
movq %rsi, -0x750(%rbp)
callq 0xa7a0
movq -0x750(%rbp), %rsi
movsd (%rax), %xmm0
leaq -0x470(%rbp), %rdi
callq 0xa4c0
jmp 0x7e46
leaq -0x1a8(%rbp), %rdi
leaq -0x470(%rbp), %rsi
callq 0xa7c0
jmp 0x7e5b
jmp 0x7e5d
jmp 0x7e5f
leaq -0x438(%rbp), %rdi
callq 0xbbb0
jmp 0x7d35
jmp 0x7e72
jmp 0x7556
leaq -0x250(%rbp), %rdi
callq 0xbc90
leaq -0x1a8(%rbp), %rdi
callq 0xaa60
leaq -0x178(%rbp), %rdi
callq 0xaa80
leaq -0x158(%rbp), %rdi
callq 0xaae0
leaq -0x118(%rbp), %rdi
callq 0xb790
jmp 0x725d
leaq -0x250(%rbp), %rdi
callq 0xbc90
leaq -0x1a8(%rbp), %rdi
callq 0xaa60
leaq -0x178(%rbp), %rdi
callq 0xaa80
leaq -0x158(%rbp), %rdi
callq 0xaae0
jmp 0x8484
movq $0x0, -0x478(%rbp)
movq -0x478(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x8313
movq -0x10(%rbp), %rdi
movq -0x478(%rbp), %rsi
callq 0xbad0
movq %rax, -0x480(%rbp)
movq -0x480(%rbp), %rdi
callq 0xbaf0
movq %rax, -0x488(%rbp)
movq -0x480(%rbp), %rdi
callq 0xbb20
movq %rax, -0x490(%rbp)
leaq -0x488(%rbp), %rdi
leaq -0x490(%rbp), %rsi
callq 0xbb50
testb $0x1, %al
jne 0x7f62
jmp 0x82fa
leaq -0x488(%rbp), %rdi
callq 0xbb90
movq (%rax), %rcx
movq %rcx, -0x4a0(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x498(%rbp)
movq -0x4a0(%rbp), %rax
movq %rax, -0x4a8(%rbp)
movsd -0x498(%rbp), %xmm0
movsd %xmm0, -0x4b0(%rbp)
movq -0x478(%rbp), %rax
cmpq -0x4a8(%rbp), %rax
jae 0x82e7
leaq -0x108(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0xb500
movq %rax, -0x768(%rbp)
jmp 0x7fd1
movq -0x768(%rbp), %rax
movq %rax, -0x4b8(%rbp)
leaq -0x108(%rbp), %rdi
callq 0xb530
movq %rax, -0x4c0(%rbp)
leaq -0x4b8(%rbp), %rdi
leaq -0x4c0(%rbp), %rsi
callq 0xb4d0
testb $0x1, %al
jne 0x800e
jmp 0x80a8
xorps %xmm0, %xmm0
movaps %xmm0, -0x4e0(%rbp)
movaps %xmm0, -0x4f0(%rbp)
movaps %xmm0, -0x500(%rbp)
movq $0x0, -0x4d0(%rbp)
leaq -0x500(%rbp), %rdi
callq 0xb560
leaq -0x108(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0xb580
movq %rax, -0x770(%rbp)
jmp 0x8059
movq -0x770(%rbp), %rdi
leaq -0x500(%rbp), %rsi
callq 0xb5b0
leaq -0x500(%rbp), %rdi
callq 0xb5e0
jmp 0x80a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x8484
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x500(%rbp), %rdi
callq 0xb5e0
jmp 0x8484
leaq -0x108(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0xb580
movq %rax, -0x778(%rbp)
jmp 0x80c4
movq -0x778(%rbp), %rdi
leaq -0x4a8(%rbp), %rsi
callq 0xb630
movq %rax, -0x780(%rbp)
jmp 0x80e0
movq -0x780(%rbp), %rax
movq %rax, -0x508(%rbp)
leaq -0x108(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0xb580
movq %rax, -0x788(%rbp)
jmp 0x810a
movq -0x788(%rbp), %rdi
callq 0xb660
movq %rax, -0x510(%rbp)
leaq -0x508(%rbp), %rdi
leaq -0x510(%rbp), %rsi
callq 0xb600
testb $0x1, %al
jne 0x8139
jmp 0x81d3
leaq -0x108(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0xb580
movq %rax, -0x790(%rbp)
jmp 0x8155
movq -0x478(%rbp), %rsi
movq -0x4a8(%rbp), %rdx
movsd -0x4b0(%rbp), %xmm0
leaq -0x568(%rbp), %rdi
callq 0xb6d0
jmp 0x8179
leaq -0x540(%rbp), %rdi
leaq -0x4a8(%rbp), %rsi
leaq -0x568(%rbp), %rdx
callq 0xb720
jmp 0x8195
movq -0x790(%rbp), %rdi
leaq -0x540(%rbp), %rsi
callq 0xb690
movb %dl, -0x799(%rbp)
movq %rax, -0x798(%rbp)
jmp 0x81b7
movb -0x799(%rbp), %al
movq -0x798(%rbp), %rcx
movq %rcx, -0x578(%rbp)
movb %al, -0x570(%rbp)
jmp 0x822f
movsd -0x4b0(%rbp), %xmm0
movsd %xmm0, -0x7b0(%rbp)
leaq -0x108(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0xb580
movq %rax, -0x7a8(%rbp)
jmp 0x81ff
movq -0x7a8(%rbp), %rdi
leaq -0x4a8(%rbp), %rsi
callq 0xb760
movq %rax, -0x7b8(%rbp)
jmp 0x821b
movq -0x7b8(%rbp), %rax
movsd -0x7b0(%rbp), %xmm0
movsd %xmm0, 0x10(%rax)
movsd -0x4b0(%rbp), %xmm1
mulsd %xmm1, %xmm1
movsd 0x15dc5(%rip), %xmm0    # 0x1e008
divsd %xmm1, %xmm0
movsd %xmm0, -0x7c8(%rbp)
leaq -0x108(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0xb580
movq %rax, -0x7c0(%rbp)
jmp 0x826b
movq -0x7c0(%rbp), %rdi
leaq -0x4a8(%rbp), %rsi
callq 0xb760
movq %rax, -0x7d0(%rbp)
jmp 0x8287
movq -0x7d0(%rbp), %rax
movsd -0x7c8(%rbp), %xmm0
movsd %xmm0, 0x20(%rax)
leaq -0x108(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0xb580
movq %rax, -0x7d8(%rbp)
jmp 0x82b7
movq -0x7d8(%rbp), %rdi
leaq -0x4a8(%rbp), %rsi
callq 0xb760
movq %rax, -0x7e0(%rbp)
jmp 0x82d3
movq -0x7e0(%rbp), %rax
movsd -0x7c8(%rbp), %xmm0
movsd %xmm0, 0x18(%rax)
jmp 0x82e9
leaq -0x488(%rbp), %rdi
callq 0xbbb0
jmp 0x7f46
jmp 0x82fc
movq -0x478(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x478(%rbp)
jmp 0x7ef8
movq -0x5d0(%rbp), %rdi
movb $0x0, -0x579(%rbp)
callq 0xb7c0
leaq -0x108(%rbp), %rax
movq %rax, -0x588(%rbp)
movq -0x588(%rbp), %rdi
callq 0xb7e0
movq %rax, -0x590(%rbp)
movq -0x588(%rbp), %rdi
callq 0xb530
movq %rax, -0x598(%rbp)
leaq -0x590(%rbp), %rdi
leaq -0x598(%rbp), %rsi
callq 0xb810
testb $0x1, %al
jne 0x8376
jmp 0x8443
leaq -0x590(%rbp), %rdi
callq 0xb840
movq %rax, -0x5a0(%rbp)
movq -0x5a0(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x5a8(%rbp)
movq -0x5a8(%rbp), %rdi
callq 0xb870
movq %rax, -0x5b0(%rbp)
movq -0x5a8(%rbp), %rdi
callq 0xb8a0
movq %rax, -0x5b8(%rbp)
leaq -0x5b0(%rbp), %rdi
leaq -0x5b8(%rbp), %rsi
callq 0xb8d0
testb $0x1, %al
jne 0x83da
jmp 0x8430
leaq -0x5b0(%rbp), %rdi
callq 0xb900
movq -0x5d0(%rbp), %rdi
movq %rax, -0x5c0(%rbp)
movq -0x5c0(%rbp), %rsi
addq $0x8, %rsi
callq 0xb930
jmp 0x8406
jmp 0x8408
leaq -0x5b0(%rbp), %rdi
callq 0xb9a0
jmp 0x83c1
movq -0x5d0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
callq 0xba00
jmp 0x8484
jmp 0x8432
leaq -0x590(%rbp), %rdi
callq 0xb9d0
jmp 0x835a
movb $0x1, -0x579(%rbp)
testb $0x1, -0x579(%rbp)
jne 0x845f
movq -0x5d0(%rbp), %rdi
callq 0xba00
leaq -0x108(%rbp), %rdi
callq 0xba60
leaq -0x58(%rbp), %rdi
callq 0xba80
movq -0x5c8(%rbp), %rax
addq $0x7e0, %rsp            # imm = 0x7E0
popq %rbp
retq
leaq -0x108(%rbp), %rdi
callq 0xba60
leaq -0x58(%rbp), %rdi
callq 0xba80
movq -0x70(%rbp), %rdi
callq 0x22a0
nopw %cs:(%rax,%rax)