// File: /workspace/github_c_makefile_star2_O1/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, %rbx
movl $0x1, %r15d
testl %esi, %esi
jne 0xbfd9
cmpb $0x0, 0x31(%rbx)
jne 0xc028
movzbl 0x30(%rbx), %eax
cmpl $0x5, %eax
jne 0xbfed
movq 0x8(%rbx), %rbx
incl %r15d
xorl %esi, %esi
jmp 0xbfcf
movl $0x1, %r14d
addl $-0xf, %eax
cmpl $0xe, %eax
ja 0xc0a6
leaq 0x2242(%rip), %rcx      # 0xe248
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%rbx), %rdi
jmp 0xc019
movq 0x18(%rbx), %rdi
xorl %esi, %esi
callq 0xbfbd
addl %r15d, %eax
jmp 0xc0ac
xorl %r14d, %r14d
jmp 0xc0a6
movq 0x18(%rbx), %rdi
xorl %esi, %esi
callq 0xbfbd
movl %eax, %r14d
movq 0x20(%rbx), %rdi
xorl %esi, %esi
callq 0xbfbd
leal (%rax,%r14,2), %eax
jmp 0xc020
movslq 0x8(%rbx), %r12
testq %r12, %r12
jle 0xc0a6
movq 0x10(%rbx), %rbx
movl $0x1, %r14d
xorl %r13d, %r13d
movq (%rbx,%r13,8), %rdi
xorl %esi, %esi
callq 0xbfbd
addl %eax, %r14d
incq %r13
cmpq %r13, %r12
jne 0xc062
jmp 0xc0a6
movslq 0x8(%rbx), %r12
testq %r12, %r12
jle 0xc0a6
movq 0x18(%rbx), %rbx
movl $0x1, %r14d
xorl %r13d, %r13d
movq (%rbx,%r13,8), %rdi
xorl %esi, %esi
callq 0xbfbd
addl %eax, %r14d
incq %r13
cmpq %r13, %r12
jne 0xc090
leal (%r14,%r15), %eax
decl %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq