// File: /workspace/github_cpp_makefile_star2_O3/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 $0x148, %rsp            # imm = 0x148
movq %rdi, %rbx
addq $0xe0, %rdi
callq 0xcbcc
leaq 0x98(%rbx), %rdi
callq 0xcbcc
leaq 0x110(%rbx), %r14
movq %r14, %rdi
callq 0xea88
movq 0x30(%rbx), %r15
movq %rbx, (%rsp)
movq 0x38(%rbx), %rbx
cmpq %rbx, %r15
je 0x5ccb
addq $0x60, %r15
xorl %ebp, %ebp
movq (%rsp), %r12
movq (%rsp), %rax
cmpl $0x0, 0x148(%rax)
jne 0x5c84
movl %ebp, (%r15)
cmpb $0x0, 0x14(%r15)
jne 0x5ca9
movl (%r15), %edx
movl 0x20(%r15), %esi
movq %r12, %rdi
callq 0x5474
movl (%r15), %edx
movl 0x24(%r15), %esi
movq %r12, %rdi
callq 0x5474
movq %r14, %rdi
movq %r15, %rsi
callq 0xeacc
movl %ebp, (%rax)
incl %ebp
leaq 0x90(%r15), %rax
addq $0x30, %r15
cmpq %rbx, %r15
movq %rax, %r15
jne 0x5c74
movq (%rsp), %rax
movq 0x18(%rax), %r14
movq 0x20(%rax), %rax
movabsq $-0x71c71c71c71c71c7, %r8 # imm = 0x8E38E38E38E38E39
movq %rax, 0x8(%rsp)
cmpq %rax, %r14
je 0x5dd8
movq (%rsp), %rcx
movq 0x30(%rcx), %rax
movq 0x38(%rcx), %rcx
movq %rcx, %rdx
movq (%rsp), %rbp
cmpq %rax, %rdx
je 0x5dc3
xorl %r12d, %r12d
movl $0x2, %r15d
leaq (%r12,%r12,8), %rbx
shlq $0x4, %rbx
cmpb $0x0, 0x74(%rax,%rbx)
jne 0x5da1
addq %rax, %rbx
movl 0x6c(%rbx), %esi
cmpl 0x60(%r14), %esi
jne 0x5da1
leal 0x1(%r12), %esi
movq %rdx, %rdi
subq %rax, %rdi
sarq $0x4, %rdi
imulq %r8, %rdi
cmpq %rsi, %rdi
jbe 0x5da1
movl %r15d, %r13d
leaq (%rsi,%rsi,8), %rdi
shlq $0x4, %rdi
cmpb $0x0, 0x74(%rax,%rdi)
jne 0x5d88
addq %rax, %rdi
movl 0x6c(%rdi), %esi
cmpl 0x60(%r14), %esi
jne 0x5d88
movl 0x60(%rbx), %esi
movl 0x60(%rdi), %edx
movq %rbp, %rdi
callq 0x8168
movq 0x30(%rbp), %rax
movq 0x38(%rbp), %rcx
movabsq $-0x71c71c71c71c71c7, %r8 # imm = 0x8E38E38E38E38E39
movq %rcx, %rdx
movl %r13d, %esi
movq %rdx, %rdi
subq %rax, %rdi
sarq $0x4, %rdi
imulq %r8, %rdi
incl %r13d
cmpq %rsi, %rdi
ja 0x5d4a
incl %r12d
movq %rcx, %rsi
subq %rax, %rsi
sarq $0x4, %rsi
imulq %r8, %rsi
incl %r15d
movq %rcx, %rdx
cmpq %r12, %rsi
ja 0x5d14
jmp 0x5dc6
movq %rax, %rdx
addq $0x90, %r14
cmpq 0x8(%rsp), %r14
jne 0x5d02
movq (%rsp), %r15
movl 0x60(%r15), %eax
cmpl $0x1, %eax
jbe 0x5e3c
movq 0xb0(%r15), %r14
leaq 0xa0(%r15), %rbx
cmpq %rbx, %r14
je 0x5e40
leaq 0xad24(%rip), %r15      # 0x10b23
movq 0x28(%r14), %r12
movq 0x30(%r14), %r13
cmpq %r13, %r12
je 0x5e24
movl 0x20(%r14), %esi
movl (%r12), %edx
movq %r15, %rdi
xorl %eax, %eax
callq 0x2030
addq $0x4, %r12
jmp 0x5e07
movq %r14, %rdi
callq 0x20f0
movq %rax, %r14
cmpq %rbx, %rax
jne 0x5dff
movq (%rsp), %r15
movl 0x60(%r15), %eax
testl %eax, %eax
je 0x5e55
movl 0xc0(%r15), %esi
leaq 0xacec(%rip), %rdi      # 0x10b3a
xorl %eax, %eax
callq 0x2030
pxor %xmm0, %xmm0
movdqa %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
leaq 0x68(%r15), %rbp
movq %rbp, %rdi
callq 0xcbcc
movq 0x30(%r15), %rax
movq 0x38(%r15), %rcx
cmpq %rax, %rcx
movq %r15, %rbx
je 0x6063
leaq 0xacc5(%rip), %r15      # 0x10b54
xorl %r12d, %r12d
xorl %r14d, %r14d
leaq (%r12,%r12,8), %r13
shlq $0x4, %r13
cmpb $0x1, 0x74(%rax,%r13)
jne 0x5eb0
incl %r14d
movq %r14, %r12
jmp 0x6037
movq 0x40(%rsp), %rdx
cmpq %rdx, 0x48(%rsp)
je 0x5ec1
movq %rdx, 0x48(%rsp)
leal 0x1(%r14), %r12d
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x4, %rdx
movabsq $-0x71c71c71c71c71c7, %rsi # imm = 0x8E38E38E38E38E39
imulq %rsi, %rdx
cmpq %r12, %rdx
jbe 0x6034
addq %rax, %r13
addl $0x2, %r14d
movq %r12, %rdx
leaq (%rdx,%rdx,8), %rdx
shlq $0x4, %rdx
cmpb $0x0, 0x74(%rax,%rdx)
jne 0x5f63
addq %rax, %rdx
movl 0x80(%r13), %r8d
movl 0x80(%rdx), %esi
cmpl %esi, %r8d
je 0x5f1f
movl 0x84(%rdx), %edi
cmpl %edi, %r8d
jne 0x5f52
addq $0x60, %rdx
movq 0x48(%rsp), %rsi
cmpq 0x50(%rsp), %rsi
je 0x5f3e
movl (%rdx), %edx
movl %edx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x48(%rsp)
jmp 0x5f63
leaq 0x40(%rsp), %rdi
callq 0xcab4
movq 0x30(%rbx), %rax
movq 0x38(%rbx), %rcx
jmp 0x5f63
movl 0x84(%r13), %r8d
cmpl %esi, %r8d
je 0x5f1f
cmpl %edi, %r8d
je 0x5f1f
movl %r14d, %edx
movq %rcx, %rsi
subq %rax, %rsi
sarq $0x4, %rsi
movabsq $-0x71c71c71c71c71c7, %rdi # imm = 0x8E38E38E38E38E39
imulq %rdi, %rsi
incl %r14d
cmpq %rdx, %rsi
ja 0x5ef0
movq 0x40(%rsp), %r14
movq 0x48(%rsp), %rbx
cmpq %rbx, %r14
je 0x605a
addq $0x60, %r13
movq (%rsp), %rax
cmpl $0x2, 0x60(%rax)
jb 0x5fbc
movl (%r13), %esi
movl (%r14), %edx
movq %r15, %rdi
xorl %eax, %eax
callq 0x2030
movq %rbp, %rdi
movq %r13, %rsi
callq 0xb536
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x5fe0
movl (%r14), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rax)
jmp 0x5feb
movq %rax, %rdi
movq %r14, %rdx
callq 0xcab4
movq %rbp, %rdi
movq %r14, %rsi
callq 0xb536
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x6010
movl (%r13), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rax)
jmp 0x601b
movq %rax, %rdi
movq %r13, %rdx
callq 0xcab4
addq $0x4, %r14
cmpq %rbx, %r14
jne 0x5fa1
movq (%rsp), %rbx
movq 0x30(%rbx), %rax
movq 0x38(%rbx), %rcx
movl %r12d, %r14d
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x4, %rdx
movabsq $-0x71c71c71c71c71c7, %rsi # imm = 0x8E38E38E38E38E39
imulq %rsi, %rdx
cmpq %r12, %rdx
ja 0x5e95
jmp 0x6063
movl %r12d, %r14d
movq (%rsp), %rbx
jmp 0x6037
movq 0x80(%rbx), %r14
leaq 0x70(%rbx), %r12
cmpq %r12, %r14
je 0x60a4
movl 0x20(%r14), %esi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x5842
testq %rax, %rax
je 0x6094
movq %rax, %rdi
movq %rbx, %rsi
callq 0x80c2
movq %r14, %rdi
callq 0x20f0
movq %rax, %r14
cmpq %r12, %rax
jne 0x6073
cmpl $0x0, 0x60(%rbx)
je 0x60be
movl 0x90(%rbx), %esi
leaq 0xaab4(%rip), %rdi      # 0x10b6b
xorl %eax, %eax
callq 0x2030
movq 0x30(%rbx), %r14
movq %rbx, %rcx
movq 0x38(%rbx), %rbx
movq %rbx, %rax
subq %r14, %rax
movq %rbp, 0x8(%rsp)
movq %r12, 0x38(%rsp)
je 0x61a8
sarq $0x4, %rax
movabsq $-0x71c71c71c71c71c7, %rcx # imm = 0x8E38E38E38E38E39
imulq %rcx, %rax
xorl %esi, %esi
movl $0x2, %ecx
xorl %edx, %edx
incl %edx
cmpq %rdx, %rax
jbe 0x613d
leaq (%rsi,%rsi,8), %rsi
shlq $0x4, %rsi
addq %r14, %rsi
movl 0x60(%rsi), %edi
movl %ecx, %r8d
movq %rdx, %r9
leaq (%r9,%r9,8), %r15
shlq $0x4, %r15
cmpl 0x60(%r14,%r15), %edi
je 0x69da
movl %r8d, %r9d
incl %r8d
cmpq %r9, %rax
ja 0x6115
incl %ecx
movq %rdx, %rsi
cmpq %rdx, %rax
ja 0x60fa
movq (%rsp), %rax
movl 0x60(%rax), %eax
cmpl $0x2, %eax
jbe 0x61b0
cmpq %r14, %rbx
je 0x61b9
leaq 0x70(%rsp), %r13
leaq 0x60(%rsp), %r15
leaq 0xaa64(%rip), %r12      # 0x10bc3
cmpb $0x0, 0x74(%r14)
jne 0x6193
movq %r15, %rdi
movq %r14, %rsi
movq (%rsp), %rdx
callq 0x4e48
movq 0x60(%rsp), %rsi
movq %r12, %rdi
xorl %eax, %eax
callq 0x2030
movq 0x60(%rsp), %rdi
cmpq %r13, %rdi
je 0x6193
callq 0x2140
addq $0x90, %r14
cmpq %rbx, %r14
jne 0x615f
movq (%rsp), %rax
movl 0x60(%rax), %eax
jmp 0x61b0
movl 0x60(%rcx), %eax
cmpl $0x2, %eax
ja 0x61b9
cmpl $0x2, %eax
jb 0x63b8
movq (%rsp), %rax
movq 0x80(%rax), %r14
cmpq 0x38(%rsp), %r14
je 0x63b8
leaq 0x70(%rsp), %rbx
leaq 0x20(%rsp), %r12
leaq 0xe0(%rsp), %r13
movl $0xd1b71759, %ebp       # imm = 0xD1B71759
leaq 0x20(%r14), %r15
movq %rbx, 0x60(%rsp)
movq $0x0, 0x68(%rsp)
movb $0x0, 0x70(%rsp)
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0xb536
movq %r15, 0xd8(%rsp)
movq %r14, 0x100(%rsp)
movq (%rax), %r14
movq 0x8(%rax), %rbx
cmpq %rbx, %r14
je 0x6345
movl (%r14), %r15d
movl $0x1, %eax
cmpl $0xa, %r15d
jb 0x6278
movl $0x4, %eax
movl %r15d, %ecx
cmpl $0x63, %ecx
jbe 0x6271
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x6276
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x6278
movl %ecx, %edx
imulq %rbp, %rdx
shrq $0x2d, %rdx
addl $0x4, %eax
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x6240
addl $-0x3, %eax
jmp 0x6278
addl $-0x2, %eax
jmp 0x6278
decl %eax
movl %eax, %esi
leaq 0xf0(%rsp), %rax
movq %rax, 0xe0(%rsp)
movq %r13, %rdi
xorl %edx, %edx
callq 0x2190
movq 0xe0(%rsp), %rdi
movl 0xe8(%rsp), %esi
movl %r15d, %edx
callq 0xbfed
movq %r13, %rdi
leaq 0xa7cf(%rip), %rsi      # 0x10a84
callq 0x2220
movq %r12, 0x10(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x62dd
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x62e7
movdqu (%rcx), %xmm0
movdqu %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0x60(%rsp), %rdi
callq 0x2060
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x6322
callq 0x2140
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x633c
callq 0x2140
addq $0x4, %r14
jmp 0x6221
movq (%rsp), %rax
movl 0x148(%rax), %r15d
movq 0xd8(%rsp), %rsi
movl (%rsi), %r14d
movq 0x8(%rsp), %rdi
callq 0xb536
movq 0x8(%rax), %rcx
subq (%rax), %rcx
shrq $0x2, %rcx
movq 0x60(%rsp), %r8
leaq 0xa84f(%rip), %rdi      # 0x10bcb
movl %r15d, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2030
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rbx
cmpq %rbx, %rdi
je 0x639d
callq 0x2140
movq 0x100(%rsp), %rdi
callq 0x20f0
movq %rax, %r14
cmpq 0x38(%rsp), %rax
jne 0x61e6
movq (%rsp), %rdi
cmpl $0x0, 0x148(%rdi)
movq 0x8(%rsp), %r13
movq 0x38(%rsp), %r12
jne 0x6508
movq 0x30(%rdi), %rcx
movq 0x38(%rdi), %rax
cmpq %rax, %rcx
je 0x6508
subq %rcx, %rax
addq $-0x90, %rax
movabsq $-0x1c71c71c71c71c71, %rdx # imm = 0xE38E38E38E38E38F
mulq %rdx
movq %rdx, %xmm0
shrq $0x7, %rdx
addq $0x4, %rdx
andq $-0x4, %rdx
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
psrlq $0x7, %xmm0
addq $0x22c, %rcx            # imm = 0x22C
xorl %eax, %eax
movdqa 0x9c0a(%rip), %xmm1     # 0x10030
movdqa 0x9c12(%rip), %xmm2     # 0x10040
movdqa 0x9c1a(%rip), %xmm3     # 0x10050
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movq %rax, %xmm5
pshufd $0x44, %xmm5, %xmm5     # xmm5 = xmm5[0,1,0,1]
movdqa %xmm5, %xmm6
por %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %esi
notl %esi
testb $0x1, %sil
je 0x648b
movl $0x0, -0x1b0(%rcx)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0x64a4
movl $0x0, -0x120(%rcx)
por %xmm1, %xmm5
pxor %xmm3, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
pxor %xmm4, %xmm5
pextrw $0x0, %xmm5, %esi
testb $0x1, %sil
je 0x64e3
movl $0x0, -0x90(%rcx)
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0x64f4
movl $0x0, (%rcx)
addq $0x4, %rax
addq $0x240, %rcx            # imm = 0x240
cmpq %rax, %rdx
jne 0x643e
movq 0x80(%rdi), %r14
cmpq %r12, %r14
je 0x661c
leaq 0x108(%rsp), %rbp
leaq 0x20(%r14), %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0xb536
movq 0x8(%rax), %rcx
subq (%rax), %rcx
cmpq $0x5, %rcx
jb 0x6608
movq %r13, %r12
movq (%rsp), %rax
cmpl $0x3, 0x60(%rax)
jb 0x655e
movl (%r15), %esi
leaq 0xa691(%rip), %rdi      # 0x10be8
xorl %eax, %eax
callq 0x2030
movl $0x0, 0x68(%rsp)
xorl %eax, %eax
movq %rax, 0x70(%rsp)
leaq 0x68(%rsp), %r13
movq %r13, 0x78(%rsp)
movq %r13, 0x80(%rsp)
movq %rax, 0x88(%rsp)
movl (%r15), %ebx
movl %ebx, 0x94(%rsp)
movl %ebx, 0x90(%rsp)
movb $0x0, 0x98(%rsp)
movq %rbp, %rdi
leaq 0x60(%rsp), %rsi
callq 0xc0a4
movzwl 0x30(%r13), %eax
leaq 0x138(%rsp), %rcx
movw %ax, 0x8(%rcx)
movq 0x28(%r13), %rax
movq %rax, (%rcx)
movq (%rsp), %r13
movq %r13, %rdi
movl %ebx, %esi
movq %rbp, %rdx
callq 0x7794
movq %rbp, %rdi
callq 0xc2b6
cmpl $0x3, 0x60(%r13)
movq %r12, %r13
jb 0x65f9
movl (%r15), %esi
leaq 0xa610(%rip), %rdi      # 0x10c02
xorl %eax, %eax
callq 0x2030
leaq 0x60(%rsp), %rdi
callq 0xc2b6
movq 0x38(%rsp), %r12
movq %r14, %rdi
callq 0x20f0
movq %rax, %r14
cmpq %r12, %rax
jne 0x6520
movq (%rsp), %rax
movq (%rax), %r15
movq 0x8(%rax), %r14
cmpq %r14, %r15
je 0x668a
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 0x9dc7
cmpq $0x401, %rbx            # imm = 0x401
jl 0x667f
leaq 0x400(%r15), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xac8c
cmpq %r14, %r12
je 0x668a
movq %r12, %rdi
callq 0xae41
addq $0x40, %r12
jmp 0x666c
movq %r15, %rdi
movq %r14, %rsi
callq 0xac8c
movq (%rsp), %rax
movq (%rax), %r14
movq 0x8(%rax), %rbx
cmpq %rbx, %r14
je 0x69b7
movb $0x1, 0x39(%r14)
movq %r14, %rdi
movq (%rsp), %rsi
callq 0x81e6
testb %al, %al
jne 0x66b8
movb $0x0, 0x39(%r14)
addq $0x40, %r14
cmpq %rbx, %r14
jne 0x669e
movq (%rsp), %rax
movq (%rax), %r14
movq 0x8(%rax), %rbx
cmpq %rbx, %r14
je 0x69b7
movq (%rsp), %rax
addq $0x48, %rax
movq %rax, 0xd8(%rsp)
leaq 0x60(%rsp), %rbp
movq %rbx, 0x8(%rsp)
movq (%rsp), %rax
cmpl $0x0, 0x60(%rax)
je 0x6708
movq %r14, %rdi
leaq 0xa517(%rip), %rsi      # 0x10c1a
callq 0xb79c
cmpb $0x1, 0x39(%r14)
jne 0x69aa
pxor %xmm0, %xmm0
movdqa %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x28(%r14), %rsi
leaq 0x10(%rsp), %rdi
callq 0xb842
movq 0x18(%r14), %r15
leaq 0x8(%r14), %rbx
cmpq %rbx, %r15
je 0x677a
leaq 0x20(%r15), %rdx
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x6760
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x676a
leaq 0x10(%rsp), %rdi
callq 0xcab4
movq %r15, %rdi
callq 0x2180
movq %rax, %r15
cmpq %rbx, %rax
jne 0x6741
movq 0x10(%rsp), %r15
movq 0x18(%rsp), %r12
cmpq %r12, %r15
je 0x67f1
movq %r12, %rbx
subq %r15, %rbx
movq %rbx, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %r12, %rsi
movq (%rsp), %rcx
callq 0xb046
cmpq $0x41, %rbx
jl 0x67e2
leaq 0x40(%r15), %r13
movq %r15, %rdi
movq %r13, %rsi
movq (%rsp), %rdx
callq 0xb3fd
cmpq %r12, %r13
je 0x67f1
movq %r13, %rdi
movq (%rsp), %rsi
callq 0xb47c
addq $0x4, %r13
jmp 0x67cb
movq %r15, %rdi
movq %r12, %rsi
movq (%rsp), %rdx
callq 0xb3fd
movq (%rsp), %rax
movq 0x48(%rax), %rbx
movq 0x50(%rax), %r15
cmpq %r15, %rbx
je 0x681c
leaq 0x20(%rbx), %rdi
movq %r14, %rsi
callq 0x7112
testb %al, %al
jne 0x6964
addq $0x70, %rbx
jmp 0x67fd
xorl %ecx, %ecx
movl %ecx, 0x88(%rsp)
movq %rcx, 0x90(%rsp)
pxor %xmm0, %xmm0
movdqa %xmm0, 0x60(%rsp)
movdqa %xmm0, 0x70(%rsp)
leaq 0x88(%rsp), %rax
movq %rax, 0x98(%rsp)
movq %rax, 0xa0(%rsp)
movq %rcx, 0xa8(%rsp)
movl %ecx, 0xc4(%rsp)
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r13
cmpq %r13, %rbx
je 0x68d8
xorl %r12d, %r12d
movl (%rbx), %esi
movq (%rsp), %rdi
movl $0x1, %edx
callq 0x5842
movq %rax, %r15
testq %rax, %rax
je 0x68bf
movq %r15, %rdi
callq 0x54f0
movl 0x80(%r15), %eax
movl 0x84(%r15), %r15d
movq (%rsp), %rcx
movq 0xc8(%rcx), %r12
leaq (%r12,%rax,8), %rsi
movq %rbp, %rdi
callq 0x8408
leaq (%r12,%r15,8), %r12
addq $0x4, %rbx
cmpq %r13, %rbx
jne 0x6876
testq %r12, %r12
je 0x68d8
movq %rbp, %rdi
movq %r12, %rsi
callq 0x8408
movl 0x30(%r14), %eax
movl %eax, 0xc0(%rsp)
leaq 0x80(%rsp), %rdi
movq %r14, %rsi
callq 0xbca6
leaq 0x30(%r14), %rax
movzwl 0x8(%rax), %ecx
leaq 0x70(%rsp), %rdx
movw %cx, 0x48(%rdx)
movq (%rax), %rax
movq %rax, 0x40(%rdx)
movq %rbp, %rdi
movq (%rsp), %rsi
callq 0x8474
movq %xmm0, 0xc8(%rsp)
movq (%rsp), %rax
movl 0x148(%rax), %eax
movl %eax, 0xc4(%rsp)
movq 0xd8(%rsp), %rdi
movq %rbp, %rsi
callq 0xed6c
leaq 0x80(%rsp), %rdi
callq 0xc2b6
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x695d
callq 0x2140
movq 0x8(%rsp), %rbx
jmp 0x699b
movq %rbp, %rdi
movq %r14, %rsi
callq 0xb8d4
movq 0x60(%rsp), %rsi
leaq 0xa2a7(%rip), %rdi      # 0x10c22
xorl %eax, %eax
callq 0x2030
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
movq 0x8(%rsp), %rbx
je 0x699b
callq 0x2140
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x69aa
callq 0x2140
addq $0x40, %r14
cmpq %rbx, %r14
jne 0x66ef
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x69c6
callq 0x2140
movb $0x1, %al
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x60(%rsp), %rdi
movq (%rsp), %rbx
movq %rbx, %rdx
callq 0x4e48
addq %r15, %r14
movq 0x60(%rsp), %r15
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x4e48
leaq 0x10(%rsp), %rbx
movq (%rbx), %rdx
leaq 0xa16f(%rip), %rdi      # 0x10b81
movq %r15, %rsi
xorl %eax, %eax
callq 0x2030
movq %rbx, %rdi
callq 0x20a0
leaq 0x60(%rsp), %rdi
callq 0x20a0
leaq 0xa0a2(%rip), %rdi      # 0x10ad7
leaq 0x9704(%rip), %rsi      # 0x10140
leaq 0xa161(%rip), %rcx      # 0x10ba4
movl $0x846, %edx            # imm = 0x846
callq 0x20e0
jmp 0x6b2b
jmp 0x6aa5
jmp 0x6b2b
jmp 0x6b2b
jmp 0x6b2b
movq %rax, %rbx
jmp 0x6a78
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0xc2b6
leaq 0x60(%rsp), %rdi
callq 0xc2b6
jmp 0x6b2e
jmp 0x6aee
jmp 0x6aee
jmp 0x6aa5
jmp 0x6abf
jmp 0x6b2b
jmp 0x6b2b
jmp 0x6b2b
jmp 0x6b2b
jmp 0x6aa5
movq %rax, %rbx
jmp 0x6acc
jmp 0x6abf
movq %rax, %rbx
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x6b24
jmp 0x6b2e
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0xbb84
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
jne 0x6b24
jmp 0x6b2e
jmp 0x6b2b
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x6afb
callq 0x2140
jmp 0x6afb
movq %rax, %rbx
leaq 0x70(%rsp), %r14
jmp 0x6b1a
movq %rax, %rbx
leaq 0x70(%rsp), %r14
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x6b1a
callq 0x2140
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x6b2e
callq 0x2140
jmp 0x6b2e
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x6b3d
callq 0x2140
movq %rbx, %rdi
callq 0x2200
nop