// File: /workspace/github_c_makefile_star2_O2/reactive-systems[P]aiger-ltl-model-checker/aiger.c
// Function: aiger_write_header
static int
aiger_write_header (aiger * public,
		    const char *format_string,
		    int compact_inputs_and_latches,
		    void *state, aiger_put put)
{
  unsigned i, j;

  if (aiger_put_s (state, put, format_string) == EOF) return 0;
  if (put (' ', state) == EOF) return 0;
  if (aiger_put_u (state, put, public->maxvar) == EOF) return 0;
  if (put (' ', state) == EOF) return 0;
  if (aiger_put_u (state, put, public->num_inputs) == EOF) return 0;
  if (put (' ', state) == EOF) return 0;
  if (aiger_put_u (state, put, public->num_latches) == EOF) return 0;
  if (put (' ', state) == EOF) return 0;
  if (aiger_put_u (state, put, public->num_outputs) == EOF) return 0;
  if (put (' ', state) == EOF) return 0;
  if (aiger_put_u (state, put, public->num_ands) == EOF) return 0;

  if (public->num_bad ||
      public->num_constraints ||
      public->num_justice ||
      public->num_fairness)
    {
      if (put (' ', state) == EOF) return 0;
      if (aiger_put_u (state, put, public->num_bad) == EOF) return 0;
    }

  if (public->num_constraints ||
      public->num_justice ||
      public->num_fairness)
    {
      if (put (' ', state) == EOF) return 0;
      if (aiger_put_u (state, put, public->num_constraints) == EOF) return 0;
    }

  if (public->num_justice ||
      public->num_fairness)
    {
      if (put (' ', state) == EOF) return 0;
      if (aiger_put_u (state, put, public->num_justice) == EOF) return 0;
    }

  if (public->num_fairness)
    {
      if (put (' ', state) == EOF) return 0;
      if (aiger_put_u (state, put, public->num_fairness) == EOF) return 0;
    }

  if (put ('\n', state) == EOF) return 0;

  if (!compact_inputs_and_latches && public->num_inputs)
    {
      for (i = 0; i < public->num_inputs; i++)
	if (aiger_put_u (state, put, public->inputs[i].lit) == EOF ||
	    put ('\n', state) == EOF)
	  return 0;
    }

  if (public->num_latches)
    {
      for (i = 0; i < public->num_latches; i++)
	{
	  if (!compact_inputs_and_latches)
	    {
	      if (aiger_put_u (state, put, public->latches[i].lit) == EOF)
	        return 0;
	      if (put (' ', state) == EOF) return 0;
	    }

	  if (aiger_put_u (state, put, public->latches[i].next) == EOF)
	     return 0;

	  if (public->latches[i].reset) 
	    {
	      if (put (' ', state) == EOF) return 0;
	      if (aiger_put_u (state, put, public->latches[i].reset) == EOF)
		return 0;
	    }
	  if (put ('\n', state) == EOF) return 0;
	}
    }

  if (public->num_outputs)
    {
      for (i = 0; i < public->num_outputs; i++)
	if (aiger_put_u (state, put, public->outputs[i].lit) == EOF ||
	    put ('\n', state) == EOF)
	  return 0;
    }

  if (public->num_bad)
    {
      for (i = 0; i < public->num_bad; i++)
	if (aiger_put_u (state, put, public->bad[i].lit) == EOF ||
	    put ('\n', state) == EOF)
	  return 0;
    }

  if (public->num_constraints)
    {
      for (i = 0; i < public->num_constraints; i++)
	if (aiger_put_u (state, put, public->constraints[i].lit) == EOF ||
	    put ('\n', state) == EOF)
	  return 0;
    }

  if (public->num_justice)
    {
      for (i = 0; i < public->num_justice; i++)
	{
	  if (aiger_put_u (state, put, public->justice[i].size) == EOF)
	    return 0;
	  if (put ('\n', state) == EOF) return 0;
	}

      for (i = 0; i < public->num_justice; i++)
	{
	  for (j = 0; j < public->justice[i].size; j++)
	    {
	      if (aiger_put_u (state, put, public->justice[i].lits[j]) == EOF)
	        return 0;
	      if (put ('\n', state) == EOF) return 0;
	    }
	}
    }

  if (public->num_fairness)
    {
      for (i = 0; i < public->num_fairness; i++)
	if (aiger_put_u (state, put, public->fairness[i].lit) == EOF ||
	    put ('\n', state) == EOF)
	  return 0;
    }

  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %rbx
movq %rcx, %r14
movl %edx, %r12d
movq %rsi, %rdx
movq %rdi, %r15
movq %rcx, %rdi
movq %r8, %rsi
callq 0x4ae8
cmpl $-0x1, %eax
je 0x6cac
pushq $0x20
popq %rdi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x6cac
movl (%r15), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6751
cmpl $-0x1, %eax
je 0x6cac
pushq $0x20
popq %rdi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x6cac
movl 0x4(%r15), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6751
cmpl $-0x1, %eax
je 0x6cac
pushq $0x20
popq %rdi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x6cac
movl 0x8(%r15), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6751
cmpl $-0x1, %eax
je 0x6cac
pushq $0x20
popq %rdi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x6cac
movl 0xc(%r15), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6751
cmpl $-0x1, %eax
je 0x6cac
pushq $0x20
popq %rdi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x6cac
movl 0x10(%r15), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6751
cmpl $-0x1, %eax
je 0x6cac
cmpl $0x0, 0x14(%r15)
jne 0x68b2
cmpl $0x0, 0x18(%r15)
jne 0x68b2
cmpl $0x0, 0x1c(%r15)
jne 0x68b2
cmpl $0x0, 0x20(%r15)
je 0x6ab2
pushq $0x20
popq %rdi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x6cac
movl 0x14(%r15), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6751
cmpl $-0x1, %eax
je 0x6cac
leaq 0x18(%r15), %r13
cmpl $0x0, 0x18(%r15)
jne 0x68f4
cmpl $0x0, 0x1c(%r15)
jne 0x68f4
cmpl $0x0, 0x20(%r15)
je 0x692e
pushq $0x20
popq %rdi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x6cac
movl (%r13), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6751
cmpl $-0x1, %eax
je 0x6cac
movq %r13, -0x48(%rbp)
leaq 0x1c(%r15), %r13
cmpl $0x0, 0x1c(%r15)
jne 0x693d
jmp 0x6936
movq %r13, -0x48(%rbp)
leaq 0x1c(%r15), %r13
cmpl $0x0, 0x20(%r15)
je 0x699f
pushq $0x20
popq %rdi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x6cac
movl (%r13), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6751
cmpl $-0x1, %eax
je 0x6cac
movq %r13, -0x40(%rbp)
leaq 0x20(%r15), %r13
cmpl $0x0, 0x20(%r15)
je 0x69a7
pushq $0x20
popq %rdi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x6cac
movl (%r13), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6751
cmpl $-0x1, %eax
jne 0x69a7
jmp 0x6cac
movq %r13, -0x40(%rbp)
leaq 0x20(%r15), %r13
pushq $0xa
popq %rdi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x6cac
movq %r13, -0x50(%rbp)
testl %r12d, %r12d
je 0x6b2a
cmpl $0x0, 0x8(%r15)
je 0x6abb
pushq $-0x1
popq %rax
movq %rax, -0x38(%rbp)
xorl %edx, %edx
movl 0x8(%r15), %eax
movq -0x38(%rbp), %rcx
incq %rcx
movq %rcx, -0x38(%rbp)
cmpq %rax, %rcx
jae 0x6abb
testl %r12d, %r12d
movq %rdx, -0x30(%rbp)
jne 0x6a2d
movq 0x30(%r15), %rax
movl (%rax,%rdx), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6751
xorl %r13d, %r13d
cmpl $-0x1, %eax
je 0x6caf
pushq $0x20
popq %rdi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
movq -0x30(%rbp), %rdx
je 0x6caf
movq 0x30(%r15), %rax
movl 0x4(%rax,%rdx), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6751
xorl %r13d, %r13d
cmpl $-0x1, %eax
je 0x6caf
movq 0x30(%r15), %rax
movq -0x30(%rbp), %rcx
cmpl $0x0, 0x8(%rax,%rcx)
je 0x6a90
pushq $0x20
popq %rdi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x6caf
movq 0x30(%r15), %rax
movq -0x30(%rbp), %rcx
movl 0x8(%rax,%rcx), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6751
movq -0x30(%rbp), %rcx
cmpl $-0x1, %eax
je 0x6caf
addq $0x20, %rcx
movq %rcx, -0x30(%rbp)
pushq $0xa
popq %rdi
movq %r14, %rsi
callq *%rbx
movq -0x30(%rbp), %rdx
cmpl $-0x1, %eax
jne 0x69d9
jmp 0x6caf
leaq 0x18(%r15), %r13
jmp 0x68e6
cmpl $0x0, 0xc(%r15)
je 0x6b95
pushq $-0x1
popq %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
xorl %r13d, %r13d
movl 0xc(%r15), %eax
movq -0x30(%rbp), %rcx
incq %rcx
movq %rcx, -0x30(%rbp)
cmpq %rax, %rcx
jae 0x6b95
movq 0x38(%r15), %rax
movq -0x38(%rbp), %r12
movl (%rax,%r12), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6751
cmpl $-0x1, %eax
je 0x6caf
addq $0x20, %r12
movq %r12, -0x38(%rbp)
pushq $0xa
popq %rdi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
jne 0x6ad8
jmp 0x6caf
cmpl $0x0, 0x4(%r15)
je 0x69c5
pushq $-0x1
popq %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
xorl %r13d, %r13d
movl 0x4(%r15), %eax
movq -0x30(%rbp), %rcx
incq %rcx
movq %rcx, -0x30(%rbp)
cmpq %rax, %rcx
jae 0x69c5
movq 0x28(%r15), %rax
movq -0x38(%rbp), %rcx
movl (%rax,%rcx), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6751
cmpl $-0x1, %eax
je 0x6caf
addq $0x20, -0x38(%rbp)
pushq $0xa
popq %rdi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
jne 0x6b47
jmp 0x6caf
cmpl $0x0, 0x14(%r15)
je 0x6bfc
pushq $-0x1
popq %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
xorl %r13d, %r13d
movl 0x14(%r15), %eax
movq -0x30(%rbp), %rcx
incq %rcx
movq %rcx, -0x30(%rbp)
cmpq %rax, %rcx
jae 0x6bfc
movq 0x40(%r15), %rax
movq -0x38(%rbp), %r12
movl (%rax,%r12), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6751
cmpl $-0x1, %eax
je 0x6caf
addq $0x20, %r12
movq %r12, -0x38(%rbp)
pushq $0xa
popq %rdi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
jne 0x6bae
jmp 0x6caf
movq -0x48(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6c60
pushq $-0x1
popq %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
xorl %r13d, %r13d
movq -0x48(%rbp), %rax
movl (%rax), %eax
movq -0x30(%rbp), %rcx
incq %rcx
movq %rcx, -0x30(%rbp)
cmpq %rax, %rcx
jae 0x6c60
movq 0x48(%r15), %rax
movq -0x38(%rbp), %r12
movl (%rax,%r12), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6751
cmpl $-0x1, %eax
je 0x6caf
addq $0x20, %r12
movq %r12, -0x38(%rbp)
pushq $0xa
popq %rdi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
jne 0x6c17
jmp 0x6caf
movq -0x40(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6d2d
pushq $0xc
popq %r13
pushq $-0x1
popq %r12
movq -0x40(%rbp), %rax
movl (%rax), %eax
incq %r12
cmpq %rax, %r12
jae 0x6cc1
movq 0x50(%r15), %rax
movl (%rax,%r13), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6751
cmpl $-0x1, %eax
je 0x6cac
addq $0x20, %r13
pushq $0xa
popq %rdi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
jne 0x6c75
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x0, -0x38(%rbp)
xorl %r13d, %r13d
movl %eax, %eax
cmpq %rax, -0x38(%rbp)
jae 0x6d2d
movq -0x38(%rbp), %rax
shlq $0x5, %rax
movq %rax, -0x30(%rbp)
xorl %r12d, %r12d
movq 0x50(%r15), %rax
movq -0x30(%rbp), %rdx
movl 0xc(%rax,%rdx), %ecx
cmpq %rcx, %r12
jae 0x6d21
addq %rdx, %rax
movq 0x10(%rax), %rax
movl (%rax,%r12,4), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6751
cmpl $-0x1, %eax
je 0x6caf
pushq $0xa
popq %rdi
movq %r14, %rsi
callq *%rbx
incq %r12
cmpl $-0x1, %eax
jne 0x6ce3
jmp 0x6caf
incq -0x38(%rbp)
movq -0x40(%rbp), %rax
movl (%rax), %eax
jmp 0x6ccc
movq -0x50(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6d89
pushq $-0x1
popq %r12
movq $0x0, -0x30(%rbp)
xorl %r13d, %r13d
movq -0x50(%rbp), %rax
movl (%rax), %eax
incq %r12
cmpq %rax, %r12
jae 0x6d89
movq 0x58(%r15), %rax
movq -0x30(%rbp), %rcx
movl (%rax,%rcx), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6751
cmpl $-0x1, %eax
je 0x6caf
addq $0x20, -0x30(%rbp)
pushq $0xa
popq %rdi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
jne 0x6d45
jmp 0x6caf
pushq $0x1
popq %r13
jmp 0x6caf