// File: /workspace/github_cpp_makefile_star2_O3/jacky860226[P]JinkelaSat/src/include/JinkelaSat.hpp
// Function: MiniSat::JinkelaSat::litRedundant(MiniSat::Literal, std::vector<MiniSat::Literal, std::allocator<MiniSat::Literal>>&)
bool litRedundant(Literal p, std::vector<Literal> &analyze_toclear) {
    enum {
      seen_undef = 0,
      seen_source = 1,
      seen_removable = 2,
      seen_failed = 3
    };
    auto c = reason(p.var());
    std::vector<std::pair<uint32_t, Literal>> Stack;
    for (size_t i = 1;; ++i) {
      if (i < c->size()) {
        Literal l = (*c)[i];
        if (level(l.var()) == 0 || seen[l.var()] == seen_source ||
            seen[l.var()] == seen_removable)
          continue;
        if (reason(l.var()) == nullptr || seen[l.var()] == seen_failed) {
          Stack.emplace_back(0, p);
          for (auto v : Stack)
            if (seen[v.second.var()] == seen_undef) {
              seen[v.second.var()] = seen_failed;
              analyze_toclear.emplace_back(v.second);
            }
          return false;
        }
        Stack.emplace_back(i, p);
        i = 0, p = l;
        c = reason(p.var());
      } else {
        if (seen[p.var()] == seen_undef) {
          seen[p.var()] = seen_removable;
          analyze_toclear.emplace_back(p);
        }
        if (Stack.empty())
          break;
        std::tie(i, p) = Stack.back();
        c = reason(p.var());
        Stack.pop_back();
      }
    }
    return true;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rdi, %r14
leaq 0xc(%rsp), %rax
movl %esi, (%rax)
movl %esi, %eax
sarl %eax
movslq %eax, %rcx
movq 0x80(%rdi), %rax
shlq $0x4, %rcx
movq (%rax,%rcx), %rcx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
movl $0x1, %r13d
movq %r13, 0x30(%rsp)
movq (%rcx), %rdx
movq 0x8(%rcx), %r12
subq %rdx, %r12
sarq $0x2, %r12
cmpq %r12, %r13
jb 0x6415
sarl %esi
movslq %esi, %rax
movq 0xd8(%r14), %rcx
cmpb $0x0, (%rcx,%rax)
jne 0x649b
movb $0x2, (%rcx,%rax)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x648e
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x649b
movl (%rdx,%r13,4), %ebp
movl %ebp, %edx
sarl %edx
movslq %edx, %rdx
movq %rdx, %r15
shlq $0x4, %r15
cmpq $0x0, 0x8(%rax,%r15)
je 0x6442
movq 0xd8(%r14), %rdi
movb (%rdi,%rdx), %dl
leal -0x1(%rdx), %edi
cmpb $0x2, %dil
jae 0x6449
movl %esi, %ebp
jmp 0x64dd
cmpb $0x3, %dl
je 0x64e7
cmpq $0x0, (%rax,%r15)
je 0x64e7
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0xc(%rsp), %rdx
callq 0x69ae
movq $0x0, 0x30(%rsp)
movl %ebp, 0xc(%rsp)
movq 0x80(%r14), %rax
movq (%rax,%r15), %rcx
xorl %r13d, %r13d
jmp 0x64dd
movq %rbx, %rdi
leaq 0xc(%rsp), %rdx
callq 0x4602
movq 0x10(%rsp), %rbp
movq 0x18(%rsp), %rax
cmpq %rax, %rbp
je 0x6563
leaq -0x8(%rax), %rdx
movl -0x8(%rax), %r13d
movq %r13, 0x30(%rsp)
movl -0x4(%rax), %ebp
movl %ebp, 0xc(%rsp)
movl %ebp, %eax
sarl %eax
movslq %eax, %rcx
movq 0x80(%r14), %rax
shlq $0x4, %rcx
movq (%rax,%rcx), %rcx
movq %rdx, 0x18(%rsp)
incq %r13
movl %ebp, %esi
jmp 0x63c2
leaq 0x28(%rsp), %rsi
movl $0x0, (%rsi)
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x6972
movq 0x10(%rsp), %rbp
movq 0x18(%rsp), %r15
cmpq %r15, %rbp
je 0x6563
movq (%rbp), %rax
movq %rax, 0x28(%rsp)
sarq $0x21, %rax
movq 0xd8(%r14), %rcx
cmpb $0x0, (%rcx,%rax)
jne 0x6555
movb $0x3, (%rcx,%rax)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x6548
movl 0x2c(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x6555
movq %rbx, %rdi
leaq 0x2c(%rsp), %rdx
callq 0x4602
addq $0x8, %rbp
cmpq %r15, %rbp
jne 0x6510
movq 0x10(%rsp), %rbp
testq %rbp, %rbp
je 0x6578
movq 0x20(%rsp), %rsi
subq %rbp, %rsi
movq %rbp, %rdi
callq 0x2180
cmpq %r12, %r13
setae %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6593
jmp 0x6593
jmp 0x6593
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x65ad
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq %rbx, %rdi
callq 0x2240
nop