// File: /workspace/github_c_makefile_star2_O1/orangeduck[P]mpc/mpc.c
// Function: mpca_grammar_find_parser
static mpc_parser_t *mpca_grammar_find_parser(char *x, mpca_grammar_st_t *st) {

  int i;
  mpc_parser_t *p;

  /* Case of Number */
  if (is_number(x)) {

    i = strtol(x, NULL, 10);

    while (st->parsers_num <= i) {
      st->parsers_num++;
      st->parsers = realloc(st->parsers, sizeof(mpc_parser_t*) * st->parsers_num);
      st->parsers[st->parsers_num-1] = va_arg(*st->va, mpc_parser_t*);
      if (st->parsers[st->parsers_num-1] == NULL) {
        return mpc_failf("No Parser in position %i! Only supplied %i Parsers!", i, st->parsers_num);
      }
    }

    return st->parsers[st->parsers_num-1];

  /* Case of Identifier */
  } else {

    /* Search Existing Parsers */
    for (i = 0; i < st->parsers_num; i++) {
      mpc_parser_t *q = st->parsers[i];
      if (q == NULL) { return mpc_failf("Unknown Parser '%s'!", x); }
      if (q->name && strcmp(q->name, x) == 0) { return q; }
    }

    /* Search New Parsers */
    while (1) {

      p = va_arg(*st->va, mpc_parser_t*);

      st->parsers_num++;
      st->parsers = realloc(st->parsers, sizeof(mpc_parser_t*) * st->parsers_num);
      st->parsers[st->parsers_num-1] = p;

      if (p == NULL || p->name == NULL) { return mpc_failf("Unknown Parser '%s'!", x); }
      if (p->name && strcmp(p->name, x) == 0) { return p; }

    }

  }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4120
testq %rax, %rax
je 0xd810
movq %rax, %r15
xorl %r13d, %r13d
leaq 0xc34(%rip), %r12       # 0xe421
movsbl (%r14,%r13), %esi
movl $0xb, %edx
movq %r12, %rdi
callq 0x4270
testq %rax, %rax
je 0xd8c2
incq %r13
cmpq %r13, %r15
jne 0xd7ed
movq %r14, %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x4330
movq %rax, %r14
movslq 0x8(%rbx), %rax
cmpl %r14d, %eax
jg 0xd8a7
leaq 0x1(%rax), %rcx
movl %ecx, 0x8(%rbx)
movq 0x10(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x4400
movq %rax, 0x10(%rbx)
movq (%rbx), %rax
movl (%rax), %edx
cmpq $0x28, %rdx
ja 0xd860
movq %rdx, %rcx
addq 0x10(%rax), %rcx
addl $0x8, %edx
movl %edx, (%rax)
jmp 0xd86c
movq 0x8(%rax), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq (%rcx), %rax
movq 0x10(%rbx), %rcx
movslq 0x8(%rbx), %rdx
movq %rax, -0x8(%rcx,%rdx,8)
movq 0x10(%rbx), %rax
cmpq $0x0, -0x8(%rax,%rdx,8)
jne 0xd822
leaq 0xf5d(%rip), %rdi       # 0xe7ec
movl %r14d, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4240
movq 0x10(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x8(%rbx)
jle 0xd93a
xorl %r13d, %r13d
movq 0x10(%rbx), %rax
movq (%rax,%r13,8), %r15
testq %r15, %r15
je 0xd8f1
movq (%r15), %rdi
testq %rdi, %rdi
je 0xd8ec
movq %r14, %rsi
callq 0x42b0
testl %eax, %eax
je 0xd909
movb $0x1, %bpl
jmp 0xd90e
xorl %ebp, %ebp
leaq 0xf26(%rip), %rdi       # 0xe820
movq %r14, %rsi
xorl %eax, %eax
callq 0x4240
movq %rax, %r12
jmp 0xd90e
xorl %ebp, %ebp
movq %r15, %r12
testb %bpl, %bpl
je 0xd8b0
incq %r13
movslq 0x8(%rbx), %rax
cmpq %rax, %r13
jl 0xd8cb
jmp 0xd93a
movq (%r12), %rdi
testq %rdi, %rdi
je 0xd990
movq %r14, %rsi
callq 0x42b0
testl %eax, %eax
je 0xd8b0
movq (%rbx), %rax
movl (%rax), %edx
cmpq $0x28, %rdx
ja 0xd953
movq %rdx, %rcx
addq 0x10(%rax), %rcx
addl $0x8, %edx
movl %edx, (%rax)
jmp 0xd95f
movq 0x8(%rax), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq (%rcx), %r12
movslq 0x8(%rbx), %rax
leaq 0x1(%rax), %rcx
movl %ecx, 0x8(%rbx)
movq 0x10(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x4400
movq %rax, 0x10(%rbx)
movslq 0x8(%rbx), %rcx
movq %r12, -0x8(%rax,%rcx,8)
testq %r12, %r12
jne 0xd921
leaq 0xe89(%rip), %rdi       # 0xe820
movq %r14, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4240