// File: /workspace/github_c_makefile_star2_O3/mattn[P]orelang/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);
  
  mpc_optimise(RegexEnclose);
  mpc_optimise(Regex);
  mpc_optimise(Term);
  mpc_optimise(Factor);
  mpc_optimise(Base);
  mpc_optimise(Range);
  
  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_cleanup(6, RegexEnclose, Regex, Term, Factor, Base, Range);
  
  mpc_optimise(r.output);
  
  return r.output;
  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
leaq 0xe44b(%rip), %rdi      # 0x1450d
callq 0x44e8
movq %rax, %r15
movq %rax, 0x18(%rsp)
leaq 0xe445(%rip), %rdi      # 0x1451b
callq 0x44e8
movq %rax, %rbx
leaq 0xe43b(%rip), %rdi      # 0x14520
callq 0x44e8
movq %rax, %r13
leaq 0xe433(%rip), %rdi      # 0x14527
callq 0x44e8
movq %rax, 0x38(%rsp)
leaq 0xe427(%rip), %rdi      # 0x1452c
callq 0x44e8
movq %rax, 0x20(%rsp)
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movb $0x9, %r12b
movb %r12b, 0x10(%rax)
movb $0x7c, 0x18(%rax)
leaq 0xe243(%rip), %rbp      # 0x14373
movq %rax, %rdi
movq %rbp, %rsi
movl $0x7c, %edx
xorl %eax, %eax
callq 0x4ac3
leaq -0x1eb(%rip), %rsi      # 0x5f5e
movq 0x15e60(%rip), %r8      # 0x1bfb0
movl $0x2, %edi
movq %rax, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x5053
movq %rax, %r14
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movb $0x13, 0x10(%rax)
movq %r14, 0x18(%rax)
leaq -0x1329(%rip), %rcx     # 0x4e5a
movq %rcx, 0x28(%rax)
leaq 0x3d7(%rip), %rsi       # 0x6565
leaq -0x1dba(%rip), %r8      # 0x43db
movl $0x2, %edi
movq %rbx, 0x30(%rsp)
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x5053
movq %r15, %rdi
movq %rax, %rsi
callq 0x471a
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movb $0x14, %cl
movb %cl, 0x10(%rax)
movq %r13, 0x28(%rax)
movq %r13, 0x28(%rsp)
leaq 0x3a9(%rip), %rcx       # 0x6584
movq %rcx, 0x20(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x471a
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movb %r12b, 0x10(%rax)
movb $0x2a, 0x18(%rax)
movq %rax, %rdi
movq %rbp, %rsi
movl $0x2a, %edx
xorl %eax, %eax
callq 0x4ac3
movq %rax, %r14
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movb %r12b, 0x10(%rax)
movb $0x2b, 0x18(%rax)
movq %rax, %rdi
movq %rbp, %rsi
movl $0x2b, %edx
xorl %eax, %eax
callq 0x4ac3
movq %rax, %r15
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movb %r12b, 0x10(%rax)
movb $0x3f, 0x18(%rax)
movq %rax, %rdi
movq %rbp, %rsi
movl $0x3f, %edx
xorl %eax, %eax
callq 0x4ac3
movq %rax, %rbp
callq 0x579f
leaq 0xfefb(%rip), %rdx      # 0x16175
leaq 0xe4c6(%rip), %rcx      # 0x14747
movq %rax, %rdi
movq 0x15d25(%rip), %rsi     # 0x1bfb0
callq 0x5bcf
movq %rax, %r12
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movb $0x1, 0x10(%rax)
movl $0x5, %edi
movq %r14, %rsi
movq %r15, %rdx
movq %rbp, %rcx
movq %r12, %r8
movq %rax, %r9
xorl %eax, %eax
callq 0x4f4b
leaq 0x332(%rip), %rsi       # 0x65fa
movl $0x2, %edi
movq 0x38(%rsp), %rbx
movq %rbx, %rdx
movq %rax, %rcx
leaq -0x1f04(%rip), %r15     # 0x43db
movq %r15, %r8
xorl %eax, %eax
callq 0x5053
movq %r13, %rdi
movq %rax, %rsi
callq 0x471a
leaq 0xe218(%rip), %rdx      # 0x14513
leaq 0xe213(%rip), %rcx      # 0x14515
movq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0x5bcf
movq %rax, %r14
leaq 0xe200(%rip), %rdx      # 0x14519
leaq 0xe417(%rip), %rcx      # 0x14737
movq 0x20(%rsp), %rdi
movq %r15, %rsi
callq 0x5bcf
movq %rax, %r15
callq 0x54dc
movq %rax, %r12
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movq %rax, %r13
movb $0xf, %al
movb %al, 0x10(%r13)
movq %r12, 0x18(%r13)
leaq 0x38c(%rip), %rbp       # 0x66e7
movq %rbp, 0x20(%r13)
leaq 0xe1cc(%rip), %rdi      # 0x14532
callq 0x4c92
movq %rax, %r12
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movb $0xf, %cl
movb %cl, 0x10(%rax)
movq %r12, 0x18(%rax)
movq %rbp, 0x20(%rax)
movl $0x4, %edi
movq %r14, %rsi
movq %r15, %rdx
movq %r13, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x4f4b
movq %rbx, %rdi
movq %rbx, %r12
movq %rax, %rsi
callq 0x471a
callq 0x54dc
movq %rax, %r14
leaq 0xe378(%rip), %rdi      # 0x14737
callq 0x4c92
movl $0x2, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4f4b
movq %rax, %r14
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movq %rax, %r15
movb $0x14, %al
movb %al, 0x10(%r15)
movq %r14, 0x28(%r15)
leaq -0x106d(%rip), %rax     # 0x538f
movq %rax, 0x20(%r15)
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movb $0xf, %cl
movb %cl, 0x10(%rax)
movq 0x18(%rsp), %rbx
movq %r15, 0x18(%rax)
leaq 0x684(%rip), %rcx       # 0x6aa8
movq %rcx, 0x20(%rax)
movq 0x20(%rsp), %r13
movq %r13, %rdi
movq %rax, %rsi
callq 0x471a
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movb $0x11, 0x10(%rax)
movq %rbx, 0x18(%rax)
movq %rax, %rdi
leaq -0x207e(%rip), %rsi     # 0x43db
callq 0x5e0c
movq %rax, %rbp
movq %rax, %rdi
movl $0x1, %esi
callq 0x99f8
movq %rbx, %rdi
movl $0x1, %esi
callq 0x99f8
movq 0x30(%rsp), %rdi
movl $0x1, %esi
callq 0x99f8
movq 0x28(%rsp), %rdi
movl $0x1, %esi
callq 0x99f8
movq %r12, %rdi
movl $0x1, %esi
callq 0x99f8
movq %r13, %rdi
movl $0x1, %esi
callq 0x99f8
leaq 0xe07b(%rip), %rdi      # 0x14535
movq 0x40(%rsp), %rsi
callq 0x403f
movq %rax, %r14
leaq 0x10(%rsp), %rdx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2dd1
movl %eax, %r15d
movq %r14, %rdi
callq 0x4105
testl %r15d, %r15d
jne 0x651f
movq 0x10(%rsp), %rdi
callq 0x2b28
movq %rax, %r14
leaq 0xe04c(%rip), %rdi      # 0x14547
movq %rax, %rsi
xorl %eax, %eax
callq 0x4783
movq %rax, %r15
movq 0x10(%rsp), %rdi
callq 0x2a7c
movq %r14, %rdi
callq 0x22c0
movq %r15, 0x10(%rsp)
movq %r13, (%rsp)
movl $0x6, %edi
movq %rbp, %rsi
movq %rbx, %rdx
movq 0x30(%rsp), %rcx
movq 0x28(%rsp), %r8
movq %r12, %r9
xorl %eax, %eax
callq 0x4868
movq 0x10(%rsp), %rdi
movl $0x1, %esi
callq 0x99f8
movq 0x10(%rsp), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq