// File: /workspace/github_cpp_makefile_star2_O2/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 0x4(%rsp), %rax
movl %esi, (%rax)
movl %esi, %eax
sarl %eax
movslq %eax, %rcx
movq 0x80(%rdi), %rax
shlq $0x4, %rcx
movq (%rax,%rcx), %rcx
leaq 0x10(%rsp), %rdx
andq $0x0, 0x10(%rdx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rdx)
pushq $0x1
popq %rbp
movq %rbp, 0x8(%rsp)
movq (%rcx), %rdx
movq 0x8(%rcx), %r13
subq %rdx, %r13
sarq $0x2, %r13
cmpq %r13, %rbp
jb 0x63b2
sarl %esi
movslq %esi, %rax
movq 0xd8(%r14), %rcx
cmpb $0x0, (%rcx,%rax)
jne 0x636f
movb $0x2, (%rcx,%rax)
movq %rbx, %rdi
leaq 0x4(%rsp), %rsi
callq 0x4632
movq 0x18(%rsp), %rax
cmpq %rax, 0x10(%rsp)
je 0x647f
leaq -0x8(%rax), %rdx
movl -0x8(%rax), %ebp
movq %rbp, 0x8(%rsp)
movl -0x4(%rax), %r12d
movl %r12d, 0x4(%rsp)
movl %r12d, %eax
sarl %eax
movslq %eax, %rcx
movq 0x80(%r14), %rax
shlq $0x4, %rcx
movq (%rax,%rcx), %rcx
movq %rdx, 0x18(%rsp)
jmp 0x641d
movl (%rdx,%rbp,4), %r12d
movl %r12d, %edx
sarl %edx
movslq %edx, %rdx
movq %rdx, %r15
shlq $0x4, %r15
cmpq $0x0, 0x8(%rax,%r15)
je 0x63e0
movq 0xd8(%r14), %rdi
movb (%rdi,%rdx), %dl
leal -0x1(%rdx), %edi
cmpb $0x2, %dil
jae 0x63e5
movl %esi, %r12d
jmp 0x641d
cmpb $0x3, %dl
je 0x6428
cmpq $0x0, (%rax,%r15)
je 0x6428
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %rdx
callq 0x6924
andq $0x0, 0x8(%rsp)
movl %r12d, 0x4(%rsp)
movq 0x80(%r14), %rax
movq (%rax,%r15), %rcx
xorl %ebp, %ebp
incq %rbp
movl %r12d, %esi
jmp 0x6334
leaq 0x30(%rsp), %rsi
andl $0x0, (%rsi)
leaq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rdx
callq 0x68e8
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r15
cmpq %r15, %r12
je 0x647f
movq (%r12), %rax
movq %rax, 0x30(%rsp)
sarq $0x21, %rax
movq 0xd8(%r14), %rcx
cmpb $0x0, (%rcx,%rax)
jne 0x6479
movb $0x3, (%rcx,%rax)
movq %rbx, %rdi
leaq 0x34(%rsp), %rsi
callq 0x4632
addq $0x8, %r12
jmp 0x6449
cmpq %r13, %rbp
setae %bl
leaq 0x10(%rsp), %rdi
callq 0x6b9e
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x64a6
jmp 0x64a6
jmp 0x64a6
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x6b9e
movq %rbx, %rdi
callq 0x2250
nop