// File: /workspace/github_c_makefile_star2_O3/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 $0x68, %rsp
cmpl $0x2, %esi
jae 0x41c8
movl %esi, %eax
jmp 0x46ef
movq %rcx, %r10
movl %esi, %r14d
movl (%rcx,%r14,4), %eax
testl %eax, %eax
jne 0x46ef
movl %esi, %ebx
shrl %ebx
cmpl (%rdi), %ebx
ja 0x471d
movq 0x70(%rdi), %rax
movl %ebx, %ecx
movb (%rax,%rcx,8), %al
testb $0x4, %al
jne 0x4212
testb $0x3, %al
je 0x473c
cmpl %esi, (%rdx)
jbe 0x475b
movl %esi, (%r10,%r14,4)
movl %esi, %eax
xorl $0x1, %eax
movl %eax, (%r10,%rax,4)
jmp 0x41c1
movq %rdx, -0x80(%rbp)
movq (%r8), %r11
movl (%r9), %eax
testl %eax, %eax
movq %rdi, -0x30(%rbp)
movq %r14, -0x88(%rbp)
jne 0x428b
movq -0x30(%rbp), %rax
movq 0xb8(%rax), %rdi
movq %r11, %r12
movl $0x4, %esi
movq %r10, -0x50(%rbp)
movq %r8, %r13
movq %r9, %r14
movq -0x30(%rbp), %rax
callq *0xc0(%rax)
movq %rax, %r15
movl $0x0, (%rax)
movq -0x30(%rbp), %rax
movq 0xb8(%rax), %rdi
movq %r12, %rsi
xorl %edx, %edx
movq -0x30(%rbp), %rax
callq *0xc8(%rax)
movq -0x30(%rbp), %rdi
movq %r14, %r9
movq %r13, %r8
movq -0x50(%rbp), %r10
movl $0x1, %eax
movq %r15, %r11
movl %ebx, (%r11)
movl $0x1, %r15d
leal -0x2(%r15), %ecx
addl %r15d, %r15d
movl %r15d, %r12d
movl %ecx, %r15d
leal 0x1(%r15), %ebx
movl (%r11,%rbx,4), %r14d
testq %r14, %r14
je 0x42e2
leal (%r14,%r14), %ecx
cmpl $0x0, (%r10,%rcx,4)
jne 0x42d0
cmpl (%rdi), %r14d
ja 0x46fe
movq 0x70(%rdi), %r13
movb (%r13,%r14,8), %cl
testb $0x10, %cl
je 0x4343
decl %r15d
addl $-0x2, %r12d
cmpl $-0x2, %r15d
jne 0x42a1
jmp 0x46d6
cmpl $-0x1, %r15d
je 0x47b8
movl %r15d, %ecx
movl (%r11,%rcx,4), %edx
leal (%rdx,%rdx), %ecx
cmpl $0x0, (%r10,%rcx,4)
jne 0x477a
movq 0x70(%rdi), %rsi
movb (%rsi,%rdx,8), %dil
testb $0x10, %dil
je 0x47d7
andb $-0x11, %dil
movb %dil, (%rsi,%rdx,8)
cmpl $0x0, (%r10,%rcx,4)
jne 0x4799
movq -0x80(%rbp), %rsi
movl (%rsi), %edx
movl %edx, (%r10,%rcx,4)
incl %edx
movl %edx, 0x4(%r10,%rcx,4)
addl $0x2, (%rsi)
movq -0x30(%rbp), %rdi
jmp 0x46cd
orb $0x10, %cl
movb %cl, (%r13,%r14,8)
movl %r15d, %ecx
subl %eax, %ecx
cmpl $-0x1, %ecx
movq %r10, -0x50(%rbp)
movq %r8, -0x60(%rbp)
movq %r9, -0x58(%rbp)
jne 0x4410
movl %eax, %edx
leaq (%rdx,%rdx), %rcx
testl %eax, %eax
movl $0x1, %eax
cmoveq %rax, %rcx
shlq $0x2, %rdx
movq %rdx, -0x40(%rbp)
movq %rcx, -0x70(%rbp)
leaq (,%rcx,4), %rsi
movq %rsi, -0x78(%rbp)
cmpq %rsi, %rdx
movq %rsi, %rax
cmovbq %rdx, %rax
movq %rax, -0x68(%rbp)
movq %rdi, %rax
movq 0xb8(%rdi), %rdi
movq %r11, -0x38(%rbp)
callq *0xc0(%rax)
movq %rax, -0x48(%rbp)
movq %rax, %rdi
movq -0x38(%rbp), %rsi
movq -0x68(%rbp), %rdx
callq 0x1150
movq -0x78(%rbp), %rcx
movq -0x40(%rbp), %rdx
subq %rdx, %rcx
jbe 0x43e7
movq -0x48(%rbp), %rax
leaq (%rax,%rdx), %rdi
xorl %esi, %esi
movq %rcx, %rdx
callq 0x1100
movq -0x40(%rbp), %rdx
movq -0x30(%rbp), %rax
movq 0xb8(%rax), %rdi
movq -0x38(%rbp), %rsi
callq *0xc8(%rax)
movq -0x48(%rbp), %r11
movq -0x70(%rbp), %rax
movq -0x50(%rbp), %r10
movq -0x60(%rbp), %r8
movq -0x58(%rbp), %r9
leal 0x2(%r15), %ecx
movl %r15d, %edx
subl %eax, %edx
movl %r14d, (%r11,%rbx,4)
movl %ecx, %ecx
cmpl $-0x2, %edx
jne 0x44a8
leaq (,%rcx,4), %rbx
movq %r11, -0x38(%rbp)
leaq (,%rcx,8), %rsi
movq -0x30(%rbp), %rax
movq 0xb8(%rax), %rdi
movq %rcx, -0x48(%rbp)
callq *0xc0(%rax)
movq %rax, -0x40(%rbp)
movq %rax, %rdi
movq -0x38(%rbp), %rsi
movq %rbx, %rdx
callq 0x1150
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rcx
leaq (%rcx,%rax,4), %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x1100
movq -0x30(%rbp), %rax
movq 0xb8(%rax), %rdi
movq -0x38(%rbp), %rsi
movq %rbx, %rdx
callq *0xc8(%rax)
movq -0x48(%rbp), %rcx
movq -0x58(%rbp), %r9
movq -0x60(%rbp), %r8
movq -0x50(%rbp), %r10
movq -0x40(%rbp), %r11
jmp 0x44ab
movl %eax, %r12d
movl $0x0, (%r11,%rcx,4)
testb $0x4, (%r13,%r14,8)
je 0x4853
movl 0x4(%r13,%r14,8), %eax
movq -0x30(%rbp), %rdi
cmpl 0x10(%rdi), %eax
jae 0x4815
movq 0x60(%rdi), %rcx
testq %rcx, %rcx
je 0x4834
leal 0x3(%r15), %r14d
leaq (%rax,%rax,2), %rax
movl 0x4(%rcx,%rax,4), %edx
movl 0x8(%rcx,%rax,4), %ebx
shrl %edx
shrl %ebx
cmpl %ebx, %edx
movl %ebx, %r13d
cmovbl %edx, %r13d
cmoval %edx, %ebx
testl %ebx, %ebx
je 0x45f2
movq 0x70(%rdi), %rax
movl %ebx, %ecx
testb $0x13, (%rax,%rcx,8)
jne 0x45f2
movl %r15d, %eax
subl %r12d, %eax
cmpl $-0x3, %eax
jne 0x45e4
movl %r13d, -0x40(%rbp)
movl %r14d, -0x48(%rbp)
movl %r12d, %r13d
leaq (,%r13,2), %rcx
testl %r12d, %r12d
movl $0x1, %eax
cmoveq %rax, %rcx
shlq $0x2, %r13
movq %rcx, -0x70(%rbp)
leaq (,%rcx,4), %r12
cmpq %r12, %r13
movq %r12, %rax
cmovbq %r13, %rax
movq %rax, -0x68(%rbp)
movq %rdi, %rax
movq 0xb8(%rdi), %rdi
movq %r11, -0x38(%rbp)
movq %r12, %rsi
callq *0xc0(%rax)
movq %rax, %r14
movq %rax, %rdi
movq -0x38(%rbp), %rsi
movq -0x68(%rbp), %rdx
callq 0x1150
movq %r12, %rax
movq %r13, %rdx
subq %r13, %rax
jbe 0x45ab
leaq (%r14,%rdx), %rdi
xorl %esi, %esi
movq %rdx, %r12
movq %rax, %rdx
callq 0x1100
movq %r12, %rdx
movq -0x30(%rbp), %r12
movq 0xb8(%r12), %rdi
movq -0x38(%rbp), %rsi
callq *0xc8(%r12)
movq %r12, %rdi
movq %r14, %r11
movq -0x70(%rbp), %rax
movl %eax, %r12d
movq -0x50(%rbp), %r10
movq -0x60(%rbp), %r8
movq -0x58(%rbp), %r9
movl -0x48(%rbp), %r14d
movl -0x40(%rbp), %r13d
addl $0x4, %r15d
movl %r14d, %eax
movl %ebx, (%r11,%rax,4)
movl %r15d, %r14d
testl %r13d, %r13d
je 0x46c7
movq 0x70(%rdi), %rax
movl %r13d, %ecx
testb $0x13, (%rax,%rcx,8)
jne 0x46c7
cmpl %r12d, %r14d
jne 0x46bd
movl %r13d, -0x40(%rbp)
movl %r14d, -0x48(%rbp)
movl %r12d, %r14d
leaq (%r14,%r14), %rbx
testl %r12d, %r12d
movl $0x1, %eax
cmoveq %rax, %rbx
shlq $0x2, %r14
leaq (,%rbx,4), %r15
cmpq %r15, %r14
movq %r15, %r13
cmovbq %r14, %r13
movq %rdi, %rax
movq 0xb8(%rdi), %rdi
movq %r11, %r12
movq %r15, %rsi
callq *0xc0(%rax)
movq %rax, %rdi
movq %r12, -0x38(%rbp)
movq %r12, %rsi
movq %r14, %r12
movq %rax, %r14
movq %r13, %rdx
callq 0x1150
subq %r12, %r15
jbe 0x4687
leaq (%r14,%r12), %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1100
movq -0x30(%rbp), %r15
movq 0xb8(%r15), %rdi
movq -0x38(%rbp), %rsi
movq %r12, %rdx
callq *0xc8(%r15)
movq %r15, %rdi
movq %r14, %r11
movl %ebx, %r12d
movq -0x50(%rbp), %r10
movq -0x60(%rbp), %r8
movq -0x58(%rbp), %r9
movl -0x48(%rbp), %r14d
movl -0x40(%rbp), %r13d
movl %r14d, %eax
incl %r14d
movl %r13d, (%r11,%rax,4)
movl %r12d, %eax
movl %r14d, %r15d
testl %r15d, %r15d
jne 0x4294
movl %eax, (%r9)
movq %r11, (%r8)
movq -0x88(%rbp), %rax
movl (%r10,%rax,4), %eax
testl %eax, %eax
je 0x47f6
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x46f3(%rip), %rdi      # 0x8df8
leaq 0x3be7(%rip), %rsi      # 0x82f3
leaq 0x466d(%rip), %rcx      # 0x8d80
movl $0x578, %edx            # imm = 0x578
callq 0x10f0
leaq 0x41fd(%rip), %rdi      # 0x8921
leaq 0x3bc8(%rip), %rsi      # 0x82f3
leaq 0x464e(%rip), %rcx      # 0x8d80
movl $0x566, %edx            # imm = 0x566
callq 0x10f0
leaq 0x46ee(%rip), %rdi      # 0x8e31
leaq 0x3ba9(%rip), %rsi      # 0x82f3
leaq 0x462f(%rip), %rcx      # 0x8d80
movl $0x5b2, %edx            # imm = 0x5B2
callq 0x10f0
leaq 0x46ea(%rip), %rdi      # 0x8e4c
leaq 0x3b8a(%rip), %rsi      # 0x82f3
leaq 0x4610(%rip), %rcx      # 0x8d80
movl $0x5b3, %edx            # imm = 0x5B3
callq 0x10f0
leaq 0x4695(%rip), %rdi      # 0x8e16
leaq 0x3b6b(%rip), %rsi      # 0x82f3
leaq 0x45f1(%rip), %rcx      # 0x8d80
movl $0x5a6, %edx            # imm = 0x5A6
callq 0x10f0
leaq 0x46b7(%rip), %rdi      # 0x8e57
leaq 0x3b4c(%rip), %rsi      # 0x82f3
leaq 0x46b4(%rip), %rcx      # 0x8e62
movl $0x54d, %edx            # imm = 0x54D
callq 0x10f0
leaq 0x464f(%rip), %rdi      # 0x8e0e
leaq 0x3b2d(%rip), %rsi      # 0x82f3
leaq 0x45b3(%rip), %rcx      # 0x8d80
movl $0x5a4, %edx            # imm = 0x5A4
callq 0x10f0
leaq 0x44d6(%rip), %rdi      # 0x8cb4
leaq 0x3b0e(%rip), %rsi      # 0x82f3
leaq 0x4594(%rip), %rcx      # 0x8d80
movl $0x5a8, %edx            # imm = 0x5A8
callq 0x10f0
leaq 0x465b(%rip), %rdi      # 0x8e58
leaq 0x3aef(%rip), %rsi      # 0x82f3
leaq 0x4575(%rip), %rcx      # 0x8d80
movl $0x5b9, %edx            # imm = 0x5B9
callq 0x10f0
leaq 0x4432(%rip), %rdi      # 0x8c4e
leaq 0x3ad0(%rip), %rsi      # 0x82f3
leaq 0x4556(%rip), %rcx      # 0x8d80
movl $0x583, %edx            # imm = 0x583
callq 0x10f0
leaq 0x3b89(%rip), %rdi      # 0x83c4
leaq 0x3ab1(%rip), %rsi      # 0x82f3
leaq 0x4537(%rip), %rcx      # 0x8d80
movl $0x586, %edx            # imm = 0x586
callq 0x10f0
leaq 0x3b64(%rip), %rdi      # 0x83be
leaq 0x3a92(%rip), %rsi      # 0x82f3
leaq 0x4518(%rip), %rcx      # 0x8d80
movl $0x582, %edx            # imm = 0x582
callq 0x10f0