// File: /workspace/github_c_makefile_star2_O1/reactive-systems[P]aiger-ltl-model-checker/aiger.c
// Function: aiger_reencode_lit
static unsigned
aiger_reencode_lit (aiger * public, unsigned lit,
		    unsigned *new, unsigned *code,
		    unsigned **stack_ptr, unsigned * size_stack_ptr)
{
  unsigned res, old, top, child0, child1, tmp, var, size_stack, * stack;
  IMPORT_private_FROM (public);
  aiger_type *type;
  aiger_and *and;

  if (lit < 2)
    return lit;

  res = code[lit];
  if (res)
    return res;

  var = aiger_lit2var (lit);
  assert (var <= public->maxvar);
  type = private->types + var;

  if (type->and)
    {
      top = 0;
      stack = *stack_ptr;
      size_stack = *size_stack_ptr;
      PUSH (stack, top, size_stack, var);

      while (top > 0)
	{
	  old = stack[--top];
	  if (old)
	    {
	      if (code[aiger_var2lit (old)])
		continue;

	      assert (old <= public->maxvar);
	      type = private->types + old;
	      if (type->onstack)
		continue;

	      type->onstack = 1;

	      PUSH (stack, top, size_stack, old);
	      PUSH (stack, top, size_stack, 0);

	      assert (type->and);
	      assert (type->idx < public->num_ands);

	      and = public->ands + type->idx;
	      assert (and);

	      child0 = aiger_lit2var (and->rhs0);
	      child1 = aiger_lit2var (and->rhs1);

	      if (child0 < child1)
		{
		  tmp = child0;
		  child0 = child1;
		  child1 = tmp;
		}

	      assert (child0 >= child1);	/* smaller child first */

	      if (child0)
		{
		  type = private->types + child0;
		  if (!type->input && !type->latch && !type->onstack)
		    PUSH (stack, top, size_stack, child0);
		}

	      if (child1)
		{
		  type = private->types + child1;
		  if (!type->input && !type->latch && !type->onstack)
		    PUSH (stack, top, size_stack, child1);
		}
	    }
	  else
	    {
	      assert (top > 0);
	      old = stack[--top];
	      assert (!code[aiger_var2lit (old)]);
	      type = private->types + old;
	      assert (type->onstack);
	      type->onstack = 0;
	      aiger_new_code (old, new, code);
	    }
	}
      *size_stack_ptr = size_stack;
      *stack_ptr = stack;
    }
  else
    {
      assert (type->input || type->latch);
      assert (lit < *new);

      code[lit] = lit;
      code[aiger_not (lit)] = aiger_not (lit);
    }

  assert (code[lit]);

  return code[lit];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
cmpl $0x2, %esi
jae 0x429f
movl %esi, %eax
jmp 0x47d4
movq %rcx, %rbx
movq %rdi, %r11
movl %esi, %edi
movl (%rcx,%rdi,4), %eax
testl %eax, %eax
jne 0x47d4
movl %esi, %r14d
shrl %r14d
cmpl (%r11), %r14d
ja 0x4802
movq 0x70(%r11), %rax
movl %r14d, %ecx
movb (%rax,%rcx,8), %al
testb $0x4, %al
jne 0x42ed
testb $0x3, %al
je 0x4840
cmpl %esi, (%rdx)
jbe 0x485f
movl %esi, (%rbx,%rdi,4)
xorl $0x1, %esi
movl %esi, (%rbx,%rsi,4)
jmp 0x47cd
movq (%r8), %r10
movl (%r9), %esi
testl %esi, %esi
jne 0x4357
movq %rdi, -0x70(%rbp)
movq 0xb8(%r11), %rdi
movl $0x4, %esi
movq %r8, -0x68(%rbp)
movq %r9, -0x60(%rbp)
movq %rdx, -0x58(%rbp)
movq %r11, %r13
movq %r10, %r12
callq *0xc0(%r11)
movq %rax, %r15
movl $0x0, (%rax)
movq 0xb8(%r13), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq *0xc8(%r13)
movq %r13, %r11
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %r9
movq -0x68(%rbp), %r8
movq -0x70(%rbp), %rdi
movl $0x1, %esi
movq %r15, %r10
movl %r14d, (%r10)
movl $0x1, %r12d
addl $-0x2, %r12d
leal 0x1(%r12), %r13d
movl (%r10,%r13,4), %r15d
testq %r15, %r15
je 0x439f
leal (%r15,%r15), %eax
cmpl $0x0, (%rbx,%rax,4)
jne 0x4391
cmpl (%r11), %r15d
ja 0x47e3
movq 0x70(%r11), %r14
movb (%r14,%r15,8), %al
testb $0x10, %al
je 0x4400
decl %r12d
cmpl $-0x2, %r12d
jne 0x4364
jmp 0x47c7
cmpl $-0x1, %r12d
je 0x48bc
movl %r12d, %eax
movl (%r10,%rax,4), %ecx
leal (%rcx,%rcx), %eax
cmpl $0x0, (%rbx,%rax,4)
jne 0x487e
movl %esi, %r15d
movq %r10, %r14
movq 0x70(%r11), %r10
movb (%r10,%rcx,8), %sil
testb $0x10, %sil
je 0x48db
andb $-0x11, %sil
movb %sil, (%r10,%rcx,8)
cmpl $0x0, (%rbx,%rax,4)
jne 0x489d
movl (%rdx), %ecx
movl %ecx, (%rbx,%rax,4)
incl %ecx
movl %ecx, 0x4(%rbx,%rax,4)
addl $0x2, (%rdx)
movq %r14, %r10
movl %r15d, %esi
jmp 0x47be
orb $0x10, %al
movb %al, (%r14,%r15,8)
movl %r12d, %eax
subl %esi, %eax
cmpl $-0x1, %eax
movq %rdi, -0x70(%rbp)
movq %r8, -0x68(%rbp)
movq %r9, -0x60(%rbp)
movq %rdx, -0x58(%rbp)
movq %r11, -0x50(%rbp)
jne 0x44d7
movl %esi, %edx
leaq (%rdx,%rdx), %rcx
testl %esi, %esi
movl $0x1, %eax
cmoveq %rax, %rcx
shlq $0x2, %rdx
movq %rdx, -0x40(%rbp)
movq %rcx, -0x48(%rbp)
leaq (,%rcx,4), %rsi
movq %rsi, -0x78(%rbp)
cmpq %rsi, %rdx
movq %rsi, %rax
cmovbq %rdx, %rax
movq %rax, -0x80(%rbp)
movq 0xb8(%r11), %rdi
movq %r10, -0x38(%rbp)
callq *0xc0(%r11)
movq %rax, -0x30(%rbp)
movq %rax, %rdi
movq -0x38(%rbp), %rsi
movq -0x80(%rbp), %rdx
callq 0x1140
movq -0x78(%rbp), %rcx
movq -0x40(%rbp), %rdx
subq %rdx, %rcx
jbe 0x44a8
movq -0x30(%rbp), %rax
leaq (%rax,%rdx), %rdi
xorl %esi, %esi
movq %rcx, %rdx
callq 0x1100
movq -0x40(%rbp), %rdx
movq -0x50(%rbp), %rax
movq 0xb8(%rax), %rdi
movq -0x38(%rbp), %rsi
callq *0xc8(%rax)
movq -0x30(%rbp), %r10
movq -0x48(%rbp), %rax
movl %eax, %esi
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %r8
movq -0x60(%rbp), %r9
movq -0x58(%rbp), %rdx
movl %r12d, %eax
subl %esi, %eax
movl %r15d, (%r10,%r13,4)
cmpl $-0x2, %eax
movl %esi, -0x30(%rbp)
jne 0x458b
movl %esi, %esi
leaq (,%rsi,4), %rax
movq %rax, -0x80(%rbp)
shlq $0x3, %rsi
movq %rsi, -0x78(%rbp)
cmpq %rsi, %rax
movq %rsi, %rcx
cmovbq %rax, %rcx
movq %rcx, -0x48(%rbp)
movq -0x50(%rbp), %rax
movq 0xb8(%rax), %rdi
movq %r10, %r13
callq *0xc0(%rax)
movq %rax, -0x40(%rbp)
movq %rax, %rdi
movq %r13, -0x38(%rbp)
movq %r13, %rsi
movq -0x80(%rbp), %r13
movq -0x48(%rbp), %rdx
callq 0x1140
cmpq -0x78(%rbp), %r13
jae 0x4557
movq -0x40(%rbp), %rax
leaq (%rax,%r13), %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x1100
movl -0x30(%rbp), %eax
addl %eax, %eax
movl %eax, -0x30(%rbp)
movq -0x50(%rbp), %rax
movq 0xb8(%rax), %rdi
movq -0x38(%rbp), %rsi
movq %r13, %rdx
callq *0xc8(%rax)
movq -0x40(%rbp), %r10
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %r8
movq -0x60(%rbp), %r9
movq -0x58(%rbp), %rdx
leal 0x2(%r12), %eax
movl %eax, %eax
movl $0x0, (%r10,%rax,4)
testb $0x4, (%r14,%r15,8)
je 0x4938
movl 0x4(%r14,%r15,8), %eax
movq -0x50(%rbp), %r11
cmpl 0x10(%r11), %eax
jae 0x48fa
movq 0x60(%r11), %rcx
testq %rcx, %rcx
je 0x4919
leal 0x3(%r12), %r13d
leaq (%rax,%rax,2), %rax
movl 0x4(%rcx,%rax,4), %esi
movl 0x8(%rcx,%rax,4), %r14d
shrl %esi
shrl %r14d
cmpl %r14d, %esi
movl %r14d, %r15d
cmovbl %esi, %r15d
cmoval %esi, %r14d
testl %r14d, %r14d
je 0x46e2
movq 0x70(%r11), %rax
movl %r14d, %ecx
testb $0x13, (%rax,%rcx,8)
movl -0x30(%rbp), %esi
jne 0x46e5
movl %r12d, %eax
subl %esi, %eax
cmpl $-0x3, %eax
jne 0x46d2
movl %r13d, -0x40(%rbp)
movl %esi, %r13d
leaq (,%r13,2), %rcx
testl %esi, %esi
movl $0x1, %eax
cmoveq %rax, %rcx
shlq $0x2, %r13
movq %rcx, -0x48(%rbp)
leaq (,%rcx,4), %rsi
movq %rsi, -0x78(%rbp)
cmpq %rsi, %r13
movq %rsi, %rax
cmovbq %r13, %rax
movq %rax, -0x80(%rbp)
movq 0xb8(%r11), %rdi
movq %r10, -0x38(%rbp)
callq *0xc0(%r11)
movq %rax, -0x30(%rbp)
movq %rax, %rdi
movq -0x38(%rbp), %rsi
movq -0x80(%rbp), %rdx
callq 0x1140
movq -0x78(%rbp), %rcx
movq %r13, %rdx
subq %r13, %rcx
jbe 0x469b
movq -0x30(%rbp), %rax
leaq (%rax,%rdx), %rdi
xorl %esi, %esi
movq %rdx, %r13
movq %rcx, %rdx
callq 0x1100
movq %r13, %rdx
movq -0x50(%rbp), %r13
movq 0xb8(%r13), %rdi
movq -0x38(%rbp), %rsi
callq *0xc8(%r13)
movq %r13, %r11
movq -0x30(%rbp), %r10
movq -0x48(%rbp), %rax
movl %eax, %esi
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %r8
movq -0x60(%rbp), %r9
movq -0x58(%rbp), %rdx
movl -0x40(%rbp), %r13d
addl $0x4, %r12d
movl %r13d, %eax
movl %r14d, (%r10,%rax,4)
movl %r12d, %r13d
jmp 0x46e5
movl -0x30(%rbp), %esi
testl %r15d, %r15d
je 0x47bb
movq 0x70(%r11), %rax
movl %r15d, %ecx
testb $0x13, (%rax,%rcx,8)
jne 0x47bb
cmpl %esi, %r13d
jne 0x47b1
movl %r13d, -0x40(%rbp)
movl %esi, %r12d
leaq (%r12,%r12), %rcx
testl %esi, %esi
movl $0x1, %eax
cmoveq %rax, %rcx
shlq $0x2, %r12
movq %rcx, -0x48(%rbp)
leaq (,%rcx,4), %r14
cmpq %r14, %r12
movq %r14, %r13
cmovbq %r12, %r13
movq 0xb8(%r11), %rdi
movq %r14, %rsi
movq %r10, -0x38(%rbp)
callq *0xc0(%r11)
movq %rax, -0x30(%rbp)
movq %rax, %rdi
movq -0x38(%rbp), %rsi
movq %r13, %rdx
callq 0x1140
subq %r12, %r14
jbe 0x4777
movq -0x30(%rbp), %rax
leaq (%rax,%r12), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1100
movq -0x50(%rbp), %r13
movq 0xb8(%r13), %rdi
movq -0x38(%rbp), %rsi
movq %r12, %rdx
callq *0xc8(%r13)
movq %r13, %r11
movq -0x30(%rbp), %r10
movq -0x48(%rbp), %rax
movl %eax, %esi
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %r8
movq -0x60(%rbp), %r9
movq -0x58(%rbp), %rdx
movl -0x40(%rbp), %r13d
movl %r13d, %eax
incl %r13d
movl %r15d, (%r10,%rax,4)
movl %r13d, %r12d
testl %r12d, %r12d
jne 0x4360
movl %esi, (%r9)
movq %r10, (%r8)
movl (%rbx,%rdi,4), %eax
testl %eax, %eax
je 0x4821
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x460e(%rip), %rdi      # 0x8df8
leaq 0x3b02(%rip), %rsi      # 0x82f3
leaq 0x4588(%rip), %rcx      # 0x8d80
movl $0x578, %edx            # imm = 0x578
callq 0x10f0
leaq 0x4118(%rip), %rdi      # 0x8921
leaq 0x3ae3(%rip), %rsi      # 0x82f3
leaq 0x4569(%rip), %rcx      # 0x8d80
movl $0x566, %edx            # imm = 0x566
callq 0x10f0
leaq 0x4630(%rip), %rdi      # 0x8e58
leaq 0x3ac4(%rip), %rsi      # 0x82f3
leaq 0x454a(%rip), %rcx      # 0x8d80
movl $0x5b9, %edx            # imm = 0x5B9
callq 0x10f0
leaq 0x45ea(%rip), %rdi      # 0x8e31
leaq 0x3aa5(%rip), %rsi      # 0x82f3
leaq 0x452b(%rip), %rcx      # 0x8d80
movl $0x5b2, %edx            # imm = 0x5B2
callq 0x10f0
leaq 0x45e6(%rip), %rdi      # 0x8e4c
leaq 0x3a86(%rip), %rsi      # 0x82f3
leaq 0x450c(%rip), %rcx      # 0x8d80
movl $0x5b3, %edx            # imm = 0x5B3
callq 0x10f0
leaq 0x4591(%rip), %rdi      # 0x8e16
leaq 0x3a67(%rip), %rsi      # 0x82f3
leaq 0x44ed(%rip), %rcx      # 0x8d80
movl $0x5a6, %edx            # imm = 0x5A6
callq 0x10f0
leaq 0x45b3(%rip), %rdi      # 0x8e57
leaq 0x3a48(%rip), %rsi      # 0x82f3
leaq 0x45b0(%rip), %rcx      # 0x8e62
movl $0x54d, %edx            # imm = 0x54D
callq 0x10f0
leaq 0x454b(%rip), %rdi      # 0x8e0e
leaq 0x3a29(%rip), %rsi      # 0x82f3
leaq 0x44af(%rip), %rcx      # 0x8d80
movl $0x5a4, %edx            # imm = 0x5A4
callq 0x10f0
leaq 0x43d2(%rip), %rdi      # 0x8cb4
leaq 0x3a0a(%rip), %rsi      # 0x82f3
leaq 0x4490(%rip), %rcx      # 0x8d80
movl $0x5a8, %edx            # imm = 0x5A8
callq 0x10f0
leaq 0x434d(%rip), %rdi      # 0x8c4e
leaq 0x39eb(%rip), %rsi      # 0x82f3
leaq 0x4471(%rip), %rcx      # 0x8d80
movl $0x583, %edx            # imm = 0x583
callq 0x10f0
leaq 0x3aa4(%rip), %rdi      # 0x83c4
leaq 0x39cc(%rip), %rsi      # 0x82f3
leaq 0x4452(%rip), %rcx      # 0x8d80
movl $0x586, %edx            # imm = 0x586
callq 0x10f0
leaq 0x3a7f(%rip), %rdi      # 0x83be
leaq 0x39ad(%rip), %rsi      # 0x82f3
leaq 0x4433(%rip), %rcx      # 0x8d80
movl $0x582, %edx            # imm = 0x582
callq 0x10f0