// File: /workspace/github_cpp_makefile_star2_O2/biotomas[P]ipasir/sat/minisat220/minisat-220/minisat/core/Solver.cc
// Function: Minisat::Solver::litRedundant(Minisat::Lit)
bool Solver::litRedundant(Lit p)
{
    enum { seen_undef = 0, seen_source = 1, seen_removable = 2, seen_failed = 3 };
    assert(seen[var(p)] == seen_undef || seen[var(p)] == seen_source);
    assert(reason(var(p)) != CRef_Undef);

    Clause*               c     = &ca[reason(var(p))];
    vec<ShrinkStackElem>& stack = analyze_stack;
    stack.clear();

    for (uint32_t i = 1; ; i++){
        if (i < (uint32_t)c->size()){
            // Checking 'p'-parents 'l':
            Lit l = (*c)[i];
            
            // Variable at level 0 or previously removable:
            if (level(var(l)) == 0 || seen[var(l)] == seen_source || seen[var(l)] == seen_removable){
                continue; }
            
            // Check variable can not be removed for some local reason:
            if (reason(var(l)) == CRef_Undef || seen[var(l)] == seen_failed){
                stack.push(ShrinkStackElem(0, p));
                for (int i = 0; i < stack.size(); i++)
                    if (seen[var(stack[i].l)] == seen_undef){
                        seen[var(stack[i].l)] = seen_failed;
                        analyze_toclear.push(stack[i].l);
                    }
                    
                return false;
            }

            // Recursively check 'l':
            stack.push(ShrinkStackElem(i, p));
            i  = 0;
            p  = l;
            c  = &ca[reason(var(p))];
        }else{
            // Finished with current element 'p' and reason 'c':
            if (seen[var(p)] == seen_undef){
                seen[var(p)] = seen_removable;
                analyze_toclear.push(p);
            }

            // Terminate with success if stack is empty:
            if (stack.size() == 0) break;
            
            // Continue with top element on stack:
            i  = stack.last().i;
            p  = stack.last().l;
            c  = &ca[reason(var(p))];

            stack.pop();
        }
    }

    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl %esi, 0x4(%rsp)
movl %esi, %ecx
sarl %ecx
movq 0x210(%rdi), %rax
movslq %ecx, %rcx
movl (%rax,%rcx,8), %ecx
shlq $0x2, %rcx
cmpq $0x0, 0x330(%rdi)
je 0x4b95
andl $0x0, 0x338(%rbx)
addq 0x2d8(%rbx), %rcx
leaq 0x330(%rbx), %rdx
movq %rdx, 0x8(%rsp)
leaq 0x340(%rbx), %r15
pushq $0x1
popq %rbp
movl (%rcx), %r13d
shrl $0x5, %r13d
cmpl %r13d, %ebp
jb 0x4c2d
sarl %esi
movq 0x318(%rbx), %rax
movslq %esi, %rcx
cmpb $0x0, (%rax,%rcx)
jne 0x4be1
movb $0x2, (%rax,%rcx)
movq %r15, %rdi
leaq 0x4(%rsp), %rsi
callq 0x375e
movslq 0x338(%rbx), %rdx
testq %rdx, %rdx
je 0x4d0f
movq 0x330(%rbx), %rax
movl -0x8(%rax,%rdx,8), %ebp
movl -0x4(%rax,%rdx,8), %r12d
movl %r12d, 0x4(%rsp)
movl %r12d, %ecx
sarl %ecx
movq 0x210(%rbx), %rax
movslq %ecx, %rcx
movl (%rax,%rcx,8), %ecx
shlq $0x2, %rcx
addq 0x2d8(%rbx), %rcx
decl %edx
movl %edx, 0x338(%rbx)
jmp 0x4c9d
movl %ebp, %edx
movl 0x4(%rcx,%rdx,4), %r12d
movl %r12d, %edx
sarl %edx
movslq %edx, %r14
cmpl $0x0, 0x4(%rax,%r14,8)
je 0x4c58
movq 0x318(%rbx), %rdx
movb (%rdx,%r14), %dl
leal -0x1(%rdx), %edi
cmpb $0x2, %dil
jae 0x4c5d
movl %esi, %r12d
jmp 0x4c9d
cmpb $0x3, %dl
je 0x4ca7
cmpl $-0x1, (%rax,%r14,8)
je 0x4ca7
movl %ebp, 0x10(%rsp)
movl %esi, 0x14(%rsp)
movq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x699a
movl %r12d, 0x4(%rsp)
movq 0x210(%rbx), %rax
movl (%rax,%r14,8), %ecx
shlq $0x2, %rcx
addq 0x2d8(%rbx), %rcx
xorl %ebp, %ebp
incl %ebp
movl %r12d, %esi
jmp 0x4bb2
leaq 0x10(%rsp), %rax
andl $0x0, (%rax)
movl %esi, 0x4(%rax)
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x699a
pushq $0x4
popq %r12
xorl %r14d, %r14d
movslq 0x338(%rbx), %rax
cmpq %rax, %r14
jge 0x4d0f
movq 0x318(%rbx), %rax
movq 0x330(%rbx), %rcx
movl (%rcx,%r12), %ecx
sarl %ecx
movslq %ecx, %rcx
cmpb $0x0, (%rax,%rcx)
jne 0x4d06
movb $0x3, (%rax,%rcx)
movq 0x8(%rsp), %rax
movq (%rax), %rsi
addq %r12, %rsi
movq %r15, %rdi
callq 0x375e
incq %r14
addq $0x8, %r12
jmp 0x4cc6
cmpl %r13d, %ebp
setae %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq