// File: /workspace/github_cpp_makefile_star2_O3/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 0x3eb1
movl 0x2c(%rbx), %eax
testl %eax, %eax
je 0xa422
movq 0x40(%rbx), %rcx
movl $0x1, %edx
movl %edx, %esi
shlq $0x4, %rsi
movl (%rcx,%rsi), %esi
btl $0xb, %esi
jb 0xa605
btl $0xc, %esi
jb 0xa5e6
incl %edx
cmpl %eax, %edx
jbe 0xa3ff
movq %rbx, %rdi
callq 0xa39c
testq %rax, %rax
je 0xa4a6
xorl %ebp, %ebp
xorl %r14d, %r14d
movl (%rax), %ecx
testl %ecx, %ecx
je 0xa485
addq $0x4, %rax
movl %ecx, %esi
negl %esi
cmovsl %ecx, %esi
movq 0x40(%rbx), %rdx
shlq $0x4, %rsi
movzwl (%rdx,%rsi), %edi
testl %ecx, %ecx
js 0xa479
movw $0x800, %cx             # imm = 0x800
btl $0xb, %edi
jb 0xa46d
addq %rsi, %rdx
movzwl %cx, %ecx
orl %edi, %ecx
movw %cx, (%rdx)
incl %r14d
movl (%rax), %ecx
addq $0x4, %rax
testl %ecx, %ecx
jne 0xa43e
jmp 0xa485
movw $0x1000, %cx            # imm = 0x1000
btl $0xc, %edi
jae 0xa45f
jmp 0xa46d
incl %ebp
testq %r12, %r12
je 0xa497
movq %r15, %rdi
movl %ebp, %esi
movl %r14d, %edx
callq *%r12
movq %rbx, %rdi
callq 0xa39c
testq %rax, %rax
jne 0xa434
jmp 0xa4a9
xorl %r14d, %r14d
cmpl $0x0, 0x1b0(%rbx)
jne 0xa681
movl $0x1, 0x1b0(%rbx)
movl 0x2c(%rbx), %eax
testl %eax, %eax
je 0xa514
incl %eax
cmpl $0x3, %eax
movl $0x2, %ecx
cmovael %eax, %ecx
movq 0x40(%rbx), %rdx
shlq $0x4, %rcx
movl $0x1, %eax
movl $0x10, %esi
movl (%rdx,%rsi), %edi
btl $0xb, %edi
jae 0xa4fb
incl %eax
movl %eax, 0x1b0(%rbx)
movzwl (%rdx,%rsi), %edi
btl $0xc, %edi
jae 0xa509
incl %eax
movl %eax, 0x1b0(%rbx)
addq $0x10, %rsi
cmpq %rsi, %rcx
jne 0xa4e6
jmp 0xa519
movl $0x1, %eax
leal 0x1(%r14), %ecx
cmpl %eax, %ecx
jne 0xa6a0
movslq %eax, %rsi
shlq $0x2, %rsi
movq %rbx, %rdi
callq 0x9cfe
movq %rax, 0x1a8(%rbx)
cmpl $0x0, 0x2c(%rbx)
je 0xa5ac
movq 0x40(%rbx), %rdx
xorl %ecx, %ecx
movl $0x1, %esi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl %esi, %r8d
shlq $0x4, %r8
movl (%rdx,%r8), %r9d
btl $0xb, %r9d
jae 0xa57c
cmpl %r14d, %ecx
jge 0xa624
addq %rdx, %r8
movslq %ecx, %r9
incl %ecx
movl %esi, (%rax,%r9,4)
movzwl (%r8), %r9d
btl $0xc, %r9d
jae 0xa5a1
cmpl %r14d, %ecx
jge 0xa662
cmpl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
jae 0xa643
movslq %ecx, %r8
incl %ecx
movl %edi, (%rax,%r8,4)
incl %esi
decl %edi
cmpl 0x2c(%rbx), %esi
jbe 0xa551
jmp 0xa5ae
xorl %ecx, %ecx
cmpl %r14d, %ecx
jne 0xa6bf
cmpl 0x1b0(%rbx), %r14d
jge 0xa6de
movslq %r14d, %rcx
movl $0x0, (%rax,%rcx,4)
movq %rbx, %rdi
callq 0x4375
movq 0x1a8(%rbx), %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x943c(%rip), %rdi      # 0x13a29
leaq 0x8c88(%rip), %rsi      # 0x1327c
leaq 0x93eb(%rip), %rcx      # 0x139e6
movl $0x1e81, %edx           # imm = 0x1E81
callq 0x10b0
leaq 0x93cd(%rip), %rdi      # 0x139d9
leaq 0x8c69(%rip), %rsi      # 0x1327c
leaq 0x93cc(%rip), %rcx      # 0x139e6
movl $0x1e80, %edx           # imm = 0x1E80
callq 0x10b0
leaq 0x9432(%rip), %rdi      # 0x13a5d
leaq 0x8c4a(%rip), %rsi      # 0x1327c
leaq 0x93ad(%rip), %rcx      # 0x139e6
movl $0x1eb4, %edx           # imm = 0x1EB4
callq 0x10b0
leaq 0x941e(%rip), %rdi      # 0x13a68
leaq 0x8c2b(%rip), %rsi      # 0x1327c
leaq 0x938e(%rip), %rcx      # 0x139e6
movl $0x1eba, %edx           # imm = 0x1EBA
callq 0x10b0
leaq 0x93f4(%rip), %rdi      # 0x13a5d
leaq 0x8c0c(%rip), %rsi      # 0x1327c
leaq 0x936f(%rip), %rcx      # 0x139e6
movl $0x1eb9, %edx           # imm = 0x1EB9
callq 0x10b0
leaq 0x93ae(%rip), %rdi      # 0x13a36
leaq 0x8bed(%rip), %rsi      # 0x1327c
leaq 0x9350(%rip), %rcx      # 0x139e6
movl $0x1ea2, %edx           # imm = 0x1EA2
callq 0x10b0
leaq 0x939c(%rip), %rdi      # 0x13a43
leaq 0x8bce(%rip), %rsi      # 0x1327c
leaq 0x9331(%rip), %rcx      # 0x139e6
movl $0x1eac, %edx           # imm = 0x1EAC
callq 0x10b0
leaq 0x93ae(%rip), %rdi      # 0x13a74
leaq 0x8baf(%rip), %rsi      # 0x1327c
leaq 0x9312(%rip), %rcx      # 0x139e6
movl $0x1ebe, %edx           # imm = 0x1EBE
callq 0x10b0
leaq 0x939b(%rip), %rdi      # 0x13a80
leaq 0x8b90(%rip), %rsi      # 0x1327c
leaq 0x92f3(%rip), %rcx      # 0x139e6
movl $0x1ebf, %edx           # imm = 0x1EBF
callq 0x10b0