// File: /workspace/github_c_makefile_star2_O1/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, 0x38(%rsp)
leaq 0x7a89(%rip), %rdi      # 0x12d05
callq 0x977f
movq %rax, %rbp
leaq 0x7a88(%rip), %rdi      # 0x12d13
callq 0x977f
movq %rax, %r12
leaq 0x7a7e(%rip), %rdi      # 0x12d18
callq 0x977f
movq %rax, %r14
movq %rax, 0x18(%rsp)
leaq 0x7a71(%rip), %rdi      # 0x12d1f
callq 0x977f
movq %rax, 0x8(%rsp)
leaq 0x7a65(%rip), %rdi      # 0x12d24
callq 0x977f
movq %rax, 0x30(%rsp)
movl $0x7c, %edi
callq 0x9cf9
leaq -0x1c2(%rip), %rsi      # 0xb118
movq 0xfccf(%rip), %r8       # 0x1afb0
xorl %ebx, %ebx
movl $0x2, %edi
movq %rax, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0xa236
movq %rax, %r15
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movb %bl, (%rax)
movq %rbx, 0x8(%rax)
movb $0x15, 0x10(%rax)
movq %r15, 0x18(%rax)
leaq -0x1321(%rip), %rcx     # 0x9ffb
movq %rcx, 0x28(%rax)
leaq 0x35f(%rip), %rsi       # 0xb686
leaq -0x1cbc(%rip), %r8      # 0x9672
movl $0x2, %edi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xa236
movq %rbp, %rdi
movq %rbp, 0x28(%rsp)
movq %rax, %rsi
callq 0x97e9
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movb %bl, (%rax)
movq %rbx, 0x8(%rax)
movb $0x16, %cl
movb %cl, 0x10(%rax)
movq %r14, 0x28(%rax)
leaq 0x330(%rip), %rcx       # 0xb6a5
movq %rcx, 0x20(%rax)
movq %r12, 0x40(%rsp)
movq %r12, %rdi
movq %rax, %rsi
callq 0x97e9
movl $0x2a, %edi
callq 0x9cf9
movq %rax, %r15
movl $0x2b, %edi
callq 0x9cf9
movq %rax, %r12
movl $0x3f, %edi
callq 0x9cf9
movq %rax, %r13
callq 0xa847
leaq 0x7953(%rip), %rdx      # 0x12d0f
leaq 0x7b4b(%rip), %rcx      # 0x12f0e
movq %rax, %rdi
movq 0xfbe3(%rip), %rsi      # 0x1afb0
callq 0xacb8
movq %rax, %r14
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movb %bl, (%rax)
movq %rbx, 0x8(%rax)
movb $0x1, 0x10(%rax)
movl $0x5, %edi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %rax, %r9
xorl %eax, %eax
callq 0xa123
leaq 0x316(%rip), %rsi       # 0xb726
movl $0x2, %edi
movq 0x8(%rsp), %rdx
movq %rax, %rcx
leaq -0x1db2(%rip), %r14     # 0x9672
movq %r14, %r8
xorl %eax, %eax
callq 0xa236
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x97e9
leaq 0x78c9(%rip), %rdx      # 0x12d0b
leaq 0x78c4(%rip), %rcx      # 0x12d0d
movq %rbp, %rdi
movq %r14, %rsi
callq 0xacb8
movq %rax, 0x20(%rsp)
leaq 0x78b1(%rip), %rdx      # 0x12d11
leaq 0x7a97(%rip), %rcx      # 0x12efe
movq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xacb8
movq %rax, %r12
callq 0xa58a
movq %rax, %r13
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movq %rax, %rbp
xorl %eax, %eax
movb %al, (%rbp)
movq %rax, 0x8(%rbp)
xorl %r15d, %r15d
movb $0x11, %al
movb %al, 0x10(%rbp)
movq %r13, 0x18(%rbp)
leaq 0x3bd(%rip), %r14       # 0xb86d
movq %r14, 0x20(%rbp)
leaq 0x786f(%rip), %rdi      # 0x12d2a
callq 0x9ddb
movq %rax, %r13
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movb %r15b, (%rax)
movq %r15, 0x8(%rax)
movb $0x11, %cl
movb %cl, 0x10(%rax)
movq %r13, 0x18(%rax)
movq %rbx, %r13
movq %r14, 0x20(%rax)
movl $0x4, %edi
movq 0x20(%rsp), %rsi
movq %r12, %rdx
movq 0x8(%rsp), %r12
movq %rbp, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xa123
movq %r12, %rdi
movq %rax, %rsi
callq 0x97e9
callq 0xa58a
movq %rax, %r15
leaq 0x79dc(%rip), %rdi      # 0x12efe
callq 0x9ddb
movl $0x2, %edi
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xa123
movq %rax, %r14
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movq %rax, %r15
xorl %ebx, %ebx
movb %bl, (%rax)
movq %rbx, 0x8(%rax)
movb $0x16, %al
movb %al, 0x10(%r15)
movq %r14, 0x28(%r15)
leaq -0x10e4(%rip), %rax     # 0xa483
movq %rax, 0x20(%r15)
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movb %bl, (%rax)
movq %rbx, 0x8(%rax)
xorl %ebx, %ebx
movb $0x11, %cl
movb %cl, 0x10(%rax)
movq %r15, 0x18(%rax)
leaq 0x690(%rip), %rcx       # 0xbc22
movq %rcx, 0x20(%rax)
movq %r13, %rdi
movq %rax, %rsi
callq 0x97e9
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movb %bl, (%rax)
movq %rbx, 0x8(%rax)
movq 0x28(%rsp), %rbx
movb $0x13, 0x10(%rax)
movq %rbx, 0x18(%rax)
movq %rax, %rdi
leaq -0x1f5b(%rip), %rsi     # 0x9672
callq 0xaf7a
movq %rax, %r14
leaq 0x7751(%rip), %rdi      # 0x12d2d
movq 0x38(%rsp), %rsi
callq 0x93c9
movq %rax, %r15
leaq 0x10(%rsp), %rdx
movq %rax, %rdi
movq %r14, %rsi
callq 0x80cd
movl %eax, %ebp
movq %r15, %rdi
callq 0x9459
testl %ebp, %ebp
jne 0xb64b
movq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x7e10
movq %rax, %r12
leaq 0x7721(%rip), %rdi      # 0x12d3f
movq %rax, %rsi
xorl %eax, %eax
callq 0x9852
movq %r13, %rbp
movq %rax, %r13
movq %r15, %rdi
callq 0x7d64
movq %r12, %rdi
movq 0x8(%rsp), %r12
callq 0x23f0
movq %r13, 0x10(%rsp)
movq %rbp, %r13
movq %r14, %rdi
callq 0x9672
movl $0x5, %edi
movq %rbx, %rsi
movq 0x40(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq %r12, %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x9942
movq 0x10(%rsp), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq