// File: /workspace/github_c_makefile_star2_O0/reactive-systems[P]aiger-ltl-model-checker/aiger.c
// Function: aiger_check_for_cycles
static void
aiger_check_for_cycles (aiger_private * private)
{
  unsigned i, j, *stack, size_stack, top_stack, tmp;
  EXPORT_public_FROM (private);
  aiger_type *type;
  aiger_and *and;

  if (private->error)
    return;

  stack = 0;
  size_stack = top_stack = 0;

  for (i = 1; !private->error && i <= public->maxvar; i++)
    {
      type = private->types + i;

      if (!type->and || type->mark)
	continue;

      PUSH (stack, top_stack, size_stack, i);
      while (top_stack)
	{
	  j = stack[top_stack - 1];

	  if (j)
	    {
	      type = private->types + j;
	      if (type->mark && type->onstack)
		{
		  aiger_error_u (private,
				 "cyclic definition for and gate %u", j);
		  break;
		}

	      if (!type->and || type->mark)
		{
		  top_stack--;
		  continue;
		}

	      /* Prefix code.
	       */
	      type->mark = 1;
	      type->onstack = 1;
	      PUSH (stack, top_stack, size_stack, 0);

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

	      tmp = aiger_lit2var (and->rhs0);
	      if (tmp)
		PUSH (stack, top_stack, size_stack, tmp);

	      tmp = aiger_lit2var (and->rhs1);
	      if (tmp)
		PUSH (stack, top_stack, size_stack, tmp);
	    }
	  else
	    {
	      /* All descendends traversed.  This is the postfix code.
	       */
	      assert (top_stack >= 2);
	      top_stack -= 2;
	      j = stack[top_stack];
	      assert (j);
	      type = private->types + j;
	      assert (type->mark);
	      assert (type->onstack);
	      type->onstack = 0;
	    }
	}
    }

  DELETEN (stack, size_stack);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0xd0(%rax)
je 0x468a
jmp 0x4f17
movq $0x0, -0x18(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x1, -0xc(%rbp)
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, 0xd0(%rcx)
movb %al, -0x109(%rbp)
jne 0x46cf
movl -0xc(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl (%rcx), %eax
setbe %al
movb %al, -0x109(%rbp)
movb -0x109(%rbp), %al
testb $0x1, %al
jne 0x46de
jmp 0x4edc
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movl -0xc(%rbp), %ecx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movb (%rax), %al
shrb $0x2, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x471a
movq -0x38(%rbp), %rax
movb (%rax), %al
shrb $0x3, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x471f
jmp 0x4ece
jmp 0x4721
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0x482e
jmp 0x472f
movl -0x1c(%rbp), %eax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x474d
movq -0x48(%rbp), %rax
shlq %rax
movq %rax, -0x118(%rbp)
jmp 0x475b
movl $0x1, %eax
movq %rax, -0x118(%rbp)
jmp 0x475b
movq -0x118(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
shlq $0x2, %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
shlq $0x2, %rax
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x60(%rbp), %rax
jae 0x4795
movq -0x58(%rbp), %rax
movq %rax, -0x120(%rbp)
jmp 0x47a0
movq -0x60(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x120(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movq 0xc0(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0xb8(%rcx), %rdi
movq -0x60(%rbp), %rsi
callq *%rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x68(%rbp), %rdx
callq 0x1140
movq -0x60(%rbp), %rax
cmpq -0x58(%rbp), %rax
jbe 0x47fd
movq -0x70(%rbp), %rdi
addq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rdx
subq -0x58(%rbp), %rdx
xorl %esi, %esi
callq 0x1100
movq -0x8(%rbp), %rax
movq 0xc8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0xb8(%rcx), %rdi
movq -0x18(%rbp), %rsi
movq -0x58(%rbp), %rdx
callq *%rax
movq -0x70(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x50(%rbp), %rax
movl %eax, -0x1c(%rbp)
jmp 0x482e
movl -0xc(%rbp), %edx
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movl %ecx, %ecx
movl %edx, (%rax,%rcx,4)
jmp 0x4847
cmpl $0x0, -0x20(%rbp)
je 0x4ecc
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x4dd7
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movl -0x10(%rbp), %ecx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movb (%rax), %al
shrb $0x3, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x48c1
movq -0x38(%rbp), %rax
movb (%rax), %al
shrb $0x4, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x48c1
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %edx
leaq 0x8338(%rip), %rsi      # 0xcbef
callq 0xa150
jmp 0x4ecc
movq -0x38(%rbp), %rax
movb (%rax), %al
shrb $0x2, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x48e7
movq -0x38(%rbp), %rax
movb (%rax), %al
shrb $0x3, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x48f5
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x4847
movq -0x38(%rbp), %rax
movb (%rax), %cl
andb $-0x9, %cl
orb $0x8, %cl
movb %cl, (%rax)
movq -0x38(%rbp), %rax
movb (%rax), %cl
andb $-0x11, %cl
orb $0x10, %cl
movb %cl, (%rax)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0x4a57
jmp 0x491f
movl -0x1c(%rbp), %eax
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
je 0x493d
movq -0x78(%rbp), %rax
shlq %rax
movq %rax, -0x128(%rbp)
jmp 0x494b
movl $0x1, %eax
movq %rax, -0x128(%rbp)
jmp 0x494b
movq -0x128(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %rax
shlq $0x2, %rax
movq %rax, -0x88(%rbp)
movq -0x80(%rbp), %rax
shlq $0x2, %rax
movq %rax, -0x90(%rbp)
movq -0x88(%rbp), %rax
cmpq -0x90(%rbp), %rax
jae 0x4994
movq -0x88(%rbp), %rax
movq %rax, -0x130(%rbp)
jmp 0x49a2
movq -0x90(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x130(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x8(%rbp), %rax
movq 0xc0(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0xb8(%rcx), %rdi
movq -0x90(%rbp), %rsi
callq *%rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x98(%rbp), %rdx
callq 0x1140
movq -0x90(%rbp), %rax
cmpq -0x88(%rbp), %rax
jbe 0x4a20
movq -0xa0(%rbp), %rdi
addq -0x88(%rbp), %rdi
movq -0x90(%rbp), %rdx
subq -0x88(%rbp), %rdx
xorl %esi, %esi
callq 0x1100
movq -0x8(%rbp), %rax
movq 0xc8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0xb8(%rcx), %rdi
movq -0x18(%rbp), %rsi
movq -0x88(%rbp), %rdx
callq *%rax
movq -0xa0(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x80(%rbp), %rax
movl %eax, -0x1c(%rbp)
jmp 0x4a57
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x20(%rbp)
movl %ecx, %ecx
movl $0x0, (%rax,%rcx,4)
movq -0x38(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x30(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x4a81
jmp 0x4aa0
leaq 0x8189(%rip), %rdi      # 0xcc11
leaq 0x781a(%rip), %rsi      # 0xc2a9
movl $0x359, %edx            # imm = 0x359
leaq 0x8193(%rip), %rcx      # 0xcc2e
callq 0x10f0
movq -0x30(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x38(%rbp), %rcx
movl 0x4(%rcx), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl 0x4(%rax), %eax
shrl %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x4c46
jmp 0x4ad2
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0x4c2d
jmp 0x4ae0
movl -0x1c(%rbp), %eax
movq %rax, -0xa8(%rbp)
cmpq $0x0, -0xa8(%rbp)
je 0x4b07
movq -0xa8(%rbp), %rax
shlq %rax
movq %rax, -0x138(%rbp)
jmp 0x4b15
movl $0x1, %eax
movq %rax, -0x138(%rbp)
jmp 0x4b15
movq -0x138(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xa8(%rbp), %rax
shlq $0x2, %rax
movq %rax, -0xb8(%rbp)
movq -0xb0(%rbp), %rax
shlq $0x2, %rax
movq %rax, -0xc0(%rbp)
movq -0xb8(%rbp), %rax
cmpq -0xc0(%rbp), %rax
jae 0x4b67
movq -0xb8(%rbp), %rax
movq %rax, -0x140(%rbp)
jmp 0x4b75
movq -0xc0(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x8(%rbp), %rax
movq 0xc0(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0xb8(%rcx), %rdi
movq -0xc0(%rbp), %rsi
callq *%rax
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0xc8(%rbp), %rdx
callq 0x1140
movq -0xc0(%rbp), %rax
cmpq -0xb8(%rbp), %rax
jbe 0x4bf3
movq -0xd0(%rbp), %rdi
addq -0xb8(%rbp), %rdi
movq -0xc0(%rbp), %rdx
subq -0xb8(%rbp), %rdx
xorl %esi, %esi
callq 0x1100
movq -0x8(%rbp), %rax
movq 0xc8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0xb8(%rcx), %rdi
movq -0x18(%rbp), %rsi
movq -0xb8(%rbp), %rdx
callq *%rax
movq -0xd0(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0xb0(%rbp), %rax
movl %eax, -0x1c(%rbp)
jmp 0x4c2d
movl -0x24(%rbp), %edx
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movl %ecx, %ecx
movl %edx, (%rax,%rcx,4)
jmp 0x4c46
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
shrl %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x4dd2
jmp 0x4c5e
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0x4db9
jmp 0x4c6c
movl -0x1c(%rbp), %eax
movq %rax, -0xd8(%rbp)
cmpq $0x0, -0xd8(%rbp)
je 0x4c93
movq -0xd8(%rbp), %rax
shlq %rax
movq %rax, -0x148(%rbp)
jmp 0x4ca1
movl $0x1, %eax
movq %rax, -0x148(%rbp)
jmp 0x4ca1
movq -0x148(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0xd8(%rbp), %rax
shlq $0x2, %rax
movq %rax, -0xe8(%rbp)
movq -0xe0(%rbp), %rax
shlq $0x2, %rax
movq %rax, -0xf0(%rbp)
movq -0xe8(%rbp), %rax
cmpq -0xf0(%rbp), %rax
jae 0x4cf3
movq -0xe8(%rbp), %rax
movq %rax, -0x150(%rbp)
jmp 0x4d01
movq -0xf0(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x150(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x8(%rbp), %rax
movq 0xc0(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0xb8(%rcx), %rdi
movq -0xf0(%rbp), %rsi
callq *%rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0xf8(%rbp), %rdx
callq 0x1140
movq -0xf0(%rbp), %rax
cmpq -0xe8(%rbp), %rax
jbe 0x4d7f
movq -0x100(%rbp), %rdi
addq -0xe8(%rbp), %rdi
movq -0xf0(%rbp), %rdx
subq -0xe8(%rbp), %rdx
xorl %esi, %esi
callq 0x1100
movq -0x8(%rbp), %rax
movq 0xc8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0xb8(%rcx), %rdi
movq -0x18(%rbp), %rsi
movq -0xe8(%rbp), %rdx
callq *%rax
movq -0x100(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0xe0(%rbp), %rax
movl %eax, -0x1c(%rbp)
jmp 0x4db9
movl -0x24(%rbp), %edx
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movl %ecx, %ecx
movl %edx, (%rax,%rcx,4)
jmp 0x4dd2
jmp 0x4ec7
cmpl $0x2, -0x20(%rbp)
jb 0x4ddf
jmp 0x4dfe
leaq 0x7e75(%rip), %rdi      # 0xcc5b
leaq 0x74bc(%rip), %rsi      # 0xc2a9
movl $0x368, %edx            # imm = 0x368
leaq 0x7e35(%rip), %rcx      # 0xcc2e
callq 0x10f0
movl -0x20(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x4e1c
jmp 0x4e3b
leaq 0x7e47(%rip), %rdi      # 0xcc6a
leaq 0x747f(%rip), %rsi      # 0xc2a9
movl $0x36b, %edx            # imm = 0x36B
leaq 0x7df8(%rip), %rcx      # 0xcc2e
callq 0x10f0
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movl -0x10(%rbp), %ecx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movb (%rax), %al
shrb $0x3, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x4e66
jmp 0x4e85
leaq 0x7dff(%rip), %rdi      # 0xcc6c
leaq 0x7435(%rip), %rsi      # 0xc2a9
movl $0x36d, %edx            # imm = 0x36D
leaq 0x7dae(%rip), %rcx      # 0xcc2e
callq 0x10f0
movq -0x38(%rbp), %rax
movb (%rax), %al
shrb $0x4, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x4e9a
jmp 0x4eb9
leaq 0x7dd6(%rip), %rdi      # 0xcc77
leaq 0x7401(%rip), %rsi      # 0xc2a9
movl $0x36e, %edx            # imm = 0x36E
leaq 0x7d7a(%rip), %rcx      # 0xcc2e
callq 0x10f0
movq -0x38(%rbp), %rax
movb (%rax), %cl
andb $-0x11, %cl
orb $0x0, %cl
movb %cl, (%rax)
jmp 0x4847
jmp 0x4ece
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x46a7
jmp 0x4ede
movl -0x1c(%rbp), %eax
shlq $0x2, %rax
movq %rax, -0x108(%rbp)
movq -0x8(%rbp), %rax
movq 0xc8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0xb8(%rcx), %rdi
movq -0x18(%rbp), %rsi
movq -0x108(%rbp), %rdx
callq *%rax
movq $0x0, -0x18(%rbp)
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq