// File: /workspace/github_cpp_makefile_star2_O2/biotomas[P]ipasir/sat/picosat961/picosat-961/picosat.c
// Function: picosat_humus
const int *
picosat_humus (PS * ps, 
               void (*callback)(void*state,int nmcs,int nhumus),
	       void * state)
{
  int lit, nmcs, j, nhumus;
  const int * mcs, * p;
  unsigned i;
  Var * v;
  enter (ps);
#ifndef NDEBUG
  for (i = 1; i <= ps->max_var; i++)
    {
      v = ps->vars + i;
      assert (!v->humuspos);
      assert (!v->humusneg);
    }
#endif
  nhumus = nmcs = 0;
  while ((mcs = picosat_next_minimal_correcting_subset_of_assumptions (ps)))
    {
      for (p = mcs; (lit = *p); p++)
	{
	  v = ps->vars + abs (lit);
	  if (lit < 0)
	    {
	      if (!v->humusneg)
		{
		  v->humusneg = 1;
		  nhumus++;
		}
	    }
	  else
	    {
	      if (!v->humuspos)
		{
		  v->humuspos = 1;
		  nhumus++;
		}
	    }
	}
      nmcs++;
      LOG ( fprintf (ps->out, 
             "%smcs %d of size %d humus %d\n",
	     ps->prefix, nmcs, (int)(p - mcs), nhumus));
      if (callback)
	callback (state, nmcs, nhumus);
    }
  assert (!ps->szhumus);
  ps->szhumus = 1;
  for (i = 1; i <= ps->max_var; i++)
    {
      v = ps->vars + i;
      if (v->humuspos)
	ps->szhumus++;
      if (v->humusneg)
	ps->szhumus++;
    }
  assert (nhumus + 1 == ps->szhumus);
  NEWN (ps->humus, ps->szhumus);
  j = 0;
  for (i = 1; i <= ps->max_var; i++)
    {
      v = ps->vars + i;
      if (v->humuspos)
	{
	  assert (j < nhumus);
	  ps->humus[j++] = (int) i;
	}
      if (v->humusneg)
	{
	  assert (j < nhumus);
	  assert (i < INT_MAX);
	  ps->humus[j++] = - (int) i;
	}
    }
  assert (j == nhumus);
  assert (j < ps->szhumus);
  ps->humus[j] = 0;
  leave (ps);
  return ps->humus;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
callq 0x3703
movl 0x2c(%rbx), %eax
pushq $0x1
popq %rcx
cmpl %eax, %ecx
ja 0x969f
movq 0x40(%rbx), %rdx
movl %ecx, %esi
shlq $0x4, %rsi
movl (%rdx,%rsi), %edx
btl $0xb, %edx
jb 0x981f
incl %ecx
btl $0xc, %edx
jae 0x965d
leaq 0x839a(%rip), %rdi      # 0x11a21
leaq 0x7be6(%rip), %rsi      # 0x11274
leaq 0x8349(%rip), %rcx      # 0x119de
movl $0x1e81, %edx           # imm = 0x1E81
callq 0x10b0
xorl %r14d, %r14d
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x9606
testq %rax, %rax
je 0x970c
movl (%rax), %edi
testl %edi, %edi
je 0x96f8
movl %edi, %edx
negl %edx
cmovsl %edi, %edx
movq 0x40(%rbx), %rcx
shlq $0x4, %rdx
movzwl (%rcx,%rdx), %esi
testl %edi, %edi
js 0x96ec
movw $0x800, %di             # imm = 0x800
btl $0xb, %esi
jb 0x96e6
addq %rdx, %rcx
movzwl %di, %edx
orl %esi, %edx
movw %dx, (%rcx)
incl %r14d
addq $0x4, %rax
jmp 0x96b1
movw $0x1000, %di            # imm = 0x1000
btl $0xc, %esi
jae 0x96d8
jmp 0x96e6
incl %ebp
testq %r12, %r12
je 0x96a4
movq %r15, %rdi
movl %ebp, %esi
movl %r14d, %edx
callq *%r12
jmp 0x96a4
cmpl $0x0, 0x1b0(%rbx)
jne 0x989b
movl $0x1, 0x1b0(%rbx)
movl 0x2c(%rbx), %ecx
pushq $0x1
popq %rdx
pushq $0x1
popq %rax
pushq $0x10
popq %rsi
cmpq %rcx, %rdx
ja 0x9766
movq 0x40(%rbx), %r8
movl (%r8,%rsi), %edi
btl $0xb, %edi
jae 0x974f
incl %eax
movl %eax, 0x1b0(%rbx)
movzwl (%r8,%rsi), %edi
btl $0xc, %edi
jae 0x975d
incl %eax
movl %eax, 0x1b0(%rbx)
incq %rdx
addq $0x10, %rsi
jmp 0x972f
leal 0x1(%r14), %ecx
cmpl %eax, %ecx
jne 0x98ba
movslq %eax, %rsi
shlq $0x2, %rsi
movq %rbx, %rdi
callq 0x8f50
movq %rax, 0x1a8(%rbx)
pushq $0x1
popq %rdx
xorl %ecx, %ecx
pushq $-0x1
popq %rsi
cmpl 0x2c(%rbx), %edx
ja 0x97ea
movq 0x40(%rbx), %rdi
movl %edx, %r9d
shlq $0x4, %r9
movl (%rdi,%r9), %r8d
btl $0xb, %r8d
jae 0x97c4
cmpl %r14d, %ecx
jge 0x985d
addq %r9, %rdi
movslq %ecx, %r8
incl %ecx
movl %edx, (%rax,%r8,4)
movzwl (%rdi), %r8d
btl $0xc, %r8d
jae 0x97e4
cmpl %r14d, %ecx
jge 0x987c
cmpl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
jae 0x983e
movslq %ecx, %rdi
incl %ecx
movl %esi, (%rax,%rdi,4)
incl %edx
decl %esi
jmp 0x9790
cmpl %r14d, %ecx
jne 0x98d9
cmpl 0x1b0(%rbx), %r14d
jge 0x98f8
movslq %r14d, %rcx
andl $0x0, (%rax,%rcx,4)
movq %rbx, %rdi
callq 0x3ade
movq 0x1a8(%rbx), %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x81ab(%rip), %rdi      # 0x119d1
leaq 0x7a47(%rip), %rsi      # 0x11274
leaq 0x81aa(%rip), %rcx      # 0x119de
movl $0x1e80, %edx           # imm = 0x1E80
callq 0x10b0
leaq 0x821b(%rip), %rdi      # 0x11a60
leaq 0x7a28(%rip), %rsi      # 0x11274
leaq 0x818b(%rip), %rcx      # 0x119de
movl $0x1eba, %edx           # imm = 0x1EBA
callq 0x10b0
leaq 0x81f1(%rip), %rdi      # 0x11a55
leaq 0x7a09(%rip), %rsi      # 0x11274
leaq 0x816c(%rip), %rcx      # 0x119de
movl $0x1eb4, %edx           # imm = 0x1EB4
callq 0x10b0
leaq 0x81d2(%rip), %rdi      # 0x11a55
leaq 0x79ea(%rip), %rsi      # 0x11274
leaq 0x814d(%rip), %rcx      # 0x119de
movl $0x1eb9, %edx           # imm = 0x1EB9
callq 0x10b0
leaq 0x818c(%rip), %rdi      # 0x11a2e
leaq 0x79cb(%rip), %rsi      # 0x11274
leaq 0x812e(%rip), %rcx      # 0x119de
movl $0x1ea2, %edx           # imm = 0x1EA2
callq 0x10b0
leaq 0x817a(%rip), %rdi      # 0x11a3b
leaq 0x79ac(%rip), %rsi      # 0x11274
leaq 0x810f(%rip), %rcx      # 0x119de
movl $0x1eac, %edx           # imm = 0x1EAC
callq 0x10b0
leaq 0x818c(%rip), %rdi      # 0x11a6c
leaq 0x798d(%rip), %rsi      # 0x11274
leaq 0x80f0(%rip), %rcx      # 0x119de
movl $0x1ebe, %edx           # imm = 0x1EBE
callq 0x10b0
leaq 0x8179(%rip), %rdi      # 0x11a78
leaq 0x796e(%rip), %rsi      # 0x11274
leaq 0x80d1(%rip), %rcx      # 0x119de
movl $0x1ebf, %edx           # imm = 0x1EBF
callq 0x10b0