// File: /workspace/github_c_makefile_star2_O2/orangeduck[P]mpc/mpc.c
// Function: mpc_nodecount_unretained
static int mpc_nodecount_unretained(mpc_parser_t* p, int force) {

  int i, total;

  if (p->retained && !force) { return 0; }

  if (p->type == MPC_TYPE_EXPECT) { return 1 + mpc_nodecount_unretained(p->data.expect.x, 0); }

  if (p->type == MPC_TYPE_APPLY)    { return 1 + mpc_nodecount_unretained(p->data.apply.x, 0); }
  if (p->type == MPC_TYPE_APPLY_TO) { return 1 + mpc_nodecount_unretained(p->data.apply_to.x, 0); }
  if (p->type == MPC_TYPE_PREDICT)  { return 1 + mpc_nodecount_unretained(p->data.predict.x, 0); }

  if (p->type == MPC_TYPE_CHECK)    { return 1 + mpc_nodecount_unretained(p->data.check.x, 0); }
  if (p->type == MPC_TYPE_CHECK_WITH) { return 1 + mpc_nodecount_unretained(p->data.check_with.x, 0); }

  if (p->type == MPC_TYPE_NOT)   { return 1 + mpc_nodecount_unretained(p->data.not.x, 0); }
  if (p->type == MPC_TYPE_MAYBE) { return 1 + mpc_nodecount_unretained(p->data.not.x, 0); }

  if (p->type == MPC_TYPE_MANY)  { return 1 + mpc_nodecount_unretained(p->data.repeat.x, 0); }
  if (p->type == MPC_TYPE_MANY1) { return 1 + mpc_nodecount_unretained(p->data.repeat.x, 0); }
  if (p->type == MPC_TYPE_COUNT) { return 1 + mpc_nodecount_unretained(p->data.repeat.x, 0); }
  if (p->type == MPC_TYPE_SEPBY1) {
    total = 1;
    total += mpc_nodecount_unretained(p->data.sepby1.x, 0);
    total += mpc_nodecount_unretained(p->data.sepby1.sep, 0);
    total += mpc_nodecount_unretained(p->data.sepby1.x, 0);
    return total;
  }

  if (p->type == MPC_TYPE_OR) {
    total = 1;
    for(i = 0; i < p->data.or.n; i++) {
      total += mpc_nodecount_unretained(p->data.or.xs[i], 0);
    }
    return total;
  }

  if (p->type == MPC_TYPE_AND) {
    total = 1;
    for(i = 0; i < p->data.and.n; i++) {
      total += mpc_nodecount_unretained(p->data.and.xs[i], 0);
    }
    return total;
  }

  return 1;

}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r14
xorl %r15d, %r15d
pushq $0x1
popq %rbx
leaq 0x1980(%rip), %rax      # 0xc248
testl %esi, %esi
setne %cl
testb $0x1, %cl
jne 0xa8d9
cmpb $0x0, 0x31(%r14)
jne 0xa91e
movzbl 0x30(%r14), %ecx
addl $-0x5, %ecx
cmpl $0x18, %ecx
ja 0xa920
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x8(%r14), %r14
incl %r15d
xorl %ecx, %ecx
jmp 0xa8cd
movq 0x8(%r14), %r14
incl %r15d
xorl %esi, %esi
jmp 0xa8c8
movq 0x8(%r14), %rdi
jmp 0xa90f
movq 0x18(%r14), %rdi
xorl %esi, %esi
callq 0xa8af
leal (%rax,%r15), %ebx
incl %ebx
jmp 0xa923
xorl %ebx, %ebx
addl %r15d, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x18(%r14), %rdi
xorl %esi, %esi
callq 0xa8af
movl %eax, %ebx
movq 0x20(%r14), %rdi
xorl %esi, %esi
callq 0xa8af
leal (%rax,%rbx,2), %eax
leal (%r15,%rax), %ebx
incl %ebx
jmp 0xa923
movl 0x8(%r14), %r12d
xorl %r13d, %r13d
testl %r12d, %r12d
cmovlel %r13d, %r12d
pushq $0x1
popq %rbx
cmpq %r13, %r12
je 0xa920
movq 0x18(%r14), %rax
movq (%rax,%r13,8), %rdi
xorl %esi, %esi
callq 0xa8af
addl %eax, %ebx
incq %r13
jmp 0xa963
movl 0x8(%r14), %r12d
xorl %r13d, %r13d
testl %r12d, %r12d
cmovlel %r13d, %r12d
pushq $0x1
popq %rbx
cmpq %r13, %r12
je 0xa920
movq 0x10(%r14), %rax
movq (%rax,%r13,8), %rdi
xorl %esi, %esi
callq 0xa8af
addl %eax, %ebx
incq %r13
jmp 0xa98f