// File: /workspace/github_cpp_makefile_star2_O1/biotomas[P]ipasir/sat/picosat961/picosat-961/picosat.c
// Function: init
static PS *
init (void * pmgr, 
      picosat_malloc pnew, picosat_realloc presize, picosat_free pdelete)
{
  PS * ps;

#if 0
  int count = 3 - !pnew - !presize - !pdelete;

  ABORTIF (count && !pnew, "API usage: missing 'picosat_set_new'");
  ABORTIF (count && !presize, "API usage: missing 'picosat_set_resize'");
  ABORTIF (count && !pdelete, "API usage: missing 'picosat_set_delete'");
#endif

  ps = pnew ? pnew (pmgr, sizeof *ps) : malloc (sizeof *ps);
  ABORTIF (!ps, "failed to allocate memory for PicoSAT manager");
  memset (ps, 0, sizeof *ps);

  ps->emgr = pmgr;
  ps->enew = pnew;
  ps->eresize = presize;
  ps->edelete = pdelete;

  ps->size_vars = 1;
  ps->state = RESET;
  ps->defaultphase = JWLPHASE;
#ifdef TRACE
  ps->ocore = -1;
#endif
  ps->lastrheader = -2;
#ifndef NADC
  ps->adoconflictlimit = UINT_MAX;
#endif
  ps->min_flipped = UINT_MAX;

  NEWN (ps->lits, 2 * ps->size_vars);
  NEWN (ps->jwh, 2 * ps->size_vars);
  NEWN (ps->htps, 2 * ps->size_vars);
#ifndef NDSC
  NEWN (ps->dhtps, 2 * ps->size_vars);
#endif
  NEWN (ps->impls, 2 * ps->size_vars);
  NEWN (ps->vars, ps->size_vars);
  NEWN (ps->rnks, ps->size_vars);

  /* because '0' pos denotes not on heap
   */
  ENLARGE (ps->heap, ps->hhead, ps->eoh); 
  ps->hhead = ps->heap + 1;

  ps->vinc = base2flt (1, 0);		/* initial var activity */
  ps->ifvinc = ascii2flt ("1.05");	/* var score rescore factor */
#ifdef VISCORES
  ps->fvinc = ascii2flt ("0.9523809");	/*     1/f =     1/1.05 */
  ps->nvinc = ascii2flt ("0.0476191");	/* 1 - 1/f = 1 - 1/1.05 */
#endif
  ps->lscore = base2flt (1, 90);	/* var activity rescore limit */
  ps->ilvinc = base2flt (1, -90);	/* inverse of 'lscore' */

  ps->cinc = base2flt (1, 0);		/* initial clause activity */
  ps->fcinc = ascii2flt ("1.001");	/* cls activity rescore factor */
  ps->lcinc = base2flt (1, 90);		/* cls activity rescore limit */
  ps->ilcinc = base2flt (1, -90);	/* inverse of 'ilcinc' */

  ps->lreduceadjustcnt = ps->lreduceadjustinc = 100;
  ps->lpropagations = ~0ull;

  ps->out = stdout;
  new_prefix (ps, "c ");
  ps->verbosity = 0;
  ps->plain = 0;

#ifdef NO_BINARY_CLAUSES
  memset (&ps->impl, 0, sizeof (ps->impl));
  ps->impl.size = 2;

  memset (&ps->cimpl, 0, sizeof (ps->impl));
  ps->cimpl.size = 2;
#endif

#ifdef VISCORES
  ps->fviscores = popen (
    "/usr/bin/gnuplot -background black"
    " -xrm 'gnuplot*textColor:white'"
    " -xrm 'gnuplot*borderColor:white'"
    " -xrm 'gnuplot*axisColor:white'"
    , "w");
  fprintf (ps->fviscores, "unset key\n");
  // fprintf (ps->fviscores, "set log y\n");
  fflush (ps->fviscores);
  system ("rm -rf /tmp/picosat-viscores");
  system ("mkdir /tmp/picosat-viscores");
  system ("mkdir /tmp/picosat-viscores/data");
#ifdef WRITEGIF
  system ("mkdir /tmp/picosat-viscores/gif");
  fprintf (ps->fviscores,
           "set terminal gif giant animate opt size 1024,768 x000000 xffffff"
	   "\n");

  fprintf (ps->fviscores, 
           "set output \"/tmp/picosat-viscores/gif/animated.gif\"\n");
#endif
#endif
  ps->defaultphase = JWLPHASE;
  ps->state = READY;
  ps->last_sat_call_result = 0;

  return ps;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
testq %rsi, %rsi
je 0x3ab4
movl $0x4d0, %esi            # imm = 0x4D0
movq %r13, %rdi
callq *%r12
jmp 0x3abe
movl $0x4d0, %edi            # imm = 0x4D0
callq 0x1150
movq %rax, %rbx
testq %rax, %rax
je 0x3d38
movl $0x4d0, %edx            # imm = 0x4D0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10d0
movq %r13, 0x4a0(%rbx)
movq %r12, 0x4a8(%rbx)
movq %r15, 0x4b0(%rbx)
movq %r14, 0x4b8(%rbx)
movl $0x1, 0x30(%rbx)
movabsq $0x200000000, %rax      # imm = 0x200000000
movq %rax, (%rbx)
movl $0xfffffffe, 0x388(%rbx) # imm = 0xFFFFFFFE
movl $0xffffffff, 0x49c(%rbx) # imm = 0xFFFFFFFF
movl $0x2, %esi
movq %rbx, %rdi
callq 0x9bf6
movq %rax, 0x38(%rbx)
movl 0x30(%rbx), %esi
addl %esi, %esi
shlq $0x2, %rsi
movq %rbx, %rdi
callq 0x9bf6
movq %rax, 0x50(%rbx)
movl 0x30(%rbx), %esi
addl %esi, %esi
shlq $0x3, %rsi
movq %rbx, %rdi
callq 0x9bf6
movq %rax, 0x58(%rbx)
movl 0x30(%rbx), %esi
addl %esi, %esi
shlq $0x3, %rsi
movq %rbx, %rdi
callq 0x9bf6
movq %rax, 0x60(%rbx)
movl 0x30(%rbx), %esi
addl %esi, %esi
shlq $0x4, %rsi
movq %rbx, %rdi
callq 0x9bf6
movq %rax, 0x68(%rbx)
movl 0x30(%rbx), %esi
shlq $0x4, %rsi
movq %rbx, %rdi
callq 0x9bf6
movq %rax, 0x40(%rbx)
movl 0x30(%rbx), %esi
shlq $0x3, %rsi
movq %rbx, %rdi
callq 0x9bf6
movq %rax, 0x48(%rbx)
movq 0x1c8(%rbx), %rsi
movq 0x1d8(%rbx), %rax
cmpq %rax, %rsi
ja 0x3d3d
subq %rsi, %rax
movq %rax, %rcx
shrq $0x2, %rcx
movabsq $0x7fffffff8, %rdx      # imm = 0x7FFFFFFF8
andq %rax, %rdx
movl %ecx, %eax
movl $0x1, %r14d
cmovneq %rax, %r14
leaq (,%r14,8), %rcx
movq %rbx, %rdi
callq 0x4593
movq %rax, 0x1c8(%rbx)
leaq (%rax,%r14,8), %rcx
movq %rcx, 0x1d8(%rbx)
addq $0x8, %rax
movq %rax, 0x1d0(%rbx)
xorl %r14d, %r14d
xorl %edi, %edi
movl $0xffffffe8, %esi       # imm = 0xFFFFFFE8
callq 0xc48e
movl %eax, 0x300(%rbx)
leaq 0xf3c6(%rip), %rdi      # 0x12ff1
callq 0xc311
movl %eax, 0x30c(%rbx)
xorl %edi, %edi
movl $0x42, %esi
callq 0xc48e
movl %eax, 0x304(%rbx)
xorl %edi, %edi
movl $0xffffff8e, %esi       # imm = 0xFFFFFF8E
callq 0xc48e
movl %eax, 0x308(%rbx)
xorl %edi, %edi
movl $0xffffffe8, %esi       # imm = 0xFFFFFFE8
callq 0xc48e
movl %eax, 0x310(%rbx)
leaq 0xf383(%rip), %rdi      # 0x12ff6
callq 0xc311
movl %eax, 0x31c(%rbx)
xorl %edi, %edi
movl $0x42, %esi
callq 0xc48e
movl %eax, 0x314(%rbx)
xorl %edi, %edi
movl $0xffffff8e, %esi       # imm = 0xFFFFFF8E
callq 0xc48e
movl %eax, 0x318(%rbx)
movabsq $0x6400000064, %rax     # imm = 0x6400000064
movq %rax, 0x3ac(%rbx)
movq $-0x1, 0x3e0(%rbx)
movq 0x1530b(%rip), %rax     # 0x18fd0
movq (%rax), %rax
movq %rax, 0x10(%rbx)
leaq 0x10876(%rip), %rsi     # 0x14549
movq %rbx, %rdi
callq 0x67b1
movq %r14, 0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%rbx)
movups %xmm0, 0x80(%rbx)
movq %r14, 0x90(%rbx)
movl $0x2, %eax
movl %eax, 0x70(%rbx)
movups %xmm0, 0x98(%rbx)
movups %xmm0, 0xa8(%rbx)
movq %r14, 0xb8(%rbx)
movl %eax, 0x98(%rbx)
movabsq $0x200000001, %rax      # imm = 0x200000001
movq %rax, (%rbx)
movl $0x0, 0x8(%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x1230
leaq 0xf255(%rip), %rdi      # 0x12f99
leaq 0xe561(%rip), %rsi      # 0x122ac
leaq 0xf25f(%rip), %rcx      # 0x12fb1
movl $0x4b2, %edx            # imm = 0x4B2
callq 0x10b0