// File: /workspace/github_cpp_makefile_star2_O3/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 $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %rdx
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x28500
movq (%r14), %r15
movq 0x8(%r14), %r14
cmpq %r14, %r15
je 0x29a37
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 0x29f13
cmpq $0x81, %r12
jl 0x29a2c
leaq 0x80(%r15), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x2a26a
cmpq %r14, %r12
je 0x29a37
movq %r12, %rdi
callq 0x2a2d8
addq $0x8, %r12
jmp 0x29a19
movq %r15, %rdi
movq %r14, %rsi
callq 0x2a26a
movq (%rbx), %r15
movq 0x8(%rbx), %rax
movq %rax, 0x30(%rsp)
cmpq %rax, %r15
je 0x29b7a
xorl %r13d, %r13d
xorl %ebp, %ebp
movq (%r15), %rdx
movq %rsp, %rdi
callq 0x28500
movq (%rsp), %rbx
movq 0x8(%rsp), %r12
movq 0x10(%rsp), %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
testq %r13, %r13
je 0x29aa3
subq %r13, %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x6380
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x29aa3
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x20(%rsp), %r13
subq 0x18(%rsp), %r13
movq %r12, %rax
subq %rbx, %rax
cmpq %rax, %r13
jne 0x29b4e
cmpq %r12, %rbx
je 0x29b16
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2a331
cmpq $0x81, %r13
jl 0x29b0b
leaq 0x80(%rbx), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2a688
cmpq %r12, %r13
je 0x29b16
movq %r13, %rdi
callq 0x2a6f6
addq $0x8, %r13
jmp 0x29af8
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2a688
movq 0x18(%rsp), %r12
movq 0x20(%rsp), %r13
subq %r12, %r13
je 0x29ba4
sarq $0x3, %r13
cmpq $0x1, %r13
adcq $0x0, %r13
xorl %ebp, %ebp
movq (%r12,%rbp,8), %rsi
movq (%rbx,%rbp,8), %rdx
callq 0x29976
testb %al, %al
je 0x29b4e
incq %rbp
cmpq %rbp, %r13
jne 0x29b33
jmp 0x29b67
addq $0x8, %r15
movq %rbx, %r13
movq %r14, %rbp
cmpq 0x30(%rsp), %r15
jne 0x29a51
xorl %ebp, %ebp
jmp 0x29ba7
movb $0x1, %bpl
subq %rbx, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6380
jmp 0x29b7c
xorl %ebp, %ebp
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x29b93
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %bpl
testq %rbx, %rbx
jne 0x29b6a
jmp 0x29b7c
movq %rax, %rbx
testq %r13, %r13
je 0x29bc4
subq %r13, %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x6380
leaq 0x18(%rsp), %rdi
callq 0x6ea7
movq %rbx, %rdi
callq 0x6620