// File: /workspace/github_cpp_makefile_star2_O2/realuptime[P]PolyDetector/PolyDetector.cpp
// Function: PolyDetector::FindPolys()
bool PolyDetector::FindPolys()
{
    //logoutf("FindPolys");
    
    //processed.clear();
    pointToLines.clear();
    collinearLineMap.clear();
    
    // assign line ids
    uint32_t n = 0;
    lineIdToIdx.clear();
    for (auto &l : lines)
    {
        //logoutf("assign id %u to #%u", n, l.id);
        
        if (dissolveCount == 0) // only on first step
        {
            //logoutf("rename line #%u to %u", l.id, n);
            l.id = n;
        }
        
        if (!l.ignore)
        {
            addPointToLine(l.aIdx, l.id);
            addPointToLine(l.bIdx, l.id);
            
            //logoutf("line %u a:P%u b:P%u len:%f", l.id, l.aIdx, l.bIdx, l.a.dist2(l.b));
        }
        
        /*
        if (l.id != n)
        {
            logoutf("line %u does not match n %u", l.id, n);
            assert(l.id != n);
        }
        */
        lineIdToIdx[l.id] = n; // lineIdToIdx[l.id] = lines[n]
        
        n++;
    }
    
    // build collinearLineMap
    for (auto &lo : origLines)
    {
        for (uint32_t i = 0; i < lines.size(); ++i)
        {
            auto &l1 = lines[i];
            if (!l1.ignore && l1.origLine == lo.id)
            {
                for (uint32_t j = i + 1; j < lines.size(); ++j)
                {
                    auto &l2 = lines[j];
                    if (!l2.ignore && l2.origLine == lo.id)
                    {
                        setCollinear(l1.id, l2.id);
                    }
                }
            }
        }
    }
    
    if (verbose > 1)
    {
        for (auto &kv : collinearLineMap)
        {
            for (auto &c : kv.second)
            {
                logoutf("[%u %u] are collinear", kv.first, c);
            }
        }
    }
    if (verbose)
        logoutf("collinearLineMap size:%u", uint32_t(collinearLineMap.size()));

    // Build neighbors
    std::vector<uint32_t> neigh;
    _neighbors.clear();
    for (uint32_t i = 0; i < lines.size(); ++i)
    {
        auto &l1 = lines[i];
        if (!l1.ignore)
        {
            neigh.clear();
            for (uint32_t j = i + 1; j < lines.size(); ++j)
            {
                auto &l2 = lines[j];
                if (!l2.ignore && l1.HasCommonIdxPoints(l2))
                {
                    neigh.push_back(l2.id);
                }
            }
            if (!neigh.empty())
            {
                //std::sort(neigh.begin(), neigh.end(), [this, &l1](const uint32_t &nid1, const uint32_t &nid2) {
                //    return l1.compareNeigh(*this, nid1, nid2);
                //});
                for (auto &nid : neigh)
                {
                    if (verbose > 1)
                        logoutf("line %u intersects %u", l1.id, nid);
                    
                    _neighbors[l1.id].push_back(nid);
                    _neighbors[nid].push_back(l1.id);
                }
            }
        }
    }
    for (auto &kv : _neighbors)
    {
        auto l = findLine(kv.first);
        if (l)
            l->sortNeigh(*this);
    }
    if (verbose)
        logoutf("neighbors MatSize:%u", uint32_t(_neighbors.size()));
    
    if (1)
    {
        for (uint32_t i = 0; i < lines.size(); ++i)
        {
            auto &l1 = lines[i];
            for (uint32_t j = i + 1; j < lines.size(); ++j)
            {
                auto &l2 = lines[j];
                if (l1.id == l2.id)
                {
                    logoutf("line %s and %s have the same ids!", l1.toString(*this).c_str(), l2.toString(*this).c_str());
                    assert(false);
                }
            }
        }
        
        if (verbose > 2)
        //if (verbose)
        {
            for (auto &l : lines)
            {
                if (l.ignore) continue;
                logoutf("FP: %s", l.toString(*this).c_str());
            }
        }
    }
    
    if (verbose > 1)
    {
        for (auto &kv : _neighbors)
        {
            std::string str;
            for (auto &n : _neighbors[kv.first])
            {
                str += std::to_string(n) + " ";
            }
            logoutf("[RT:%u] [%u] nNeigh:%u [%s]", dissolveCount, kv.first, uint32_t(_neighbors[kv.first].size()), str.c_str());
        }
    }
    
    if (dissolveCount == 0)
    {
        for (auto &l : lines)
            l.processed = 0;
    }
    
    for (auto &kv : _neighbors) // point by point
    {
        if (_neighbors[kv.first].size() < 2) continue;
        
        if (verbose > 2)
            logoutf("----------- BEGIN L:%u {", kv.first);
        
        PolyCycle cycle;
        cycle.startIdx = cycle.lastIdx = kv.first;
        cycle.isClosed = false;
        BuildCycle(kv.first, cycle);
        
        if (verbose > 2)
            logoutf("} ----------- END L:%u", kv.first);
    }
    
    std::sort(_cycles.begin(), _cycles.end(), [](const PolyCycle &a, const PolyCycle &b) {
        return a.idxToString().compare(b.idxToString()) < 0;
    });
    
#if 1
    for (auto &cycle : _cycles)
    {
        cycle.fine = true;
        if (!cycle.convex(*this))
            cycle.fine = false;
    }
#endif
    
#if 0
    for (uint32_t i = 0; i < _cycles.size(); ++i)
    {
        auto &c1 = _cycles[i];
        if (!c1.fine) continue;
        for (uint32_t j = 0; j < _cycles.size(); ++j)
        {
            if (i == j) continue;
            auto &c2 = _cycles[j];
            if (!c2.fine) continue;
            
            if (/* DISABLES CODE */ (0))
            {
                if (c2.idx.size() > c1.idx.size())
                {
                    bool included = true;
                    for (auto &n1 : c1.idx)
                    {
                        if (std::find(c2.idx.begin(), c2.idx.end(), n1) == c2.idx.end())
                        {
                            included = false;
                            break;
                        }
                    }
                    if (included)
                    {
                        c2.fine = false;
                        //c1.fine = false;
                    }
                }
            }
        }
    }
#endif
    
    for (auto &cycle : _cycles)
    {
        //if (!cycle.fine) continue;
        
        if (verbose)
            cycle.print("[FINI] ");
        
        if (!cycle.fine) continue;
        
        // other the lines for proper triangulation
        std::vector<uint32_t> lidx;
        lidx.reserve(cycle.idx.size());
        for (auto &lid : cycle.idx)
            lidx.push_back(lid);
        std::sort(lidx.begin(), lidx.end(), [this](const uint32_t &lid1, const uint32_t &lid2) {
            auto l1 = findLine(lid1, false);
            auto l2 = findLine(lid2, false);
            if (!l1 || !l2)
            {
                assert(false);
                return true;
            }
            return PolyLine::bCompareLineOrder(*l1, *l2);
        });
        
        // check if not already exists
        bool exists = false;
        for (auto &p : polys)
        {
            if (p.cycle.Equals(cycle))
            {
                exists = true;
                break;
            }
        }
        if (exists)
        {
            logoutf("WARN: cycle %s already exists!", cycle.toString().c_str());
            continue;
        }
        
        PolyPol poly;
        PointType *last = nullptr;
        for (auto &id : lidx)
        {
            auto lPtr = findLine(id);
            if (lPtr)
            {
                lPtr->CalculateFirstAndLastPoint();
                
                auto &a = intersectionPoints[lPtr->aIdx];
                auto &b = intersectionPoints[lPtr->bIdx];
                
                //lPtr->incTook(*this);
                
                poly.addPointChecked(a);
                
                last = &b;
            }
        }
        if (last)
            poly.addPointChecked(*last);
        
        poly.id = cycle.startIdx;
        poly.cycle = cycle;
        
        poly._area = poly.TriangleArea(*this);
        poly.dissolveStep = dissolveCount;
        
        polys.push_back(std::move(poly));
    }
    
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdi, %r15
addq $0xe0, %rdi
callq 0x9eae
leaq 0x98(%r15), %rdi
callq 0x9eae
leaq 0x110(%r15), %r14
movq %r14, %rdi
callq 0xb28e
movq 0x30(%r15), %rbx
movq %r15, 0x8(%rsp)
movq 0x38(%r15), %r15
xorl %ebp, %ebp
movq 0x8(%rsp), %r12
cmpq %r15, %rbx
je 0x4b58
movq 0x8(%rsp), %rax
cmpl $0x0, 0x148(%rax)
jne 0x4b17
movl %ebp, 0x60(%rbx)
cmpb $0x0, 0x74(%rbx)
jne 0x4b3f
movl 0x60(%rbx), %edx
movl 0x80(%rbx), %esi
movq %r12, %rdi
callq 0x44ce
movl 0x60(%rbx), %edx
movl 0x84(%rbx), %esi
movq %r12, %rdi
callq 0x44ce
leaq 0x60(%rbx), %rsi
movq %r14, %rdi
callq 0xb2e4
movl %ebp, (%rax)
incl %ebp
addq $0x90, %rbx
jmp 0x4b01
movq 0x8(%rsp), %rbp
movq 0x18(%rbp), %rbx
movq 0x20(%rbp), %rax
movq %rax, 0x10(%rsp)
movl $0x90, %r15d
movq 0x8(%rsp), %r14
cmpq 0x10(%rsp), %rbx
je 0x4c2b
movq 0x30(%rbp), %rcx
movq 0x38(%rbp), %rsi
xorl %ebp, %ebp
movq %rcx, %rdi
movl %ebp, %r8d
movq %rsi, %rax
subq %rdi, %rax
cqto
idivq %r15
cmpq %r8, %rax
jbe 0x4c1a
imulq $0x90, %r8, %r12
cmpb $0x0, 0x74(%rdi,%r12)
jne 0x4c13
addq %rdi, %r12
movl 0x6c(%r12), %eax
cmpl 0x60(%rbx), %eax
jne 0x4c13
movl %ebp, %r13d
incl %r13d
movl %r13d, %r8d
movq %rsi, %rax
subq %rdi, %rax
cqto
idivq %r15
cmpq %r8, %rax
jbe 0x4c13
imulq $0x90, %r8, %rax
cmpb $0x0, 0x74(%rdi,%rax)
jne 0x4bee
addq %rax, %rdi
movl 0x6c(%rdi), %eax
cmpl 0x60(%rbx), %eax
je 0x4bf6
incl %r13d
movq %rcx, %rdi
jmp 0x4bc2
movl 0x60(%r12), %esi
movl 0x60(%rdi), %edx
movq %r14, %rdi
callq 0x6526
movq 0x30(%r14), %rcx
movq 0x38(%r14), %rsi
movq %rcx, %rdi
jmp 0x4bbf
incl %ebp
jmp 0x4b8d
addq $0x90, %rbx
movq 0x8(%rsp), %rbp
jmp 0x4b75
movl 0x60(%rbp), %eax
cmpl $0x1, %eax
jbe 0x4c82
movq 0xb0(%rbp), %r15
leaq 0xa0(%rbp), %rbx
leaq 0x8eaf(%rip), %r14      # 0xdaf7
cmpq %rbx, %r15
je 0x4c7f
movq 0x28(%r15), %r12
movq 0x30(%r15), %r13
cmpq %r13, %r12
je 0x4c72
movl 0x20(%r15), %esi
movl (%r12), %edx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2040
addq $0x4, %r12
jmp 0x4c55
movq %r15, %rdi
callq 0x2100
movq %rax, %r15
jmp 0x4c48
movl 0x60(%rbp), %eax
testl %eax, %eax
je 0x4c9a
movl 0xc0(%rbp), %esi
leaq 0x8e7b(%rip), %rdi      # 0xdb0e
xorl %eax, %eax
callq 0x2040
xorps %xmm0, %xmm0
leaq 0xb0(%rsp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
leaq 0x68(%rbp), %r15
movq %r15, %rdi
callq 0x9eae
xorl %r12d, %r12d
movq %r15, 0x18(%rsp)
movl %r12d, %esi
movq 0x30(%rbp), %r14
movq 0x38(%rbp), %rcx
movq %rcx, %rax
subq %r14, %rax
cqto
movl $0x90, %edi
idivq %rdi
cmpq %rsi, %rax
jbe 0x4dfc
imulq $0x90, %rsi, %r13
cmpb $0x0, 0x74(%r14,%r13)
jne 0x4def
movq 0xb0(%rsp), %rax
cmpq %rax, 0xb8(%rsp)
je 0x4d12
movq %rax, 0xb8(%rsp)
addq %r14, %r13
movl %r12d, %r15d
subq %r14, %rcx
movq %rcx, %rax
cqto
movl $0x90, %ecx
idivq %rcx
movq %rax, %rbp
incl %r15d
movl %r15d, %eax
cmpq %rax, %rbp
jbe 0x4d7a
imulq $0x90, %rax, %rbx
cmpb $0x0, 0x74(%r14,%rbx)
jne 0x4d2b
addq %r14, %rbx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x271a
testb %al, %al
je 0x4d2b
addq $0x60, %rbx
leaq 0xb0(%rsp), %rdi
movq %rbx, %rsi
callq 0x87ac
movq 0x8(%rsp), %rax
movq 0x30(%rax), %r14
movq 0x38(%rax), %rcx
jmp 0x4d18
movq 0xb0(%rsp), %rbp
movq 0xb8(%rsp), %rbx
cmpq %rbx, %rbp
movq 0x18(%rsp), %r15
je 0x4def
addq $0x60, %r13
cmpq %rbx, %rbp
je 0x4def
movq 0x8(%rsp), %rax
cmpl $0x2, 0x60(%rax)
jb 0x4dbd
movl (%r13), %esi
movl (%rbp), %edx
leaq 0x8d72(%rip), %rdi      # 0xdb28
xorl %eax, %eax
callq 0x2040
movq %r15, %rdi
movq %r13, %rsi
callq 0x875e
movq %rax, %rdi
movq %rbp, %rsi
callq 0x87ac
movq %r15, %rdi
movq %rbp, %rsi
callq 0x875e
movq %rax, %rdi
movq %r13, %rsi
callq 0x87ac
addq $0x4, %rbp
jmp 0x4d98
incl %r12d
movq 0x8(%rsp), %rbp
jmp 0x4cc1
movq 0x80(%rbp), %r15
leaq 0x70(%rbp), %rax
movq %rax, 0x10(%rsp)
pushq $0x1
popq %rbp
cmpq 0x10(%rsp), %r15
je 0x4e45
movl 0x20(%r15), %esi
movq 0x8(%rsp), %rdi
movl %ebp, %edx
callq 0x46ec
testq %rax, %rax
je 0x4e38
movq %rax, %rdi
movq 0x8(%rsp), %rsi
callq 0x6480
movq %r15, %rdi
callq 0x2100
movq %rax, %r15
jmp 0x4e0f
movq 0x8(%rsp), %rbp
cmpl $0x0, 0x60(%rbp)
je 0x4e64
movl 0x90(%rbp), %esi
leaq 0x8ce2(%rip), %rdi      # 0xdb3f
xorl %eax, %eax
callq 0x2040
movq 0x30(%rbp), %r15
movq 0x38(%rbp), %rbx
movq %rbx, %rax
subq %r15, %rax
movl $0x90, %ecx
cqto
idivq %rcx
xorl %ecx, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jbe 0x4f26
imulq $0x90, %rcx, %rsi
addq %r15, %rsi
incl %ecx
movl %ecx, %edx
movl %edx, %edx
cmpq %rdx, %rax
jbe 0x4e7e
imulq $0x90, %rdx, %r14
movl 0x60(%rsi), %edi
incl %edx
cmpl 0x60(%r15,%r14), %edi
jne 0x4e97
leaq 0x20(%rsp), %rdi
movq %rbp, %rdx
callq 0x4208
addq %r14, %r15
movq 0x20(%rsp), %rbx
leaq 0x90(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x4208
leaq 0x90(%rsp), %r14
movq (%r14), %rdx
leaq 0x8c6a(%rip), %rdi      # 0xdb55
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2040
movq %r14, %rdi
callq 0x20b0
leaq 0x20(%rsp), %rdi
callq 0x20b0
leaq 0x8b9d(%rip), %rdi      # 0xdaab
leaq 0x81ff(%rip), %rsi      # 0xd114
leaq 0x8c5c(%rip), %rcx      # 0xdb78
movl $0x846, %edx            # imm = 0x846
callq 0x20f0
movl 0x60(%rbp), %eax
cmpl $0x3, %eax
jb 0x4f77
leaq 0x20(%rsp), %r12
leaq 0x8c5d(%rip), %r13      # 0xdb97
cmpq %rbx, %r15
je 0x4f74
cmpb $0x0, 0x74(%r15)
jne 0x4f6b
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x4208
movq 0x20(%rsp), %rsi
movq %r13, %rdi
xorl %eax, %eax
callq 0x2040
movq %r12, %rdi
callq 0x20b0
addq $0x90, %r15
jmp 0x4f3a
movl 0x60(%rbp), %eax
cmpl $0x2, %eax
jb 0x5088
movq 0x8(%rsp), %rax
movq 0x80(%rax), %rax
leaq 0x20(%rsp), %r13
leaq 0xd8(%rsp), %rbp
leaq 0x8ab8(%rip), %r15      # 0xda58
leaq 0x90(%rsp), %r12
cmpq 0x10(%rsp), %rax
je 0x5088
movq %rax, 0xc8(%rsp)
leaq 0x20(%rax), %rsi
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
andq $0x0, 0x28(%rsp)
movb $0x0, 0x30(%rsp)
movq 0x18(%rsp), %rdi
movq %rsi, 0xd0(%rsp)
callq 0x875e
movq (%rax), %rbx
movq 0x8(%rax), %r14
cmpq %r14, %rbx
je 0x502b
movl (%rbx), %esi
movq %rbp, %rdi
callq 0x87e9
movq %r12, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x87ca
movq %r13, %rdi
movq %r12, %rsi
callq 0x2220
movq %r12, %rdi
callq 0x20b0
movq %rbp, %rdi
callq 0x20b0
addq $0x4, %rbx
jmp 0x4fed
movq 0x8(%rsp), %rax
movl 0x148(%rax), %r14d
movq 0xd0(%rsp), %rsi
movl (%rsi), %ebx
movq 0x18(%rsp), %rdi
callq 0x875e
movq 0x8(%rax), %rcx
subq (%rax), %rcx
shrq $0x2, %rcx
movq 0x20(%rsp), %r8
leaq 0x8b3d(%rip), %rdi      # 0xdb9f
movl %r14d, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x2040
movq %r13, %rdi
callq 0x20b0
movq 0xc8(%rsp), %rdi
callq 0x2100
jmp 0x4fa8
movq 0x8(%rsp), %rdx
cmpl $0x0, 0x148(%rdx)
je 0x51e2
movq 0x80(%rdx), %r12
leaq 0xf8(%rsp), %r13
leaq 0x20(%rsp), %rbp
movq 0x8(%rsp), %r14
cmpq 0x10(%rsp), %r12
je 0x517d
leaq 0x20(%r12), %r15
movq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0x875e
movq 0x8(%rax), %rcx
subq (%rax), %rcx
cmpq $0x5, %rcx
jb 0x516d
movq 0x8(%rsp), %rax
cmpl $0x3, 0x60(%rax)
jb 0x50fd
movl (%r15), %esi
leaq 0x8ac6(%rip), %rdi      # 0xdbbc
xorl %eax, %eax
callq 0x2040
andl $0x0, 0x28(%rsp)
andq $0x0, 0x30(%rsp)
leaq 0x28(%rsp), %rax
movq %rax, 0x38(%rsp)
movq %rax, 0x40(%rsp)
andq $0x0, 0x48(%rsp)
movl (%r15), %ebx
movl %ebx, 0x54(%rsp)
movl %ebx, 0x50(%rsp)
movb $0x0, 0x58(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x8b54
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
callq 0x6048
movq %r13, %rdi
callq 0x96fe
cmpl $0x3, 0x60(%r14)
jb 0x5165
movl (%r15), %esi
leaq 0x8a78(%rip), %rdi      # 0xdbd6
xorl %eax, %eax
callq 0x2040
movq %rbp, %rdi
callq 0x96fe
movq %r12, %rdi
callq 0x2100
movq %rax, %r12
jmp 0x50b3
movq 0x8(%rsp), %rbp
movq (%rbp), %r15
movq 0x8(%rbp), %r14
cmpq %r14, %r15
je 0x520a
movq %r14, %rbx
subq %r15, %rbx
movq %rbx, %rax
sarq $0x6, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x7d73
cmpq $0x401, %rbx            # imm = 0x401
jl 0x51ff
leaq 0x400(%r15), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x818e
cmpq %r14, %r12
je 0x520a
movq %r12, %rdi
callq 0x8225
addq $0x40, %r12
jmp 0x51cf
movq 0x30(%rdx), %rax
movq 0x38(%rdx), %rcx
cmpq %rcx, %rax
je 0x509a
andl $0x0, 0x7c(%rax)
addq $0x90, %rax
jmp 0x51ea
movq %r15, %rdi
movq %r14, %rsi
callq 0x818e
movq (%rbp), %r14
movq 0x8(%rbp), %rbx
cmpq %rbx, %r14
je 0x5236
movb $0x1, 0x39(%r14)
movq %r14, %rdi
movq %rbp, %rsi
callq 0x6580
testb %al, %al
jne 0x5230
movb $0x0, 0x39(%r14)
addq $0x40, %r14
jmp 0x5212
movq (%rbp), %r14
movq 0x8(%rbp), %rbx
leaq 0x48(%rbp), %rax
movq %rax, 0x18(%rsp)
leaq 0x90(%rsp), %r13
movq %rbx, 0x10(%rsp)
cmpq %rbx, %r14
je 0x54b6
cmpl $0x0, 0x60(%rbp)
je 0x5272
movq %r14, %rdi
leaq 0x8981(%rip), %rsi      # 0xdbee
callq 0x8a74
cmpb $0x1, 0x39(%r14)
jne 0x54ad
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
andq $0x0, 0xa0(%rsp)
movq 0x28(%r14), %rsi
movq %r13, %rdi
callq 0x8baa
movq 0x18(%r14), %r15
leaq 0x8(%r14), %rbx
cmpq %rbx, %r15
je 0x52c3
leaq 0x20(%r15), %rsi
movq %r13, %rdi
callq 0x87ac
movq %r15, %rdi
callq 0x2160
movq %rax, %r15
jmp 0x52a5
movq 0x90(%rsp), %rbp
movq 0x98(%rsp), %r15
cmpq %r15, %rbp
je 0x5344
movq %r15, %rbx
subq %rbp, %rbx
movq %rbx, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %rbp, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rcx
callq 0x8295
cmpq $0x41, %rbx
jl 0x5334
leaq 0x40(%rbp), %r12
movq %rbp, %rdi
movq %r12, %rsi
movq 0x8(%rsp), %rdx
callq 0x861a
cmpq %r15, %r12
je 0x5344
movq %r12, %rdi
movq 0x8(%rsp), %rsi
callq 0x86a5
addq $0x4, %r12
jmp 0x531c
movq %rbp, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rdx
callq 0x861a
movq 0x8(%rsp), %rbp
movq 0x48(%rbp), %rbx
movq 0x50(%rbp), %r15
cmpq %r15, %rbx
je 0x539a
leaq 0x20(%rbx), %rdi
movq %r14, %rsi
callq 0x5a8a
addq $0x70, %rbx
testb %al, %al
je 0x5351
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8c3a
movq 0x20(%rsp), %rsi
leaq 0x8870(%rip), %rdi      # 0xdbf6
xorl %eax, %eax
callq 0x2040
movq %rbx, %rdi
callq 0x20b0
jmp 0x54a0
andl $0x0, 0x48(%rsp)
andq $0x0, 0x50(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
leaq 0x48(%rsp), %rax
movq %rax, 0x58(%rsp)
movq %rax, 0x60(%rsp)
andq $0x0, 0x68(%rsp)
andl $0x0, 0x84(%rsp)
movq 0x90(%rsp), %r12
movq 0x98(%rsp), %rbp
xorl %r15d, %r15d
cmpq %rbp, %r12
je 0x5438
movl (%r12), %esi
movq 0x8(%rsp), %rdi
pushq $0x1
popq %rdx
callq 0x46ec
movq %rax, %rbx
testq %rax, %rax
je 0x5432
movq %rbx, %rdi
callq 0x4530
movl 0x80(%rbx), %eax
movl 0x84(%rbx), %ebx
movq 0x8(%rsp), %rcx
movq 0xc8(%rcx), %r15
leaq (%r15,%rax,8), %rsi
leaq 0x20(%rsp), %rdi
callq 0x6766
leaq (%r15,%rbx,8), %r15
addq $0x4, %r12
jmp 0x53e2
testq %r15, %r15
movq 0x8(%rsp), %rbp
leaq 0x20(%rsp), %rbx
je 0x5452
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6766
movl 0x30(%r14), %eax
movl %eax, 0x80(%rsp)
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x8d34
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x67c8
movsd %xmm0, 0x88(%rsp)
movl 0x148(%rbp), %eax
movl %eax, 0x84(%rsp)
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0xb684
movq %rbx, %rdi
callq 0x8d60
movq 0x10(%rsp), %rbx
movq %r13, %rdi
callq 0x973e
addq $0x40, %r14
jmp 0x5254
leaq 0xb0(%rsp), %rdi
callq 0x973e
movb $0x1, %al
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x557d
jmp 0x557d
jmp 0x5569
jmp 0x557d
jmp 0x557d
jmp 0x5536
jmp 0x5536
movq %rax, %rbx
jmp 0x5509
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x96fe
leaq 0x20(%rsp), %rdi
callq 0x96fe
jmp 0x5580
jmp 0x557d
jmp 0x5527
jmp 0x557d
jmp 0x557d
jmp 0x5569
jmp 0x557d
jmp 0x5569
jmp 0x5527
jmp 0x5536
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x8d60
jmp 0x556c
movq %rax, %rbx
jmp 0x555d
movq %rax, %rbx
jmp 0x5550
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x20b0
leaq 0xd8(%rsp), %rdi
callq 0x20b0
leaq 0x20(%rsp), %rdi
callq 0x20b0
jmp 0x5580
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x973e
jmp 0x5580
jmp 0x557d
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x973e
movq %rbx, %rdi
callq 0x2200
nop