// File: /workspace/github_cpp_makefile_star2_O1/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, %rbx
movq %rsi, %rdx
leaq 0x30(%rsp), %r14
movq %r14, %rdi
callq 0x285c2
movq (%r14), %r15
movq 0x8(%r14), %r14
cmpq %r14, %r15
je 0x29ab1
movq %r14, %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 %r14, %rsi
callq 0x29fd9
cmpq $0x81, %r12
jl 0x29aa6
leaq 0x80(%r15), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x2a355
cmpq %r14, %r12
je 0x29ab1
movq %r12, %rdi
callq 0x2a3c3
addq $0x8, %r12
jmp 0x29a93
movq %r15, %rdi
movq %r14, %rsi
callq 0x2a355
movq (%rbx), %r15
movq 0x8(%rbx), %rax
movq %rax, 0x48(%rsp)
cmpq %rax, %r15
setne %bl
je 0x29c34
xorl %ebp, %ebp
xorl %r14d, %r14d
movq (%r15), %rdx
leaq 0x10(%rsp), %rdi
callq 0x285c2
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r13
movq 0x20(%rsp), %rax
movq %rax, 0x50(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testq %rbp, %rbp
je 0x29b13
subq %rbp, %r14
movq %rbp, %rdi
movq %r14, %rsi
callq 0x6380
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x29b2a
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x38(%rsp), %rcx
subq 0x30(%rsp), %rcx
movq %r13, %r14
subq %r12, %r14
movl $0x3, %eax
cmpq %r14, %rcx
jne 0x29c0c
cmpq %r13, %r12
je 0x29ba6
movq %r14, %rax
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0x2a41e
cmpq $0x81, %r14
jl 0x29b9b
leaq 0x80(%r12), %r14
movq %r12, %rdi
movq %r14, %rsi
callq 0x2a79b
cmpq %r13, %r14
je 0x29ba6
movq %r14, %rdi
callq 0x2a809
addq $0x8, %r14
jmp 0x29b88
movq %r12, %rdi
movq %r13, %rsi
callq 0x2a79b
movb %bl, 0xf(%rsp)
movq 0x30(%rsp), %r13
movq 0x38(%rsp), %r14
subq %r13, %r14
sete %bl
je 0x29c05
sarq $0x3, %r14
cmpq $0x1, %r14
movq %r14, %rbp
adcq $0x0, %rbp
movq (%r13), %rsi
movq (%r12), %rdx
callq 0x299f0
testb %al, %al
je 0x29c05
movl $0x1, %ecx
movq %rcx, %rbx
cmpq %rcx, %rbp
je 0x29bff
movq (%r13,%rbx,8), %rsi
movq (%r12,%rbx,8), %rdx
callq 0x299f0
leaq 0x1(%rbx), %rcx
testb %al, %al
jne 0x29be1
cmpq %rbx, %r14
setbe %bl
movzbl %bl, %eax
movb 0xf(%rsp), %bl
cmpl $0x3, %eax
movq 0x50(%rsp), %rsi
je 0x29c1a
testl %eax, %eax
jne 0x29c39
addq $0x8, %r15
movq %r12, %rbp
movq %rsi, %r14
cmpq 0x48(%rsp), %r15
setne %bl
jne 0x29ace
jmp 0x29c39
xorl %esi, %esi
xorl %r12d, %r12d
testq %r12, %r12
je 0x29c49
subq %r12, %rsi
movq %r12, %rdi
callq 0x6380
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x29c60
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
andb $0x1, %bl
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
testq %rbp, %rbp
je 0x29c8a
subq %rbp, %r14
movq %rbp, %rdi
movq %r14, %rsi
callq 0x6380
leaq 0x30(%rsp), %rdi
callq 0x6e91
movq %rbx, %rdi
callq 0x6620