// File: /workspace/github_cpp_makefile_star2_O3/biotomas[P]ipasir/sat/picosat961/picosat-961/picosat.c
// Function: unassign
static void
unassign (PS * ps, Lit * lit)
{
  Cls *reason;
  Var *v;
  Rnk *r;

  assert (lit->val == TRUE);

  LOG ( fprintf (ps->out, "%sunassign %d\n", ps->prefix, LIT2INT (lit)));

  v = LIT2VAR (lit);
  reason = v->reason;

#ifdef NO_BINARY_CLAUSES
  assert (reason != &ps->impl);
  if (ISLITREASON (reason))
    {
      /* DO NOTHING */
    }
  else
#endif
  if (reason)
    {
      assert (reason->locked);
      reason->locked = 0;
      if (reason->learned && reason->size > 2)
	{
	  assert (ps->llocked > 0);
	  ps->llocked--;
	}
    }

  lit->val = UNDEF;
  NOTLIT (lit)->val = UNDEF;

  r = VAR2RNK (v);
  if (!r->pos)
    hpush (ps, r);

#ifndef NDSC
  {
    Cls * p, * next, ** q;

    q = LIT2DHTPS (lit);
    p = *q;
    *q = 0;

    while (p)
      {
	Lit * other = p->lits[0];

	if (other == lit)
	  {
	    other = p->lits[1];
	    q = p->next + 1;
	  }
	else
	  {
	    assert (p->lits[1] == lit);
	    q = p->next;
	  }

	next = *q;
	*q = *LIT2HTPS (other);
	*LIT2HTPS (other) = p;
	p = next;
      }
  }
#endif

#ifndef NADC
  if (v->adotabpos)
    {
      assert (ps->nadotab);
      assert (*v->adotabpos == v->ado);

      *v->adotabpos = 0;
      v->adotabpos = 0;

      ps->nadotab--;
    }
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x1, (%rsi)
jne 0xc9c7
movq %rsi, %rbx
movq %rdi, %r14
movq 0x40(%rdi), %r13
movl 0x38(%rdi), %ecx
movl %ebx, %eax
subl %ecx, %eax
shrl %eax
shlq $0x4, %rax
movq 0x8(%r13,%rax), %rcx
leaq 0x70(%rdi), %rdx
cmpq %rdx, %rcx
je 0xc9e6
testq %rcx, %rcx
sete %dl
orb %cl, %dl
testb $0x1, %dl
jne 0xc83b
movl 0x4(%rcx), %edx
testb $0x4, %dl
je 0xca05
movl %edx, %esi
andl $-0x5, %esi
movl %esi, 0x4(%rcx)
testb $0x2, %dl
je 0xc83b
cmpl $0x3, (%rcx)
jb 0xc83b
movl 0x3b8(%r14), %ecx
testl %ecx, %ecx
je 0xca43
decl %ecx
movl %ecx, 0x3b8(%r14)
addq %rax, %r13
xorl %ecx, %ecx
movb %cl, (%rbx)
movq 0x38(%r14), %rdx
movq %rbx, %rax
subq %rdx, %rax
movq %rax, %rsi
xorq $0x1, %rsi
movb %cl, (%rdx,%rsi)
subq 0x40(%r14), %r13
movq 0x48(%r14), %r15
sarq %r13
testl $0x3fffffff, 0x4(%r15,%r13) # imm = 0x3FFFFFFF
jne 0xc936
movq 0x1c8(%r14), %rax
movq 0x1d0(%r14), %rcx
cmpq 0x1d8(%r14), %rcx
jne 0xc8e0
cmpq %rcx, %rax
ja 0xca24
subq %rax, %rcx
movabsq $0x7fffffff8, %r12      # imm = 0x7FFFFFFF8
andq %rcx, %r12
shrq $0x2, %rcx
testq %r12, %r12
movl %ecx, %ecx
movl $0x1, %ebp
cmovneq %rcx, %rbp
leaq (,%rbp,8), %rcx
movq %r14, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x473a
movq %rax, 0x1c8(%r14)
addq %rax, %r12
leaq (%rax,%rbp,8), %rcx
movq %rcx, 0x1d8(%r14)
movq %r12, %rcx
addq %r13, %r15
leaq 0x8(%rcx), %rdx
movq %rdx, 0x1d0(%r14)
subq %rax, %rcx
movq %rcx, %rax
shrq $0x3, %rax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movl $0xc0000000, %edx       # imm = 0xC0000000
andl 0x4(%r15), %edx
orl %eax, %edx
movl %edx, 0x4(%r15)
movq 0x1c8(%r14), %rax
movabsq $0x1fffffff8, %rdx      # imm = 0x1FFFFFFF8
andq %rcx, %rdx
movq %r15, (%rax,%rdx)
movq %r14, %rdi
movq %r15, %rsi
callq 0xbc36
movq %rbx, %rax
subq 0x38(%r14), %rax
movq 0x60(%r14), %rcx
movl %eax, %edx
movq (%rcx,%rdx,8), %rax
movq $0x0, (%rcx,%rdx,8)
testq %rax, %rax
je 0xc999
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rsi
cmpq %rbx, %rcx
je 0xc966
movl $0x8, %edx
cmpq %rbx, %rsi
je 0xc96e
jmp 0xc9a8
movl $0x10, %edx
movq %rsi, %rcx
movq (%rax,%rdx), %rsi
movq 0x58(%r14), %rdi
movl %ecx, %r8d
subl 0x38(%r14), %r8d
movq (%rdi,%r8,8), %rdi
movq %rdi, (%rax,%rdx)
subl 0x38(%r14), %ecx
movq 0x58(%r14), %rdx
movq %rax, (%rdx,%rcx,8)
movq %rsi, %rax
testq %rsi, %rsi
jne 0xc94d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x77ff(%rip), %rdi      # 0x141ae
leaq 0x68c6(%rip), %rsi      # 0x1327c
leaq 0x77b2(%rip), %rcx      # 0x1416f
movl $0xba5, %edx            # imm = 0xBA5
callq 0x10b0
leaq 0x7790(%rip), %rdi      # 0x1415e
leaq 0x68a7(%rip), %rsi      # 0x1327c
leaq 0x7793(%rip), %rcx      # 0x1416f
movl $0xb71, %edx            # imm = 0xB71
callq 0x10b0
leaq 0x779d(%rip), %rdi      # 0x1418a
leaq 0x6888(%rip), %rsi      # 0x1327c
leaq 0x7774(%rip), %rcx      # 0x1416f
movl $0xb79, %edx            # imm = 0xB79
callq 0x10b0
leaq 0x7cbf(%rip), %rdi      # 0x146cb
leaq 0x6869(%rip), %rsi      # 0x1327c
leaq 0x7755(%rip), %rcx      # 0x1416f
movl $0xb82, %edx            # imm = 0xB82
callq 0x10b0
leaq 0x753e(%rip), %rdi      # 0x13f69
leaq 0x684a(%rip), %rsi      # 0x1327c
leaq 0x8dee(%rip), %rcx      # 0x15827
movl $0xad6, %edx            # imm = 0xAD6
callq 0x10b0
leaq 0x7754(%rip), %rdi      # 0x1419e
leaq 0x682b(%rip), %rsi      # 0x1327c
leaq 0x7717(%rip), %rcx      # 0x1416f
movl $0xb86, %edx            # imm = 0xB86
callq 0x10b0