// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
xorl %ebp, %ebp
leaq 0x238e(%rip), %rax      # 0xe248
xorl %r12d, %r12d
testl %esi, %esi
jne 0xbecc
cmpb $0x0, 0x31(%r14)
jne 0xbfad
xorl %ebx, %ebx
movzbl 0x30(%r14), %ecx
cmpl $0x5, %ecx
jne 0xbeea
movq 0x8(%r14), %r14
incl %ebx
cmpb $0x0, 0x31(%r14)
je 0xbece
jmp 0xbfa9
addl $-0xf, %ecx
cmpl $0xe, %ecx
ja 0xbfa2
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x8(%r14), %r14
addl %ebx, %r12d
incl %r12d
xorl %esi, %esi
jmp 0xbebd
movq 0x8(%r14), %rdi
jmp 0xbf17
movq 0x18(%r14), %rdi
xorl %esi, %esi
callq 0xbea3
addl %eax, %r12d
addl %r12d, %ebx
incl %ebx
jmp 0xbfb4
movq 0x18(%r14), %rdi
xorl %esi, %esi
callq 0xbea3
movl %eax, %r15d
movq 0x20(%r14), %rdi
xorl %esi, %esi
callq 0xbea3
leal (%rax,%r15,2), %eax
jmp 0xbf1e
movslq 0x8(%r14), %r15
testq %r15, %r15
jle 0xbfa2
movq 0x10(%r14), %r14
movl $0x1, %ebp
xorl %r13d, %r13d
movq (%r14,%r13,8), %rdi
xorl %esi, %esi
callq 0xbea3
addl %eax, %ebp
incq %r13
cmpq %r13, %r15
jne 0xbf5f
jmp 0xbfaf
movslq 0x8(%r14), %r15
testq %r15, %r15
jle 0xbfa2
movq 0x18(%r14), %r14
movl $0x1, %ebp
xorl %r13d, %r13d
movq (%r14,%r13,8), %rdi
xorl %esi, %esi
callq 0xbea3
addl %eax, %ebp
incq %r13
cmpq %r13, %r15
jne 0xbf8b
jmp 0xbfaf
movl $0x1, %ebp
jmp 0xbfaf
xorl %ebp, %ebp
jmp 0xbfaf
xorl %ebx, %ebx
addl %r12d, %ebx
addl %ebp, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq