// File: biotomas[P]ipasir/sat/picosat961/picosat-961/picosat.c
// Function: fanalyze
static void
fanalyze (PS * ps)
{
  Lit ** eol, ** p, * lit;
  Cls * c, * reason;
  Var * v, * u;
  int next;

  double start = picosat_time_stamp ();

  assert (ps->failed_assumption);
  assert (ps->failed_assumption->val == FALSE);

  v = LIT2VAR (ps->failed_assumption);
  reason = var2reason (ps, v);
  if (!reason) return;
#ifdef NO_BINARY_CLAUSES
  if (reason == &ps->impl)
    resetimpl (ps);
#endif

  eol = end_of_lits (reason);
  for (p = reason->lits; p != eol; p++)
    {
      lit = *p;
      u = LIT2VAR (lit);
      if (u == v) continue;
      if (u->reason) break;
    }
  if (p == eol) return;

  assert (ps->ahead == ps->added);
  assert (ps->mhead == ps->marked);
  assert (ps->rhead == ps->resolved);

  next = 0;
  mark_var (ps, v);
  add_lit (ps, NOTLIT (ps->failed_assumption));

  do
    {
      v = ps->marked[next++];
      use_var (ps, v);
      if (v->reason)
	{
	  reason = var2reason (ps, v);
#ifdef NO_BINARY_CLAUSES
	  if (reason == &ps->impl)
	    resetimpl (ps);
#endif
	  add_antecedent (ps, reason);
	  eol = end_of_lits (reason);
	  for (p = reason->lits; p != eol; p++)
	    {
	      lit = *p;
	      u = LIT2VAR (lit);
	      if (u == v) continue;
	      if (u->mark) continue;
	      mark_var (ps, u);
	    }
	}
      else
	{
	  lit = VAR2LIT (v);
	  if (lit->val == TRUE) lit = NOTLIT (lit);
	  add_lit (ps, lit);
	}
    } 
  while (ps->marked + next < ps->mhead);

  c = add_simplified_clause (ps, 1);
  v = LIT2VAR (ps->failed_assumption);
  reason = v->reason;
#ifdef NO_BINARY_CLAUSES
  if (!ISLITREASON (reason))
#endif
    {
      assert (reason->locked);
      reason->locked = 0;
      if (reason->learned && reason->size > 2)
	{
	  assert (ps->llocked > 0);
	  ps->llocked--;
	}
    }

#ifdef NO_BINARY_CLAUSES
  if (c == &ps->impl)
    {
      c = impl2reason (ps, NOTLIT (ps->failed_assumption));
    }
  else
#endif
    {
      assert (c->learned);
      assert (!c->locked);
      c->locked = 1;
      if (c->size > 2)
	{
	  ps->llocked++;
	  assert (ps->llocked > 0);
	}
    }

  v->reason = c;

  while (ps->mhead > ps->marked)
    (*--ps->mhead)->mark = 0;

  if (ps->verbosity)
     fprintf (ps->out, "%sfanalyze took %.1f seconds\n", 
	     ps->prefix, picosat_time_stamp () - start);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
callq 0xb380
movsd %xmm0, -0x50(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x1b8(%rax)
je 0x19f86
jmp 0x19fa5
leaq 0x35f5(%rip), %rdi      # 0x1d582
leaq 0x3310(%rip), %rsi      # 0x1d2a4
movl $0xea6, %edx            # imm = 0xEA6
leaq 0x55a6(%rip), %rcx      # 0x1f546
callq 0x10b0
movq -0x8(%rbp), %rax
movq 0x1b8(%rax), %rax
movsbl (%rax), %eax
cmpl $-0x1, %eax
jne 0x19fba
jmp 0x19fd9
leaq 0x5599(%rip), %rdi      # 0x1f55a
leaq 0x32dc(%rip), %rsi      # 0x1d2a4
movl $0xea7, %edx            # imm = 0xEA7
leaq 0x5572(%rip), %rcx      # 0x1f546
callq 0x10b0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x1b8(%rcx), %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, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x17d30
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x1a023
jmp 0x1a5e1
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
addq $0x70, %rcx
cmpq %rcx, %rax
jne 0x1a03d
movq -0x8(%rbp), %rdi
callq 0x13ec0
movq -0x30(%rbp), %rdi
callq 0xb980
movq %rax, -0x10(%rbp)
movq -0x30(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x10(%rbp), %rax
je 0x1a0ba
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x20(%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, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x38(%rbp), %rax
jne 0x1a09d
jmp 0x1a0ac
movq -0x40(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1a0aa
jmp 0x1a0ba
jmp 0x1a0ac
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
jmp 0x1a056
movq -0x18(%rbp), %rax
cmpq -0x10(%rbp), %rax
jne 0x1a0c9
jmp 0x1a5e1
movq -0x8(%rbp), %rax
movq 0x260(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x258(%rcx), %rax
jne 0x1a0e3
jmp 0x1a102
leaq 0x471a(%rip), %rdi      # 0x1e804
leaq 0x31b3(%rip), %rsi      # 0x1d2a4
movl $0xebb, %edx            # imm = 0xEBB
leaq 0x5449(%rip), %rcx      # 0x1f546
callq 0x10b0
movq -0x8(%rbp), %rax
movq 0x278(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x270(%rcx), %rax
jne 0x1a11c
jmp 0x1a13b
leaq 0x3f8b(%rip), %rdi      # 0x1e0ae
leaq 0x317a(%rip), %rsi      # 0x1d2a4
movl $0xebc, %edx            # imm = 0xEBC
leaq 0x5410(%rip), %rcx      # 0x1f546
callq 0x10b0
movq -0x8(%rbp), %rax
movq 0x2a8(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x2a0(%rcx), %rax
jne 0x1a155
jmp 0x1a174
leaq 0x465e(%rip), %rdi      # 0x1e7ba
leaq 0x3141(%rip), %rsi      # 0x1d2a4
movl $0xebd, %edx            # imm = 0xEBD
leaq 0x53d7(%rip), %rcx      # 0x1f546
callq 0x10b0
movl $0x0, -0x44(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x18050
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x1b8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x38(%rcx), %rcx
subq %rcx, %rax
xorq $0x1, %rax
addq %rax, %rsi
callq 0x6c80
movq -0x8(%rbp), %rax
movq 0x270(%rax), %rax
movl -0x44(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x44(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x13c50
movq -0x38(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1a2bd
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x17d30
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
addq $0x70, %rcx
cmpq %rcx, %rax
jne 0x1a21e
movq -0x8(%rbp), %rdi
callq 0x13ec0
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x14060
movq -0x30(%rbp), %rdi
callq 0xb980
movq %rax, -0x10(%rbp)
movq -0x30(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x10(%rbp), %rax
je 0x1a2bb
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x20(%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, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x38(%rbp), %rax
jne 0x1a28b
jmp 0x1a2ad
movq -0x40(%rbp), %rax
movw (%rax), %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x1a2a0
jmp 0x1a2ad
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x18050
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
jmp 0x1a244
jmp 0x1a31d
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x38(%rbp), %rcx
movq -0x8(%rbp), %rdx
movq 0x40(%rdx), %rdx
subq %rdx, %rcx
sarq $0x4, %rcx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x1, %eax
jne 0x1a310
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rdx
movq 0x38(%rdx), %rdx
subq %rdx, %rcx
xorq $0x1, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x6c80
jmp 0x1a31f
movq -0x8(%rbp), %rax
movq 0x270(%rax), %rax
movslq -0x44(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq -0x8(%rbp), %rcx
cmpq 0x278(%rcx), %rax
jb 0x1a1b6
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x14260
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x1b8(%rcx), %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, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
jne 0x1a443
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
shrl $0x2, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1a3b7
jmp 0x1a3d6
leaq 0x438a(%rip), %rdi      # 0x1e748
leaq 0x2edf(%rip), %rsi      # 0x1d2a4
movl $0xee9, %edx            # imm = 0xEE9
leaq 0x5175(%rip), %rcx      # 0x1f546
callq 0x10b0
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
andl $-0x5, %ecx
orl $0x0, %ecx
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
shrl %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1a441
movq -0x30(%rbp), %rax
cmpl $0x2, (%rax)
jbe 0x1a441
movq -0x8(%rbp), %rax
cmpl $0x0, 0x3b8(%rax)
jbe 0x1a40f
jmp 0x1a42e
leaq 0x3e05(%rip), %rdi      # 0x1e21b
leaq 0x2e87(%rip), %rsi      # 0x1d2a4
movl $0xeed, %edx            # imm = 0xEED
leaq 0x511d(%rip), %rcx      # 0x1f546
callq 0x10b0
movq -0x8(%rbp), %rax
movl 0x3b8(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x3b8(%rax)
jmp 0x1a443
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
addq $0x70, %rcx
cmpq %rcx, %rax
jne 0x1a48b
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x1b8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x38(%rcx), %rcx
subq %rcx, %rax
xorq $0x1, %rax
addq %rax, %rsi
callq 0x15710
movq %rax, -0x28(%rbp)
jmp 0x1a54e
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
shrl %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1a49e
jmp 0x1a4bd
leaq 0x4fa7(%rip), %rdi      # 0x1f44c
leaq 0x2df8(%rip), %rsi      # 0x1d2a4
movl $0xefa, %edx            # imm = 0xEFA
leaq 0x508e(%rip), %rcx      # 0x1f546
callq 0x10b0
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
shrl $0x2, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x1a4d1
jmp 0x1a4f0
leaq 0x50a6(%rip), %rdi      # 0x1f57e
leaq 0x2dc5(%rip), %rsi      # 0x1d2a4
movl $0xefb, %edx            # imm = 0xEFB
leaq 0x505b(%rip), %rcx      # 0x1f546
callq 0x10b0
movq -0x28(%rbp), %rax
movl 0x4(%rax), %ecx
andl $-0x5, %ecx
orl $0x4, %ecx
movl %ecx, 0x4(%rax)
movq -0x28(%rbp), %rax
cmpl $0x2, (%rax)
jbe 0x1a54c
movq -0x8(%rbp), %rax
movl 0x3b8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x3b8(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x3b8(%rax)
jbe 0x1a52b
jmp 0x1a54a
leaq 0x3ce9(%rip), %rdi      # 0x1e21b
leaq 0x2d6b(%rip), %rsi      # 0x1d2a4
movl $0xf00, %edx            # imm = 0xF00
leaq 0x5001(%rip), %rcx      # 0x1f546
callq 0x10b0
jmp 0x1a54c
jmp 0x1a54e
movq -0x28(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x278(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x270(%rcx), %rax
jbe 0x1a59f
movq -0x8(%rbp), %rcx
movq 0x278(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x278(%rcx)
movq -0x8(%rax), %rax
movw (%rax), %cx
andw $-0x2, %cx
orw $0x0, %cx
movw %cx, (%rax)
jmp 0x1a55a
movq -0x8(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0x1a5e1
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x58(%rbp)
callq 0xb380
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rdx
subsd -0x50(%rbp), %xmm0
leaq 0x4faf(%rip), %rsi      # 0x1f589
movb $0x1, %al
callq 0x1130
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)