// File: /workspace/github_c_makefile_star2_O3/voithos[P]awl/src/mpc.c
// Function: mpc_re
mpc_parser_t *mpc_re(const char *re) {
  
  char *err_msg;
  mpc_parser_t *err_out;
  mpc_result_t r;
  mpc_parser_t *Regex, *Term, *Factor, *Base, *Range, *RegexEnclose; 
  
  Regex  = mpc_new("regex");
  Term   = mpc_new("term");
  Factor = mpc_new("factor");
  Base   = mpc_new("base");
  Range  = mpc_new("range");
  
  mpc_define(Regex, mpc_and(2, 
    mpcf_re_or,
    Term, 
    mpc_maybe(mpc_and(2, mpcf_snd_free, mpc_char('|'), Regex, free)),
    (mpc_dtor_t)mpc_delete
  ));
  
  mpc_define(Term, mpc_many(mpcf_re_and, Factor));
  
  mpc_define(Factor, mpc_and(2, 
    mpcf_re_repeat,
    Base,
    mpc_or(5,
      mpc_char('*'), mpc_char('+'), mpc_char('?'),
      mpc_brackets(mpc_int(), free),
      mpc_pass()),
    (mpc_dtor_t)mpc_delete
  ));
  
  mpc_define(Base, mpc_or(4,
    mpc_parens(Regex, (mpc_dtor_t)mpc_delete),
    mpc_squares(Range, (mpc_dtor_t)mpc_delete),
    mpc_apply(mpc_escape(), mpcf_re_escape),
    mpc_apply(mpc_noneof(")|"), mpcf_re_escape)
  ));
  
  mpc_define(Range, mpc_apply(
    mpc_many(mpcf_strfold, mpc_or(2, mpc_escape(), mpc_noneof("]"))),
    mpcf_re_range
  ));
  
  RegexEnclose = mpc_whole(mpc_predictive(Regex), (mpc_dtor_t)mpc_delete);
  
  if(!mpc_parse("<mpc_re_compiler>", re, RegexEnclose, &r)) {
    err_msg = mpc_err_string(r.error);
    err_out = mpc_failf("Invalid Regex: %s", err_msg);
    mpc_err_delete(r.error);  
    free(err_msg);
    r.output = err_out;
  }
  
  mpc_delete(RegexEnclose);
  mpc_cleanup(5, Regex, Term, Factor, Base, Range);
  
  return r.output;
  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, 0x30(%rsp)
leaq 0x7ee8(%rip), %rdi      # 0x12d5d
callq 0x9524
movq %rax, %rbp
leaq 0x7ee7(%rip), %rdi      # 0x12d6b
callq 0x9524
movq %rax, %rbx
leaq 0x7edd(%rip), %rdi      # 0x12d70
callq 0x9524
movq %rax, %r14
movq %rax, 0x10(%rsp)
leaq 0x7ed0(%rip), %rdi      # 0x12d77
callq 0x9524
movq %rax, 0x28(%rsp)
leaq 0x7ec4(%rip), %rdi      # 0x12d7c
callq 0x9524
movq %rax, 0x8(%rsp)
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movb $0xb, %cl
movb %cl, 0x10(%rax)
movb $0x7c, 0x18(%rax)
leaq 0x7ce5(%rip), %r15      # 0x12bc6
movq %rax, %rdi
movq %r15, %rsi
movl $0x7c, %edx
xorl %eax, %eax
callq 0x9916
leaq -0x1e9(%rip), %rsi      # 0xad11
movq 0x100af(%rip), %r8      # 0x1afb0
movl $0x2, %edi
movq %rax, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x9ea6
movq %rax, %r12
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movb $0x15, 0x10(%rax)
movq %r12, 0x18(%rax)
leaq -0x1287(%rip), %rcx     # 0x9cad
movq %rcx, 0x28(%rax)
leaq 0x37c(%rip), %rsi       # 0xb2bb
leaq -0x1b2f(%rip), %r8      # 0x9417
movl $0x2, %edi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x9ea6
movq %rbp, %rdi
movq %rbp, 0x20(%rsp)
movq %rax, %rsi
callq 0x9582
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movb $0x16, %cl
movb %cl, 0x10(%rax)
movq %r14, 0x28(%rax)
leaq 0x353(%rip), %rcx       # 0xb2da
movq %rcx, 0x20(%rax)
movq %rbx, 0x38(%rsp)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x9582
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movb $0xb, %bl
movb %bl, 0x10(%rax)
movb $0x2a, 0x18(%rax)
movq %rax, %rdi
movq %r15, %rsi
movl $0x2a, %edx
xorl %eax, %eax
callq 0x9916
movq %rax, %r12
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movb %bl, 0x10(%rax)
movb $0xb, %bl
movb $0x2b, 0x18(%rax)
movq %rax, %rdi
movq %r15, %rsi
movl $0x2b, %edx
xorl %eax, %eax
callq 0x9916
movq %rax, %r13
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movb %bl, 0x10(%rax)
movb $0x3f, 0x18(%rax)
movq %rax, %rdi
movq %r15, %rsi
movl $0x3f, %edx
xorl %eax, %eax
callq 0x9916
movq %rax, %r15
callq 0xa4de
leaq 0x7d3b(%rip), %rdx      # 0x12d67
leaq 0x7f33(%rip), %rcx      # 0x12f66
movq %rax, %rdi
movq 0xff73(%rip), %rsi      # 0x1afb0
callq 0xa90e
movq %rax, %r14
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movb $0x1, 0x10(%rax)
movl $0x5, %edi
movq %r12, %rsi
movq %r13, %rdx
movq %r15, %rcx
movq %r14, %r8
movq %rax, %r9
xorl %eax, %eax
callq 0x9d9e
leaq 0x2d6(%rip), %rsi       # 0xb350
movl $0x2, %edi
movq 0x28(%rsp), %r15
movq %r15, %rdx
movq %rax, %rcx
leaq -0x1c7a(%rip), %rbx     # 0x9417
movq %rbx, %r8
xorl %eax, %eax
callq 0x9ea6
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x9582
leaq 0x7cb4(%rip), %rdx      # 0x12d63
leaq 0x7caf(%rip), %rcx      # 0x12d65
movq %rbp, %rdi
movq %rbx, %rsi
callq 0xa90e
movq %rax, 0x18(%rsp)
leaq 0x7c9c(%rip), %rdx      # 0x12d69
leaq 0x7e82(%rip), %rcx      # 0x12f56
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0xa90e
movq %rax, %r12
callq 0xa21b
movq %rax, %r13
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movq %rax, %rbp
movb $0x11, %bl
movb %bl, 0x10(%rax)
movq %r13, 0x18(%rax)
leaq 0x32f(%rip), %r14       # 0xb43d
movq %r14, 0x20(%rax)
leaq 0x7c69(%rip), %rdi      # 0x12d82
callq 0x9ae5
movq %rax, %r13
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movb %bl, 0x10(%rax)
movq %r13, 0x18(%rax)
movq %r15, %r13
movq %r14, 0x20(%rax)
movl $0x4, %edi
movq 0x18(%rsp), %rsi
movq %r12, %rdx
movq %rbp, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x9d9e
movq %r15, %rdi
movq %rax, %rsi
callq 0x9582
callq 0xa21b
movq %rax, %r15
leaq 0x7de4(%rip), %rdi      # 0x12f56
callq 0x9ae5
movl $0x2, %edi
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x9d9e
movq %rax, %r14
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movq %rax, %r15
movb $0x16, %al
movb %al, 0x10(%r15)
movq %r14, 0x28(%r15)
leaq -0x10d6(%rip), %rax     # 0xa0d9
movq %rax, 0x20(%r15)
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movb %bl, 0x10(%rax)
movq 0x20(%rsp), %rbx
movq %r15, 0x18(%rax)
leaq 0x6b0(%rip), %rcx       # 0xb885
movq %rcx, 0x20(%rax)
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x9582
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movb $0x13, 0x10(%rax)
movq %rbx, 0x18(%rax)
movq %rax, %rdi
leaq -0x1df0(%rip), %rsi     # 0x9417
callq 0xab85
movq %rax, %r14
leaq 0x7b6f(%rip), %rdi      # 0x12d85
movq 0x30(%rsp), %rsi
callq 0x916b
movq %rax, %r15
leaq 0x40(%rsp), %r12
movq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x7d5a
movl %eax, %ebp
movq %r15, %rdi
callq 0x91fb
movq (%r12), %r15
testl %ebp, %ebp
jne 0xb280
movq %r15, %rdi
callq 0x7aa0
movq %rax, %r12
leaq 0x7b3d(%rip), %rdi      # 0x12d97
movq %rax, %rsi
xorl %eax, %eax
callq 0x95eb
movq %r13, %rbp
movq %rax, %r13
movq %r15, %rdi
callq 0x79f4
movq %r12, %rdi
callq 0x23f0
movq %r13, %r15
movq %rbp, %r13
movq %r14, %rdi
callq 0x9417
movl $0x5, %edi
movq %rbx, %rsi
movq 0x38(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %r13, %r8
movq 0x8(%rsp), %r9
xorl %eax, %eax
callq 0x96d0
movq %r15, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq