// File: /workspace/github_c_makefile_star2_O2/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 0x3f02
movl %esi, %eax
jmp 0x4421
movq %rcx, %rbx
movq %rdi, %r11
movl %esi, %edi
movl (%rcx,%rdi,4), %eax
testl %eax, %eax
jne 0x4421
movl %esi, %r15d
shrl %r15d
cmpl (%r11), %r15d
ja 0x444f
movq 0x70(%r11), %rax
movl %r15d, %ecx
movb (%rax,%rcx,8), %al
testb $0x4, %al
jne 0x3f4f
testb $0x3, %al
je 0x446e
cmpl %esi, (%rdx)
jbe 0x448d
movl %esi, (%rbx,%rdi,4)
movl %esi, %eax
xorl $0x1, %eax
movl %eax, (%rbx,%rax,4)
jmp 0x3efb
movq (%r8), %r10
movl (%r9), %esi
testl %esi, %esi
jne 0x3fb2
movq %rdi, -0x70(%rbp)
movq 0xb8(%r11), %rdi
pushq $0x4
popq %rsi
movq %rdx, -0x68(%rbp)
movq %r8, -0x60(%rbp)
movq %r9, -0x58(%rbp)
movq %r11, %r13
movq %r10, %r14
callq *0xc0(%r11)
movq %rax, %r12
andl $0x0, (%rax)
movq 0xb8(%r13), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq *0xc8(%r13)
movq %r13, %r11
movq -0x58(%rbp), %r9
movq -0x60(%rbp), %r8
movq -0x68(%rbp), %rdx
movq -0x70(%rbp), %rdi
pushq $0x1
popq %rsi
movq %r12, %r10
pushq $0x1
popq %r14
movl %r15d, (%r10)
movl %r14d, %r12d
addl %r14d, %r14d
testq %r12, %r12
je 0x4410
movl -0x4(%r10,%r12,4), %r15d
testq %r15, %r15
je 0x3ffb
leal (%r15,%r15), %eax
cmpl $0x0, (%rbx,%rax,4)
jne 0x3ff2
cmpl (%r11), %r15d
ja 0x4430
movq 0x70(%r11), %r13
movb (%r13,%r15,8), %al
testb $0x10, %al
je 0x4063
addl $-0x2, %r14d
decq %r12
jmp 0x3fbf
cmpl $0x1, %r12d
je 0x4528
addq $-0x2, %r12
movl %r12d, %eax
movl (%r10,%rax,4), %ecx
leal (%rcx,%rcx), %eax
cmpl $0x0, (%rbx,%rax,4)
jne 0x44cb
movq %rsi, %r13
movq %r10, %r15
movq 0x70(%r11), %r10
movb (%r10,%rcx,8), %sil
testb $0x10, %sil
je 0x4509
andb $-0x11, %sil
movb %sil, (%r10,%rcx,8)
cmpl $0x0, (%rbx,%rax,4)
jne 0x44ea
movl (%rdx), %ecx
movl %ecx, (%rbx,%rax,4)
incl %ecx
movl %ecx, 0x4(%rbx,%rax,4)
addl $0x2, (%rdx)
movl %r12d, %r14d
movq %r15, %r10
movq %r13, %rsi
jmp 0x3fb9
leal 0x1(%rsi), %ecx
orb $0x10, %al
movb %al, (%r13,%r15,8)
cmpl %r12d, %ecx
movq %rdi, -0x70(%rbp)
movq %rdx, -0x68(%rbp)
movq %r8, -0x60(%rbp)
movq %r9, -0x58(%rbp)
movq %r11, -0x50(%rbp)
jne 0x4135
movl %esi, %edx
leaq (%rdx,%rdx), %rcx
testl %esi, %esi
pushq $0x1
popq %rax
cmoveq %rax, %rcx
shlq $0x2, %rdx
movq %rdx, -0x30(%rbp)
movq %rcx, -0x40(%rbp)
leaq (,%rcx,4), %rsi
movq %rsi, -0x80(%rbp)
cmpq %rsi, %rdx
movq %rsi, %rax
cmovbq %rdx, %rax
movq %rax, -0x78(%rbp)
movq 0xb8(%r11), %rdi
movq %r10, -0x48(%rbp)
callq *0xc0(%r11)
movq %rax, -0x38(%rbp)
movq %rax, %rdi
movq -0x48(%rbp), %rsi
movq -0x78(%rbp), %rdx
callq 0x1140
movq -0x80(%rbp), %rcx
movq -0x30(%rbp), %rdx
subq %rdx, %rcx
jbe 0x4108
movq -0x38(%rbp), %rax
leaq (%rax,%rdx), %rdi
xorl %esi, %esi
movq %rcx, %rdx
callq 0x1100
movq -0x30(%rbp), %rdx
movq -0x50(%rbp), %rax
movq 0xb8(%rax), %rdi
movq -0x48(%rbp), %rsi
callq *0xc8(%rax)
movq -0x38(%rbp), %r10
movq -0x40(%rbp), %rsi
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rdx
movq -0x60(%rbp), %r8
movq -0x58(%rbp), %r9
movl %r15d, -0x4(%r10,%r12,4)
movl %r12d, %eax
cmpl %r12d, %esi
jne 0x41d5
leaq (,%rax,4), %rcx
movq %rcx, -0x30(%rbp)
leaq (,%rax,8), %rsi
movq -0x50(%rbp), %rcx
movq 0xb8(%rcx), %rdi
movq %r10, -0x48(%rbp)
movq %rax, -0x38(%rbp)
movq -0x50(%rbp), %rax
callq *0xc0(%rax)
movq %rax, -0x40(%rbp)
movq %rax, %rdi
movq -0x48(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x1140
movq -0x38(%rbp), %rax
movq -0x40(%rbp), %rcx
leaq (%rcx,%rax,4), %rdi
xorl %esi, %esi
movq -0x30(%rbp), %rdx
callq 0x1100
movq -0x50(%rbp), %rax
movq 0xb8(%rax), %rdi
movq -0x48(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq *0xc8(%rax)
movq -0x38(%rbp), %rax
movq -0x58(%rbp), %r9
movq -0x60(%rbp), %r8
movq -0x68(%rbp), %rdx
movq -0x70(%rbp), %rdi
movq -0x40(%rbp), %r10
jmp 0x41d8
movl %esi, %r14d
andl $0x0, (%r10,%rax,4)
testb $0x4, (%r13,%r15,8)
je 0x4585
movl 0x4(%r13,%r15,8), %eax
movq -0x50(%rbp), %r11
cmpl 0x10(%r11), %eax
jae 0x4547
movq 0x60(%r11), %rcx
testq %rcx, %rcx
je 0x4566
movl %r14d, %esi
movq %rsi, -0x30(%rbp)
leaq 0x1(%r12), %r15
imulq $0xc, %rax, %rax
movl 0x4(%rcx,%rax), %esi
movl 0x8(%rcx,%rax), %r13d
shrl %esi
shrl %r13d
cmpl %r13d, %esi
movl %r13d, %eax
cmovbl %esi, %eax
movl %eax, -0x38(%rbp)
cmoval %esi, %r13d
testl %r13d, %r13d
je 0x4253
movq %r15, -0x40(%rbp)
movq 0x70(%r11), %rax
movl %r13d, %ecx
testb $0x13, (%rax,%rcx,8)
je 0x4263
movq -0x40(%rbp), %r14
jmp 0x4256
movl %r15d, %r14d
movq -0x30(%rbp), %rsi
movl -0x38(%rbp), %r15d
jmp 0x4336
movq -0x30(%rbp), %rsi
leaq -0x1(%rsi), %rax
cmpl %r12d, %eax
jne 0x431e
leaq (%rsi,%rsi), %rcx
testl %r14d, %r14d
pushq $0x1
popq %rax
cmoveq %rax, %rcx
shlq $0x2, %rsi
movq %rsi, -0x30(%rbp)
movq %rcx, -0x78(%rbp)
leaq (,%rcx,4), %r14
cmpq %r14, %rsi
movq %r14, %rax
cmovbq %rsi, %rax
movq %rax, -0x80(%rbp)
movq 0xb8(%r11), %rdi
movq %r14, %rsi
movq %r10, %r15
callq *0xc0(%r11)
movq %rax, %rdi
movq %r15, %rsi
movq %rax, %r15
movq %rsi, -0x48(%rbp)
movq -0x80(%rbp), %rdx
callq 0x1140
movq %r14, %rax
movq -0x30(%rbp), %rdx
subq %rdx, %rax
jbe 0x42ee
leaq (%r15,%rdx), %rdi
xorl %esi, %esi
movq %rdx, %r14
movq %rax, %rdx
callq 0x1100
movq %r14, %rdx
movq -0x50(%rbp), %r14
movq 0xb8(%r14), %rdi
movq -0x48(%rbp), %rsi
callq *0xc8(%r14)
movq %r14, %r11
movq %r15, %r10
movq -0x78(%rbp), %r14
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rdx
movq -0x60(%rbp), %r8
movq -0x58(%rbp), %r9
movl -0x38(%rbp), %r15d
movq -0x40(%rbp), %rax
addl $0x2, %r12d
movl %eax, %eax
movl %r13d, (%r10,%rax,4)
movl %r14d, %esi
movl %r12d, %r14d
testl %r15d, %r15d
je 0x3fb9
movq 0x70(%r11), %rax
movl %r15d, %ecx
testb $0x13, (%rax,%rcx,8)
jne 0x3fb9
cmpl %esi, %r14d
jne 0x4401
movl %esi, %r12d
leaq (%r12,%r12), %rcx
testl %esi, %esi
pushq $0x1
popq %rax
cmoveq %rax, %rcx
shlq $0x2, %r12
movq %rcx, -0x40(%rbp)
leaq (,%rcx,4), %r15
cmpq %r15, %r12
movq %r15, %rax
cmovbq %r12, %rax
movq %rax, -0x78(%rbp)
movq 0xb8(%r11), %rdi
movq %r15, %rsi
movq %r10, %r13
callq *0xc0(%r11)
movq %rax, -0x30(%rbp)
movq %rax, %rdi
movq %r13, -0x48(%rbp)
movq %r13, %rsi
movq -0x78(%rbp), %rdx
callq 0x1140
subq %r12, %r15
jbe 0x43c9
movq -0x30(%rbp), %rax
leaq (%rax,%r12), %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1100
movq -0x50(%rbp), %r13
movq 0xb8(%r13), %rdi
movq -0x48(%rbp), %rsi
movq %r12, %rdx
callq *0xc8(%r13)
movq %r13, %r11
movq -0x30(%rbp), %r10
movq -0x40(%rbp), %rsi
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rdx
movq -0x60(%rbp), %r8
movq -0x58(%rbp), %r9
movl -0x38(%rbp), %r15d
movl %r14d, %eax
incl %r14d
movl %r15d, (%r10,%rax,4)
jmp 0x3fb9
movl %esi, (%r9)
movq %r10, (%r8)
movl (%rbx,%rdi,4), %eax
testl %eax, %eax
je 0x44ac
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x49c1(%rip), %rdi      # 0x8df8
leaq 0x3eb5(%rip), %rsi      # 0x82f3
leaq 0x493b(%rip), %rcx      # 0x8d80
movl $0x578, %edx            # imm = 0x578
callq 0x10f0
leaq 0x44cb(%rip), %rdi      # 0x8921
leaq 0x3e96(%rip), %rsi      # 0x82f3
leaq 0x491c(%rip), %rcx      # 0x8d80
movl $0x566, %edx            # imm = 0x566
callq 0x10f0
leaq 0x49bc(%rip), %rdi      # 0x8e31
leaq 0x3e77(%rip), %rsi      # 0x82f3
leaq 0x48fd(%rip), %rcx      # 0x8d80
movl $0x5b2, %edx            # imm = 0x5B2
callq 0x10f0
leaq 0x49b8(%rip), %rdi      # 0x8e4c
leaq 0x3e58(%rip), %rsi      # 0x82f3
leaq 0x48de(%rip), %rcx      # 0x8d80
movl $0x5b3, %edx            # imm = 0x5B3
callq 0x10f0
leaq 0x49a5(%rip), %rdi      # 0x8e58
leaq 0x3e39(%rip), %rsi      # 0x82f3
leaq 0x48bf(%rip), %rcx      # 0x8d80
movl $0x5b9, %edx            # imm = 0x5B9
callq 0x10f0
leaq 0x4944(%rip), %rdi      # 0x8e16
leaq 0x3e1a(%rip), %rsi      # 0x82f3
leaq 0x48a0(%rip), %rcx      # 0x8d80
movl $0x5a6, %edx            # imm = 0x5A6
callq 0x10f0
leaq 0x4966(%rip), %rdi      # 0x8e57
leaq 0x3dfb(%rip), %rsi      # 0x82f3
leaq 0x4963(%rip), %rcx      # 0x8e62
movl $0x54d, %edx            # imm = 0x54D
callq 0x10f0
leaq 0x47a4(%rip), %rdi      # 0x8cb4
leaq 0x3ddc(%rip), %rsi      # 0x82f3
leaq 0x4862(%rip), %rcx      # 0x8d80
movl $0x5a8, %edx            # imm = 0x5A8
callq 0x10f0
leaq 0x48df(%rip), %rdi      # 0x8e0e
leaq 0x3dbd(%rip), %rsi      # 0x82f3
leaq 0x4843(%rip), %rcx      # 0x8d80
movl $0x5a4, %edx            # imm = 0x5A4
callq 0x10f0
leaq 0x4700(%rip), %rdi      # 0x8c4e
leaq 0x3d9e(%rip), %rsi      # 0x82f3
leaq 0x4824(%rip), %rcx      # 0x8d80
movl $0x583, %edx            # imm = 0x583
callq 0x10f0
leaq 0x3e57(%rip), %rdi      # 0x83c4
leaq 0x3d7f(%rip), %rsi      # 0x82f3
leaq 0x4805(%rip), %rcx      # 0x8d80
movl $0x586, %edx            # imm = 0x586
callq 0x10f0
leaq 0x3e32(%rip), %rdi      # 0x83be
leaq 0x3d60(%rip), %rsi      # 0x82f3
leaq 0x47e6(%rip), %rcx      # 0x8d80
movl $0x582, %edx            # imm = 0x582
callq 0x10f0