// File: /workspace/github_cpp_makefile_star2_O2/Kei18[P]pibt/./src/solver/cbs.cpp
// Function: CBS::isDuplicatedCTNode(CTNode*, std::vector<CTNode*, std::allocator<CTNode*>>&)
bool CBS::isDuplicatedCTNode(CTNode* newCT, std::vector<CTNode*> &cts) {
  Constraint newC = getConstraints(newCT);
  std::sort(newC.begin(), newC.end(), [] (Conflict* c1, Conflict* c2)
                                      { if (c1->t != c2->t) return c1->t < c2->t;
                                        if (c1->a != c2->a) return c1->a->getId() < c2->a->getId();
                                        if (c1->onNode != c2->onNode) return c1->onNode;
                                        if (c1->v != c2->v) return c1->v->getId() < c2->v->getId();
                                        if (c1->u != c2->u) return c1->u->getId() < c2->u->getId();
                                        return true;
                                      });
  bool duplicated;
  Constraint oldC;
  for (auto ct : cts) {
    oldC = getConstraints(ct);
    if (newC.size() != oldC.size()) continue;
    std::sort(oldC.begin(), oldC.end(), [] (Conflict* c1, Conflict* c2)
                                        { if (c1->t != c2->t) return c1->t < c2->t;
                                          if (c1->a != c2->a) return c1->a->getId() < c2->a->getId();
                                          if (c1->onNode != c2->onNode) return c1->onNode;
                                          if (c1->v != c2->v) return c1->v->getId() < c2->v->getId();
                                          if (c1->u != c2->u) return c1->u->getId() < c2->u->getId();
                                          return true;
                                        });
    duplicated = true;
    for (int i = 0; i < newC.size(); ++i) {
      if (!isDuplicatedConflict(newC[i], oldC[i])) {
        duplicated = false;
        break;
      }
    }
    if (duplicated) return true;
  }
  return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r14
movq %rsi, %rdx
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0x20b8e
movq (%rbx), %r15
movq 0x8(%rbx), %rbx
cmpq %rbx, %r15
je 0x21ac3
movq %rbx, %r12
subq %r15, %r12
movq %r12, %rax
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x21e3c
cmpq $0x81, %r12
jl 0x21ab8
leaq 0x80(%r15), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x22104
cmpq %rbx, %r12
je 0x21ac3
movq %r12, %rdi
callq 0x2216d
addq $0x8, %r12
jmp 0x21aa5
movq %r15, %rdi
movq %rbx, %rsi
callq 0x22104
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rax
andq $0x0, 0x10(%rax)
movaps %xmm0, (%rax)
movq (%r14), %rbp
movq 0x8(%r14), %rax
movq %rax, 0x8(%rsp)
leaq 0x40(%rsp), %r14
cmpq 0x8(%rsp), %rbp
je 0x21bc9
movq (%rbp), %rdx
movq %r14, %rdi
callq 0x20b8e
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x24b40
movq %r14, %rdi
callq 0x235f6
movq 0x30(%rsp), %r13
subq 0x28(%rsp), %r13
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r15
movq %r15, %rax
subq %r12, %rax
cmpq %rax, %r13
jne 0x21bc0
cmpq %r15, %r12
je 0x21b8e
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x2219d
cmpq $0x81, %r13
jl 0x21b83
leaq 0x80(%r12), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x22464
cmpq %r15, %r13
je 0x21b8e
movq %r13, %rdi
callq 0x224cd
addq $0x8, %r13
jmp 0x21b70
movq %r12, %rdi
movq %r15, %rsi
callq 0x22464
movq 0x28(%rsp), %r15
movq 0x30(%rsp), %r12
subq %r15, %r12
sarq $0x3, %r12
movq 0x10(%rsp), %r13
xorl %ebx, %ebx
cmpq %rbx, %r12
je 0x21bc9
movq (%r15,%rbx,8), %rsi
movq (%r13,%rbx,8), %rdx
callq 0x21a02
incq %rbx
testb %al, %al
jne 0x21ba6
addq $0x8, %rbp
jmp 0x21ae4
cmpq 0x8(%rsp), %rbp
setne %bl
leaq 0x10(%rsp), %rdi
callq 0x235f6
leaq 0x28(%rsp), %rdi
callq 0x235f6
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x235f6
leaq 0x28(%rsp), %rdi
callq 0x235f6
movq %rbx, %rdi
callq 0x6650
nop