// File: biotomas[P]ipasir/sat/picosat961/picosat-961/picosat.c
// Function: decide_phase
static Lit *
decide_phase (PS * ps, Lit * lit)
{
  Lit * not_lit = NOTLIT (lit);
  Var *v = LIT2VAR (lit);

  assert (LIT2SGN (lit) > 0);
  if (v->usedefphase)
    {
      if (v->defphase)
	{
	  /* assign to TRUE */
	}
      else
	{
	  /* assign to FALSE */
	  lit = not_lit;
	}
    }
  else if (!v->assigned)
    {
#ifdef STATS
      ps->staticphasedecisions++;
#endif
      if (ps->defaultphase == POSPHASE)
	{
	  /* assign to TRUE */
	}
      else if (ps->defaultphase == NEGPHASE)
	{
	  /* assign to FALSE */
	  lit = not_lit;
	}
      else if (ps->defaultphase == RNDPHASE)
	{
	  /* randomly assign default phase */
	  if (rrng (ps, 1, 2) != 2)
	    lit = not_lit;
	}
      else if (*LIT2JWH(lit) <= *LIT2JWH (not_lit))
	{
	  /* assign to FALSE (Jeroslow-Wang says there are more short
	   * clauses with negative occurence of this variable, so satisfy
	   * those, to minimize BCP) 
	   */
	  lit = not_lit;
	}
      else
	{
	  /* assign to TRUE (... but strictly more positive occurrences) */
	}
    }
  else 
    {
      /* repeat last phase: phase saving heuristic */

      if (v->phase)
	{
	  /* assign to TRUE (last phase was TRUE as well) */
	}
      else
	{
	  /* assign to FALSE (last phase was FALSE as well) */
	  lit = not_lit;
	}
    }

  return lit;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rdx
movq 0x38(%rdx), %rdx
subq %rdx, %rcx
xorq $0x1, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rdx
movq 0x38(%rdx), %rdx
subq %rdx, %rcx
shrl %ecx
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x38(%rcx), %rcx
subq %rcx, %rax
movl %eax, %edx
andl $0x1, %edx
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $0x0, %edx
cmovnel %ecx, %eax
cmpl $0x0, %eax
jle 0x1a823
jmp 0x1a842
leaq 0x4e4c(%rip), %rdi      # 0x1f676
leaq 0x2a73(%rip), %rsi      # 0x1d2a4
movl $0x1607, %edx           # imm = 0x1607
leaq 0x4e4b(%rip), %rcx      # 0x1f688
callq 0x10b0
movq -0x20(%rbp), %rax
movw (%rax), %ax
shrw $0x7, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x1a87f
movq -0x20(%rbp), %rax
movw (%rax), %ax
shrw $0x8, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x1a872
jmp 0x1a87a
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x1a958
movq -0x20(%rbp), %rax
movw (%rax), %ax
shrw $0x3, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
jne 0x1a933
movq -0x8(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jne 0x1a8a9
jmp 0x1a931
movq -0x8(%rbp), %rax
cmpl $0x1, 0x4(%rax)
jne 0x1a8bd
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x1a92f
movq -0x8(%rbp), %rax
cmpl $0x3, 0x4(%rax)
jne 0x1a8e9
movq -0x8(%rbp), %rdi
movl $0x1, %esi
movl $0x2, %edx
callq 0x1a5f0
cmpl $0x2, %eax
je 0x1a8e7
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x1a92d
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rdx
movq 0x38(%rdx), %rdx
subq %rdx, %rcx
movl (%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movq 0x50(%rcx), %rcx
movq -0x18(%rbp), %rdx
movq -0x8(%rbp), %rsi
movq 0x38(%rsi), %rsi
subq %rsi, %rdx
cmpl (%rcx,%rdx,4), %eax
ja 0x1a929
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x1a92b
jmp 0x1a92b
jmp 0x1a92d
jmp 0x1a92f
jmp 0x1a931
jmp 0x1a956
movq -0x20(%rbp), %rax
movw (%rax), %ax
shrw $0x2, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x1a94c
jmp 0x1a954
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x1a956
jmp 0x1a958
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)