// File: biotomas[P]ipasir/sat/picosat961/picosat-961/picosat.c
// Function: picosat_pop
int 
picosat_pop (PS * ps)
{
  Lit * lit;
  int res;
  ABORTIF (ps->CLS == ps->clshead, "API usage: too many 'picosat_pop'");
  ABORTIF (ps->added != ps->ahead, "API usage: incomplete clause");

  if (ps->measurealltimeinlib)
    enter (ps);
  else
    check_ready (ps);

  if (ps->state != READY)
    reset_incremental_usage (ps);

  assert (ps->CLS < ps->clshead);
  lit = *--ps->clshead;
  LOG ( fprintf (ps->out, "%sclosing context %d at depth %ld after pop\n",
                 ps->prefix, LIT2INT (lit), (long)(ps->clshead - ps->CLS) + 1));

  if (ps->cilshead == ps->eocils)
    ENLARGE (ps->cils, ps->cilshead, ps->eocils);
  *ps->cilshead++ = LIT2INT (lit);

  if (ps->cilshead - ps->cils > MAXCILS) {
    LOG ( fprintf (ps->out,
                  "%srecycling %ld interals with forced simplification\n",
		  ps->prefix, (long)(ps->cilshead - ps->cils)));
    simplify (ps, 1);
  }

  res = picosat_context (ps);
  if (res)
    LOG ( fprintf (ps->out, "%snew context %d at depth %ld after pop\n",
		   ps->prefix, res, (long)(ps->clshead - ps->CLS)));
  else
    LOG ( fprintf (ps->out, "%souter most context reached after pop\n", ps->prefix));

  if (ps->measurealltimeinlib)
    leave (ps);
  
  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x118(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x120(%rcx), %rax
je 0x5196
jmp 0x51b3
jmp 0x5198
movq 0x1ee59(%rip), %rax     # 0x23ff8
movq (%rax), %rsi
leaq 0x18142(%rip), %rdi     # 0x1d2eb
callq 0x10c0
callq 0x1060
jmp 0x51b5
movq -0x8(%rbp), %rax
movq 0x258(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x260(%rcx), %rax
jne 0x51cf
jmp 0x51ec
jmp 0x51d1
movq 0x1ee20(%rip), %rax     # 0x23ff8
movq (%rax), %rsi
leaq 0x18139(%rip), %rdi     # 0x1d31b
callq 0x10c0
callq 0x1060
movq -0x8(%rbp), %rax
cmpl $0x0, 0x35c(%rax)
je 0x5204
movq -0x8(%rbp), %rdi
callq 0x43a0
jmp 0x520d
movq -0x8(%rbp), %rdi
callq 0x49e0
movq -0x8(%rbp), %rax
cmpl $0x1, (%rax)
je 0x521f
movq -0x8(%rbp), %rdi
callq 0x4db0
movq -0x8(%rbp), %rax
movq 0x118(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x120(%rcx), %rax
jae 0x5239
jmp 0x5258
leaq 0x18106(%rip), %rdi     # 0x1d346
leaq 0x1805d(%rip), %rsi     # 0x1d2a4
movl $0x1a39, %edx           # imm = 0x1A39
leaq 0x18109(%rip), %rcx     # 0x1d35c
callq 0x10b0
movq -0x8(%rbp), %rcx
movq 0x120(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x120(%rcx)
movq -0x8(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x527b
movq -0x8(%rbp), %rax
movq 0x150(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x158(%rcx), %rax
jne 0x53bb
jmp 0x5299
movq -0x8(%rbp), %rax
movq 0x158(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x148(%rcx), %rcx
subq %rcx, %rax
sarq $0x2, %rax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x52c9
movl -0x18(%rbp), %eax
shll %eax
movl %eax, -0x3c(%rbp)
jmp 0x52d3
movl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x52d3
movl -0x3c(%rbp), %eax
movl %eax, %eax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x150(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x148(%rcx), %rcx
subq %rcx, %rax
sarq $0x2, %rax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movq 0x148(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x158(%rcx), %rax
ja 0x5316
jmp 0x5335
leaq 0x18055(%rip), %rdi     # 0x1d372
leaq 0x17f80(%rip), %rsi     # 0x1d2a4
movl $0x1a3f, %edx           # imm = 0x1A3F
leaq 0x1802c(%rip), %rcx     # 0x1d35c
callq 0x10b0
jmp 0x5337
movl -0x18(%rbp), %eax
shlq $0x2, %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
shlq $0x2, %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x148(%rax), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0x4f30
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x148(%rax)
movq -0x8(%rbp), %rax
movq 0x148(%rax), %rcx
movl -0x24(%rbp), %eax
shlq $0x2, %rax
addq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x150(%rax)
movq -0x8(%rbp), %rax
movq 0x148(%rax), %rcx
movq -0x20(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x158(%rax)
jmp 0x53bb
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x38(%rcx), %rcx
subq %rcx, %rax
movl %eax, %edx
andl $0x1, %edx
movl $0x1, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x0, %edx
cmovnel %eax, %ecx
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
movq 0x38(%rdx), %rdx
subq %rdx, %rax
shrl %eax
imull %eax, %ecx
movq -0x8(%rbp), %rdx
movq 0x150(%rdx), %rax
movq %rax, %rsi
addq $0x4, %rsi
movq %rsi, 0x150(%rdx)
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movq 0x150(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x148(%rcx), %rcx
subq %rcx, %rax
sarq $0x2, %rax
cmpq $0xa, %rax
jle 0x5443
jmp 0x5433
jmp 0x5435
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x5480
movq -0x8(%rbp), %rdi
callq 0x4a30
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x545b
jmp 0x5457
jmp 0x5459
jmp 0x5461
jmp 0x545d
jmp 0x545f
jmp 0x5461
movq -0x8(%rbp), %rax
cmpl $0x0, 0x35c(%rax)
je 0x5477
movq -0x8(%rbp), %rdi
callq 0x4910
movl -0x14(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq