// File: /workspace/github_c_makefile_star2_O3/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 $0x38, %rsp
movq %r8, %rbx
movq %rcx, %r14
movl %edx, %r13d
movq %rsi, %r15
movq %rdi, -0x40(%rbp)
movb (%rsi), %al
movq %rsi, %r12
testb %al, %al
je 0x6d82
movq %r15, %r12
movsbl %al, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x72f6
movb 0x1(%r12), %al
incq %r12
testb %al, %al
jne 0x6d65
subl %r15d, %r12d
xorl %r15d, %r15d
cmpl $-0x1, %r12d
je 0x72f9
movl $0x20, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x72f9
movq -0x40(%rbp), %r12
movl (%r12), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6cda
cmpl $-0x1, %eax
je 0x72f9
movl $0x20, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x72f9
movl 0x4(%r12), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6cda
cmpl $-0x1, %eax
je 0x72f9
movl $0x20, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x72f9
movl 0x8(%r12), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6cda
cmpl $-0x1, %eax
je 0x72f9
movl $0x20, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x72f9
movl 0xc(%r12), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6cda
cmpl $-0x1, %eax
je 0x72f9
movl $0x20, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x72f9
movl 0x10(%r12), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6cda
cmpl $-0x1, %eax
je 0x72f9
cmpl $0x0, 0x14(%r12)
jne 0x6e95
cmpl $0x0, 0x18(%r12)
jne 0x6e95
cmpl $0x0, 0x1c(%r12)
jne 0x6e95
cmpl $0x0, 0x20(%r12)
je 0x730b
movl $0x20, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x72f9
movl 0x14(%r12), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6cda
cmpl $-0x1, %eax
je 0x72f9
leaq 0x18(%r12), %rax
movq %rax, -0x38(%rbp)
cmpl $0x0, 0x18(%r12)
jne 0x6ee2
cmpl $0x0, 0x1c(%r12)
jne 0x6ee2
cmpl $0x0, 0x20(%r12)
je 0x6f22
movl $0x20, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x72f9
movq -0x38(%rbp), %rax
movl (%rax), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6cda
cmpl $-0x1, %eax
je 0x72f9
leaq 0x1c(%r12), %rax
movq %rax, -0x48(%rbp)
cmpl $0x0, 0x1c(%r12)
jne 0x6f33
jmp 0x6f2b
leaq 0x1c(%r12), %rax
movq %rax, -0x48(%rbp)
cmpl $0x0, 0x20(%r12)
je 0x6f9f
movl $0x20, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x72f9
movq -0x48(%rbp), %rax
movl (%rax), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6cda
cmpl $-0x1, %eax
je 0x72f9
leaq 0x20(%r12), %rax
movq %rax, -0x50(%rbp)
cmpl $0x0, 0x20(%r12)
je 0x6fa8
movl $0x20, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x72f9
movq -0x50(%rbp), %rax
movl (%rax), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6cda
cmpl $-0x1, %eax
jne 0x6fa8
jmp 0x72f9
leaq 0x20(%r12), %rax
movq %rax, -0x50(%rbp)
movl $0xa, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x72f9
testl %r13d, %r13d
je 0x7319
cmpl $0x0, 0x8(%r12)
je 0x70ab
xorl %ecx, %ecx
xorl %edx, %edx
testl %r13d, %r13d
movq %rcx, -0x30(%rbp)
movq %rdx, -0x58(%rbp)
jne 0x7017
movq 0x30(%r12), %rax
movl (%rax,%rcx), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6cda
xorl %r15d, %r15d
cmpl $-0x1, %eax
je 0x72f9
movl $0x20, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
movq -0x30(%rbp), %rcx
je 0x72f9
movq 0x30(%r12), %rax
movl 0x4(%rax,%rcx), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6cda
xorl %r15d, %r15d
cmpl $-0x1, %eax
je 0x72f9
movq 0x30(%r12), %rax
movq -0x30(%rbp), %rcx
cmpl $0x0, 0x8(%rax,%rcx)
je 0x707b
movl $0x20, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x72f9
movq 0x30(%r12), %rax
movq -0x30(%rbp), %rcx
movl 0x8(%rax,%rcx), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6cda
cmpl $-0x1, %eax
je 0x72f9
movl $0xa, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
movq -0x30(%rbp), %rcx
movq -0x58(%rbp), %rdx
je 0x72f9
incq %rdx
movl 0x8(%r12), %eax
addq $0x20, %rcx
cmpq %rax, %rdx
jb 0x6fd4
cmpl $0x0, 0xc(%r12)
je 0x7103
xorl %r15d, %r15d
xorl %ecx, %ecx
xorl %r13d, %r13d
movq 0x38(%r12), %rax
movq %rcx, -0x30(%rbp)
movl (%rax,%rcx), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6cda
cmpl $-0x1, %eax
je 0x72f9
movl $0xa, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x72f9
incq %r13
movl 0xc(%r12), %eax
movq -0x30(%rbp), %rcx
addq $0x20, %rcx
cmpq %rax, %r13
jb 0x70bb
cmpl $0x0, 0x14(%r12)
je 0x715b
xorl %r15d, %r15d
xorl %ecx, %ecx
xorl %r13d, %r13d
movq 0x40(%r12), %rax
movq %rcx, -0x30(%rbp)
movl (%rax,%rcx), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6cda
cmpl $-0x1, %eax
je 0x72f9
movl $0xa, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x72f9
incq %r13
movl 0x14(%r12), %eax
movq -0x30(%rbp), %rcx
addq $0x20, %rcx
cmpq %rax, %r13
jb 0x7113
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
je 0x71b7
xorl %r15d, %r15d
xorl %ecx, %ecx
xorl %r13d, %r13d
movq 0x48(%r12), %rax
movq %rcx, %r12
movl (%rax,%rcx), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6cda
cmpl $-0x1, %eax
je 0x72f9
movl $0xa, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x72f9
incq %r13
movq -0x38(%rbp), %rax
movl (%rax), %eax
movq %r12, %rcx
addq $0x20, %rcx
cmpq %rax, %r13
movq -0x40(%rbp), %r12
jb 0x716c
movq -0x48(%rbp), %rax
cmpl $0x0, (%rax)
je 0x72a2
movl $0xc, %r12d
xorl %r15d, %r15d
xorl %r13d, %r13d
movq -0x40(%rbp), %rax
movq 0x50(%rax), %rax
movl (%rax,%r12), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6cda
cmpl $-0x1, %eax
je 0x72f9
movl $0xa, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x72f9
incq %r13
movq -0x48(%rbp), %rax
movl (%rax), %ecx
addq $0x20, %r12
cmpq %rcx, %r13
jb 0x71d0
testl %ecx, %ecx
je 0x72a2
movq -0x40(%rbp), %rax
movq 0x50(%rax), %rax
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rdx
shlq $0x5, %rdx
cmpl $0x0, 0xc(%rax,%rdx)
je 0x7290
movq %rdx, %r12
xorl %r13d, %r13d
movq 0x10(%rax,%r12), %rax
movl (%rax,%r13,4), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6cda
xorl %r15d, %r15d
cmpl $-0x1, %eax
je 0x72f9
movl $0xa, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
movq -0x40(%rbp), %rax
je 0x72f9
incq %r13
movq 0x50(%rax), %rax
movl 0xc(%rax,%r12), %ecx
cmpq %rcx, %r13
jb 0x7242
movq -0x48(%rbp), %rcx
movl (%rcx), %ecx
movq -0x38(%rbp), %rdi
incq %rdi
movl %ecx, %edx
movq %rdi, -0x38(%rbp)
cmpq %rdx, %rdi
jb 0x722d
movl $0x1, %r15d
movq -0x50(%rbp), %rax
cmpl $0x0, (%rax)
je 0x72f9
xorl %r12d, %r12d
xorl %r13d, %r13d
movq -0x40(%rbp), %rax
movq 0x58(%rax), %rax
movl (%rax,%r12), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6cda
cmpl $-0x1, %eax
je 0x72f6
movl $0xa, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
je 0x72f6
incq %r13
movq -0x50(%rbp), %rax
movl (%rax), %eax
addq $0x20, %r12
cmpq %rax, %r13
jb 0x72b7
jmp 0x72f9
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18(%r12), %rax
movq %rax, -0x38(%rbp)
jmp 0x6ed2
cmpl $0x0, 0x4(%r12)
je 0x6fc4
xorl %r15d, %r15d
xorl %ecx, %ecx
xorl %edx, %edx
movq %rdx, -0x30(%rbp)
movq 0x28(%r12), %rax
movq %rcx, -0x58(%rbp)
movl (%rax,%rcx), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6cda
cmpl $-0x1, %eax
je 0x72f9
movl $0xa, %edi
movq %r14, %rsi
callq *%rbx
cmpl $-0x1, %eax
movq -0x30(%rbp), %rdx
je 0x72f9
incq %rdx
movl 0x4(%r12), %eax
movq -0x58(%rbp), %rcx
addq $0x20, %rcx
cmpq %rax, %rdx
jb 0x732c
jmp 0x6fc4