// File: realuptime[P]PolyDetector/PolyDetector.cpp
// Function: PolyDetector::rmEarPoints()
bool PolyDetector::rmEarPoints()
{
    std::vector<PolyLine *> torm;
    
    std::set<uint32_t> pids;
    for (auto &cycle : _cycles)
    {
        for (auto &lid : cycle.idx)
        {
            auto l = findLine(lid);
            if (l)
            {
                for (auto &pid : {l->aIdx, l->bIdx})
                {
                    if (cycle.pointConsumed(*this, pid))
                    {
                        if (verbose)
                            logoutf("Point P%u is an ear! will remove line %u", pid, l->id);
                        torm.push_back(l);
                    }
                }
            }
        }
    }
    //if (verbose)
    //    logoutf("cyclePids:%u/%u", uint32_t(pids.size()), uint32_t(intersectionPoints.size()));
            
    for (auto &l : torm)
    {
        l->setIgnore(*this, "rmEarPoints");
    }
        
    return true;
}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movq %rdi, 0x110(%rsp)
movq 0x110(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x14f60
leaq 0xc8(%rsp), %rdi
callq 0x14f70
movq 0x10(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rdi
callq 0x14950
movq %rax, 0xb8(%rsp)
movq 0xc0(%rsp), %rdi
callq 0x14980
movq %rax, 0xb0(%rsp)
leaq 0xb8(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x149b0
testb $0x1, %al
jne 0xd30b
jmp 0xd51f
leaq 0xb8(%rsp), %rdi
callq 0x149f0
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x13140
movq %rax, 0x98(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x13190
movq %rax, 0x90(%rsp)
leaq 0x98(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x13170
testb $0x1, %al
jne 0xd378
jmp 0xd50b
leaq 0x98(%rsp), %rdi
callq 0x131c0
movq 0x10(%rsp), %rdi
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rax
movl (%rax), %esi
movl $0x1, %edx
callq 0x7240
movq %rax, 0x8(%rsp)
jmp 0xd3ad
movq 0x8(%rsp), %rax
movq %rax, 0x80(%rsp)
cmpq $0x0, 0x80(%rsp)
je 0xd4f7
movq 0x80(%rsp), %rax
movl 0x80(%rax), %eax
movl %eax, 0x50(%rsp)
movq 0x80(%rsp), %rax
movl 0x84(%rax), %eax
movl %eax, 0x54(%rsp)
leaq 0x50(%rsp), %rax
movq %rax, 0x58(%rsp)
movq $0x2, 0x60(%rsp)
leaq 0x58(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
callq 0x13b00
movq %rax, 0x48(%rsp)
movq 0x68(%rsp), %rdi
callq 0x13b10
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rax
cmpq 0x40(%rsp), %rax
je 0xd4f5
movq 0x10(%rsp), %rsi
movq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0xa8(%rsp), %rdi
movq 0x38(%rsp), %rax
movl (%rax), %edx
callq 0xcfd0
movb %al, 0x7(%rsp)
jmp 0xd461
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0xd46b
jmp 0xd4e0
movq 0x10(%rsp), %rax
cmpl $0x0, 0x60(%rax)
je 0xd4c7
movq 0x38(%rsp), %rax
movl (%rax), %esi
movq 0x80(%rsp), %rax
movl 0x60(%rax), %edx
leaq 0x19a65(%rip), %rdi     # 0x26ef4
xorl %eax, %eax
callq 0x2050
jmp 0xd498
jmp 0xd4c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x150c0
leaq 0xf8(%rsp), %rdi
callq 0x150d0
jmp 0xd5bd
leaq 0xf8(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x14f80
jmp 0xd4de
jmp 0xd4e0
jmp 0xd4e2
movq 0x48(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x48(%rsp)
jmp 0xd428
jmp 0xd4f7
jmp 0xd4f9
leaq 0x98(%rsp), %rdi
callq 0x13240
jmp 0xd35a
jmp 0xd50d
leaq 0xb8(%rsp), %rdi
callq 0x14a00
jmp 0xd2ed
leaq 0xf8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
callq 0x14ff0
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rdi
callq 0x15020
movq %rax, 0x20(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x15050
testb $0x1, %al
jne 0xd55f
jmp 0xd597
leaq 0x28(%rsp), %rdi
callq 0x15090
movq 0x10(%rsp), %rsi
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rdi
leaq 0x1999c(%rip), %rdx     # 0x26f1e
callq 0xc7b0
jmp 0xd589
jmp 0xd58b
leaq 0x28(%rsp), %rdi
callq 0x150a0
jmp 0xd54a
leaq 0xc8(%rsp), %rdi
callq 0x150c0
leaq 0xf8(%rsp), %rdi
callq 0x150d0
movb $0x1, %al
andb $0x1, %al
addq $0x118, %rsp            # imm = 0x118
retq
movq 0x78(%rsp), %rdi
callq 0x2280
nopw (%rax,%rax)