// File: /workspace/github_cpp_makefile_star2_O1/realuptime[P]PolyDetector/PolyDetector.cpp
// Function: PolyCycle::convex(PolyDetector&) const
bool PolyCycle::convex(PolyDetector &pd) const
{
    for (auto it1 = idx.begin(); it1 != idx.end(); ++it1)
    {
        auto l1 = pd.findLine(*it1, false);
        if (!l1) continue;
        
        auto it2 = it1;
        ++it2;
        
        for (; it2 != idx.end(); ++it2)
        {
            auto l2 = pd.findLine(*it2, false);
            if (!l2) continue;
            
            PolyLine ls(l1->center, l2->center);
            for (auto it3 = idx.begin(); it3 != idx.end(); ++it3)
            {
                if (it3 != it1 && it3 != it2
                    //&& !pd.CollinearIdx(*it3, *it1) && !pd.CollinearIdx(*it3, *it2)
                )
                {
                    auto l3 = pd.findLine(*it3);
                    
                    if (l3 && doIntersect(ls.a, ls.b, l3->a, l3->b))
                    //if (l2 && !Collinear(ls, *l2) && ls.PolyIntersects(*l2))
                    {
                        logoutf("convex(%s): l1:%u intersects l2:%u l3:%u", toString().c_str(), l1->id, l2->id, l3->id);
                        return false;
                    }
                }
            }
        }
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, 0x8(%rsp)
movq 0x18(%rdi), %r15
movq %rdi, 0x10(%rsp)
leaq 0x8(%rdi), %rbx
cmpq %rbx, %r15
sete 0x7(%rsp)
je 0x8317
movl 0x20(%r15), %esi
movq 0x8(%rsp), %rdi
xorl %edx, %edx
callq 0x5706
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x82f9
movq %r15, %rdi
callq 0x2180
cmpq %rbx, %rax
je 0x82f5
movq %rax, %r14
movl 0x20(%r14), %esi
movq 0x8(%rsp), %rdi
xorl %edx, %edx
callq 0x5706
testq %rax, %rax
je 0x8268
movq %rax, %rdx
movq 0x18(%rsp), %rax
movq 0x58(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x58(%rdx), %rax
movq %rax, 0x50(%rsp)
xorl %ebp, %ebp
leaq 0x50(%rsp), %rax
movq %rbp, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movl %ebp, 0x78(%rsp)
movq %rbp, 0x80(%rsp)
leaq 0x78(%rsp), %rcx
movq %rcx, 0x88(%rsp)
movq %rcx, 0x90(%rsp)
movq %rbp, 0x98(%rsp)
movaps 0x7e3e(%rip), %xmm1     # 0x10010
movups %xmm1, 0xa8(%rsp)
movl $0xffffffff, 0xb8(%rsp) # imm = 0xFFFFFFFF
movb $0x0, 0xbc(%rsp)
movl %ebp, 0x80(%rax)
movups %xmm0, 0x70(%rax)
movq 0x10(%rsp), %rax
movq 0x18(%rax), %r13
cmpq %rbx, %r13
je 0x82bf
movq %rdx, 0x20(%rsp)
cmpq %r15, %r13
sete %al
cmpq %r14, %r13
sete %cl
orb %al, %cl
jne 0x8256
movl 0x20(%r13), %esi
movq 0x8(%rsp), %rdi
movl $0x1, %edx
callq 0x5706
testq %rax, %rax
je 0x8256
movq %rax, %r12
movq %rax, %rcx
addq $0x8, %rcx
leaq 0x48(%rsp), %rdi
leaq 0x50(%rsp), %rsi
movq %rax, %rdx
callq 0x2501
testb %al, %al
jne 0x826f
movq %r13, %rdi
callq 0x2180
movq %rax, %r13
cmpq %rbx, %rax
jne 0x820e
jmp 0x82bf
movl $0x7, %ebp
jmp 0x82d8
leaq 0x28(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xb760
movq 0x28(%rsp), %rsi
movq 0x18(%rsp), %rax
movl 0x60(%rax), %edx
movq 0x20(%rsp), %rax
movl 0x60(%rax), %ecx
movl 0x60(%r12), %r8d
leaq 0x8c54(%rip), %rdi      # 0x10ef3
xorl %eax, %eax
callq 0x2030
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x82ba
callq 0x2140
movl $0x1, %ebp
leaq 0x70(%rsp), %rdi
callq 0xc16e
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x82d8
callq 0x2140
cmpl $0x7, %ebp
je 0x82e1
testl %ebp, %ebp
jne 0x82fe
movq %r14, %rdi
callq 0x2180
movq %rax, %r14
cmpq %rbx, %rax
jne 0x815d
xorl %ebp, %ebp
jmp 0x82fe
movl $0x4, %ebp
testb $0x3, %bpl
jne 0x8317
movq %r15, %rdi
callq 0x2180
movq %rax, %r15
cmpq %rbx, %rax
jmp 0x8120
movb 0x7(%rsp), %al
andb $0x1, %al
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0xb3aa
movq %rbx, %rdi
callq 0x2200