// File: biotomas[P]ipasir/sat/picosat961/picosat-961/picomcs.c
// Function: parse
static const char * parse (void) {
  int ch, expclauses, lit, sign;
  size_t bytes;
  msg (1, "parsing %s", input_name);
COMMENTS:
  ch = nextch ();
  if (ch == 'c') {
    while ((ch = nextch ()) != '\n')
      if (ch == EOF) return "out of file in comment";
    goto COMMENTS;
  }
  if (ch != 'p') 
INVALID_HEADER:
    return "invalid header";
  ungetc (ch, input);
  if (fscanf (input, "p cnf %d %d", &nvars, &expclauses) != 2)
    goto INVALID_HEADER;
  msg (1, "found 'p cnf %d %d' header", nvars, expclauses);
  bytes = (1 + nvars + expclauses) * sizeof *marked;
  marked = malloc (bytes);
  memset (marked, 0, bytes);
LIT:
  ch = nextch ();
  if (ch == ' '  || ch == '\n' || ch == '\t' || ch == '\r') goto LIT;
  if (ch == EOF) {
    assert (nclauses <= expclauses);
    if (nclauses < expclauses) return "clauses missing";
    return 0;
  }
  if (ch == '-') {
    ch = nextch ();
    if (!isdigit (ch)) return "expected digit after '-'";
    if (ch == '0') return "expected positive digit after '-'";
    sign = -1;
  } else if (!isdigit (ch)) return "expected '-' or digit";
  else sign = 1;
  lit = ch - '0';
  while (isdigit (ch = nextch ()))
    lit = 10*lit + (ch - '0');
  if (lit) {
    if (lit > nvars) return "maximum variable index exceeded";
    if (nclauses == expclauses) return "too many clauses";
    push_stack (sign * lit);
  } else {
    assert (nclauses < expclauses);
    push_clause ();
  }
  goto LIT;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq 0x1f9e9(%rip), %rdx     # 0x21138
movl $0x1, %edi
leaq 0x189a7(%rip), %rsi     # 0x1a102
movb $0x0, %al
callq 0x1e10
callq 0x1ef0
movl %eax, -0xc(%rbp)
cmpl $0x63, -0xc(%rbp)
jne 0x1799
jmp 0x1772
callq 0x1ef0
movl %eax, -0xc(%rbp)
cmpl $0xa, %eax
je 0x1797
cmpl $-0x1, -0xc(%rbp)
jne 0x1795
leaq 0x18981(%rip), %rax     # 0x1a10d
movq %rax, -0x8(%rbp)
jmp 0x1a00
jmp 0x1772
jmp 0x1762
cmpl $0x70, -0xc(%rbp)
je 0x17b1
jmp 0x17a1
leaq 0x1897c(%rip), %rax     # 0x1a124
movq %rax, -0x8(%rbp)
jmp 0x1a00
movl -0xc(%rbp), %edi
movq 0x1f985(%rip), %rsi     # 0x21140
callq 0x1150
movq 0x1f979(%rip), %rdi     # 0x21140
leaq 0x18965(%rip), %rsi     # 0x1a133
leaq 0x1f943(%rip), %rdx     # 0x21118
leaq -0x10(%rbp), %rcx
movb $0x0, %al
callq 0x1070
cmpl $0x2, %eax
je 0x17e7
jmp 0x17a1
movl 0x1f92b(%rip), %edx     # 0x21118
movl -0x10(%rbp), %ecx
movl $0x1, %edi
leaq 0x18943(%rip), %rsi     # 0x1a13f
movb $0x0, %al
callq 0x1e10
movl 0x1f90f(%rip), %eax     # 0x21118
addl $0x1, %eax
addl -0x10(%rbp), %eax
cltq
shlq $0x0, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1130
movq %rax, 0x1f937(%rip)     # 0x21160
movq 0x1f930(%rip), %rdi     # 0x21160
movq -0x20(%rbp), %rdx
xorl %esi, %esi
callq 0x10e0
callq 0x1ef0
movl %eax, -0xc(%rbp)
cmpl $0x20, -0xc(%rbp)
je 0x185b
cmpl $0xa, -0xc(%rbp)
je 0x185b
cmpl $0x9, -0xc(%rbp)
je 0x185b
cmpl $0xd, -0xc(%rbp)
jne 0x185d
jmp 0x183b
cmpl $-0x1, -0xc(%rbp)
jne 0x18b7
movl 0x1f8b3(%rip), %eax     # 0x2111c
cmpl -0x10(%rbp), %eax
jg 0x1870
jmp 0x188f
leaq 0x188e3(%rip), %rdi     # 0x1a15a
leaq 0x188f3(%rip), %rsi     # 0x1a171
movl $0x8a, %edx
leaq 0x188f1(%rip), %rcx     # 0x1a17b
callq 0x10c0
movl 0x1f887(%rip), %eax     # 0x2111c
cmpl -0x10(%rbp), %eax
jge 0x18aa
leaq 0x188f2(%rip), %rax     # 0x1a193
movq %rax, -0x8(%rbp)
jmp 0x1a00
movq $0x0, -0x8(%rbp)
jmp 0x1a00
cmpl $0x2d, -0xc(%rbp)
jne 0x190e
callq 0x1ef0
movl %eax, -0xc(%rbp)
callq 0x11e0
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x18ef
leaq 0x188bd(%rip), %rax     # 0x1a1a3
movq %rax, -0x8(%rbp)
jmp 0x1a00
cmpl $0x30, -0xc(%rbp)
jne 0x1905
leaq 0x188c0(%rip), %rax     # 0x1a1bc
movq %rax, -0x8(%rbp)
jmp 0x1a00
movl $0xffffffff, -0x18(%rbp) # imm = 0xFFFFFFFF
jmp 0x1941
callq 0x11e0
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x1938
leaq 0x188af(%rip), %rax     # 0x1a1de
movq %rax, -0x8(%rbp)
jmp 0x1a00
movl $0x1, -0x18(%rbp)
jmp 0x1941
movl -0xc(%rbp), %eax
subl $0x30, %eax
movl %eax, -0x14(%rbp)
callq 0x11e0
movq (%rax), %rax
movq %rax, -0x28(%rbp)
callq 0x1ef0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, -0xc(%rbp)
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x1986
imull $0xa, -0x14(%rbp), %eax
movl -0xc(%rbp), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, -0x14(%rbp)
jmp 0x194a
cmpl $0x0, -0x14(%rbp)
je 0x19ca
movl -0x14(%rbp), %eax
cmpl 0x1f783(%rip), %eax     # 0x21118
jle 0x19a4
leaq 0x18856(%rip), %rax     # 0x1a1f4
movq %rax, -0x8(%rbp)
jmp 0x1a00
movl 0x1f772(%rip), %eax     # 0x2111c
cmpl -0x10(%rbp), %eax
jne 0x19bc
leaq 0x1885e(%rip), %rax     # 0x1a214
movq %rax, -0x8(%rbp)
jmp 0x1a00
movl -0x18(%rbp), %edi
imull -0x14(%rbp), %edi
callq 0x1f30
jmp 0x19fb
movl 0x1f74c(%rip), %eax     # 0x2111c
cmpl -0x10(%rbp), %eax
jge 0x19d7
jmp 0x19f6
leaq 0x18847(%rip), %rdi     # 0x1a225
leaq 0x1878c(%rip), %rsi     # 0x1a171
movl $0x9d, %edx
leaq 0x1878a(%rip), %rcx     # 0x1a17b
callq 0x10c0
callq 0x1fc0
jmp 0x183b
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)