// File: /workspace/github_c_makefile_star2_O0/voithos[P]awl/src/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 *p = st->parsers[i];
      if (p->name && strcmp(p->name, x) == 0) { return p; }
    }
    
    /* 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) {
        return mpc_failf("Unknown Parser '%s'!", x);
      }
      
      if (p->name && strcmp(p->name, x) == 0) { return p; }
      
    }
  
  }  
  
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x148d0
cmpl $0x0, %eax
je 0x14771
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x2220
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
cmpl -0x1c(%rbp), %eax
jg 0x1474f
movq -0x18(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movslq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x22a0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movl (%rax), %eax
movl %eax, -0x34(%rbp)
cmpl $0x28, %eax
ja 0x146d6
movq -0x40(%rbp), %rcx
movl -0x34(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x48(%rbp)
jmp 0x146ed
movq -0x40(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x1474a
movl -0x1c(%rbp), %esi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %edx
leaq 0x6b2c(%rip), %rdi      # 0x1b266
movb $0x0, %al
callq 0xdca0
movq %rax, -0x8(%rbp)
jmp 0x148c2
jmp 0x14667
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x8(%rbp)
jmp 0x148c2
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x147d3
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x147c6
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x21d0
cmpl $0x0, %eax
jne 0x147c6
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x148c2
jmp 0x147c8
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x14778
jmp 0x147d5
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movl (%rax), %eax
movl %eax, -0x4c(%rbp)
cmpl $0x28, %eax
ja 0x14803
movq -0x58(%rbp), %rcx
movl -0x4c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x60(%rbp)
jmp 0x1481a
movq -0x58(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movslq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x22a0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
cmpq $0x0, -0x28(%rbp)
jne 0x14892
movq -0x10(%rbp), %rsi
leaq 0x6a15(%rip), %rdi      # 0x1b29a
movb $0x0, %al
callq 0xdca0
movq %rax, -0x8(%rbp)
jmp 0x148c2
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x148bd
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x21d0
cmpl $0x0, %eax
jne 0x148bd
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x148c2
jmp 0x147d5
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)