// File: /workspace/github_c_makefile_star2_O1/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 0xe193(%rip), %rdi      # 0x144fd
callq 0x45d9
movq %rax, %r15
leaq 0xe192(%rip), %rdi      # 0x1450b
callq 0x45d9
movq %rax, %r12
leaq 0xe188(%rip), %rdi      # 0x14510
callq 0x45d9
movq %rax, %r13
leaq 0xe180(%rip), %rdi      # 0x14517
callq 0x45d9
movq %rax, 0x38(%rsp)
leaq 0xe174(%rip), %rdi      # 0x1451c
callq 0x45d9
movq %rax, 0x18(%rsp)
movl $0x7c, %edi
callq 0x4d64
leaq -0x1bd(%rip), %rsi      # 0x6206
movq 0x15be6(%rip), %r8      # 0x1bfb0
xorl %ebx, %ebx
movl $0x2, %edi
movq %rax, %rdx
movq %r15, %rcx
movq %r15, 0x10(%rsp)
xorl %eax, %eax
callq 0x52a1
movq %rax, %r14
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movb %bl, (%rax)
movq %rbx, 0x8(%rax)
movb $0x13, 0x10(%rax)
movq %r14, 0x18(%rax)
leaq -0x13a4(%rip), %rcx     # 0x5066
movq %rcx, 0x28(%rax)
leaq 0x3a8(%rip), %rsi       # 0x67bd
leaq -0x1f50(%rip), %r8      # 0x44cc
movl $0x2, %edi
movq %r12, 0x28(%rsp)
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x52a1
movq %r15, %rdi
movq %rax, %rsi
callq 0x483f
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movb %bl, (%rax)
movq %rbx, 0x8(%rax)
movb $0x14, %cl
movb %cl, 0x10(%rax)
movq %r13, 0x28(%rax)
movq %r13, 0x20(%rsp)
leaq 0x374(%rip), %rcx       # 0x67dc
movq %rcx, 0x20(%rax)
movq %r12, %rdi
movq %rax, %rsi
callq 0x483f
movl $0x2a, %edi
callq 0x4d64
movq %rax, %r14
movl $0x2b, %edi
callq 0x4d64
movq %rax, %r15
movl $0x3f, %edi
callq 0x4d64
movq %rax, %r12
callq 0x59d1
leaq 0xfd0f(%rip), %rdx      # 0x161b9
leaq 0xe288(%rip), %rcx      # 0x14739
movq %rax, %rdi
movq 0x15af5(%rip), %rsi     # 0x1bfb0
callq 0x5e42
movq %rax, %rbp
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movb %bl, (%rax)
movq %rbx, 0x8(%rax)
movb $0x1, 0x10(%rax)
movl $0x5, %edi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %rbp, %r8
movq %rax, %r9
xorl %eax, %eax
callq 0x518e
leaq 0x35f(%rip), %rsi       # 0x685d
movl $0x2, %edi
movq 0x38(%rsp), %r14
movq %r14, %rdx
movq %rax, %rcx
leaq -0x2049(%rip), %r15     # 0x44cc
movq %r15, %r8
xorl %eax, %eax
callq 0x52a1
movq %r13, %rdi
movq %rax, %rsi
callq 0x483f
leaq 0xdfd2(%rip), %rdx      # 0x14503
leaq 0xdfcd(%rip), %rcx      # 0x14505
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x5e42
movq %rax, 0x30(%rsp)
leaq 0xdfb8(%rip), %rdx      # 0x14509
leaq 0xe1d1(%rip), %rcx      # 0x14729
movq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0x5e42
movq %rax, %r15
callq 0x5714
movq %rax, %r12
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movq %rax, %r13
movb %bl, (%rax)
movq %rbx, 0x8(%rax)
movb $0xf, %al
movb %al, 0x10(%r13)
movq %r12, 0x18(%r13)
leaq 0x40b(%rip), %rbp       # 0x69a4
movq %rbp, 0x20(%r13)
leaq 0xdf7e(%rip), %rdi      # 0x14522
callq 0x4e46
movq %rax, %r12
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movb %bl, (%rax)
movq %rbx, 0x8(%rax)
movb $0xf, %cl
movb %cl, 0x10(%rax)
movq %r12, 0x18(%rax)
movq %rbp, 0x20(%rax)
movl $0x4, %edi
movq 0x30(%rsp), %rsi
movq %r15, %rdx
movq %r13, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x518e
movq %r14, %rdi
movq %r14, %r12
movq %rax, %rsi
callq 0x483f
callq 0x5714
movq %rax, %r14
leaq 0xe124(%rip), %rdi      # 0x14729
callq 0x4e46
movl $0x2, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x518e
movq %rax, %r14
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movq %rax, %r15
movb %bl, (%rax)
movq %rbx, 0x8(%rax)
movb $0x14, %al
movb %al, 0x10(%r15)
movq %r14, 0x28(%r15)
leaq -0x1046(%rip), %rax     # 0x5602
movq %rax, 0x20(%r15)
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movb %bl, (%rax)
movq %rbx, 0x8(%rax)
movb $0xf, %cl
movb %cl, 0x10(%rax)
movq %r15, 0x18(%rax)
leaq 0x5ec(%rip), %rcx       # 0x6c5d
movq %rcx, 0x20(%rax)
movq 0x18(%rsp), %r13
movq %r13, %rdi
movq %rax, %rsi
callq 0x483f
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movb %bl, (%rax)
movq %rbx, 0x8(%rax)
movq 0x10(%rsp), %rbx
movb $0x11, 0x10(%rax)
movq %rbx, 0x18(%rax)
movq %rax, %rdi
leaq -0x21e5(%rip), %rsi     # 0x44cc
callq 0x60b4
movq %rax, %rbp
movq %rax, %rdi
movl $0x1, %esi
callq 0x9c67
movq %rbx, %rdi
movl $0x1, %esi
callq 0x9c67
movq 0x28(%rsp), %rdi
movl $0x1, %esi
callq 0x9c67
movq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0x9c67
movq %r12, %rdi
movl $0x1, %esi
callq 0x9c67
movq %r13, %rdi
movl $0x1, %esi
callq 0x9c67
leaq 0xde13(%rip), %rdi      # 0x14525
movq 0x40(%rsp), %rsi
callq 0x4133
movq %rax, %r14
leaq 0x8(%rsp), %rdx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2e74
movl %eax, %r15d
movq %r14, %rdi
callq 0x41f9
testl %r15d, %r15d
jne 0x6777
movq 0x8(%rsp), %rdi
callq 0x2bc8
movq %rax, %r14
leaq 0xdde4(%rip), %rdi      # 0x14537
movq %rax, %rsi
xorl %eax, %eax
callq 0x48a8
movq %rax, %r15
movq 0x8(%rsp), %rdi
callq 0x2b1c
movq %r14, %rdi
callq 0x22c0
movq %r15, 0x8(%rsp)
movq %r13, (%rsp)
movl $0x6, %edi
movq %rbp, %rsi
movq %rbx, %rdx
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %r8
movq %r12, %r9
xorl %eax, %eax
callq 0x4998
movq 0x8(%rsp), %rdi
movl $0x1, %esi
callq 0x9c67
movq 0x8(%rsp), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq