// File: /workspace/github_c_makefile_star2_O0/orangeduck[P]mpc/mpc.c
// Function: mpc_re_mode
mpc_parser_t *mpc_re_mode(const char *re, int mode) {

  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_to(mpc_escape(), mpcf_re_escape, &mode),
    mpc_apply_to(mpc_noneof(")|"), mpcf_re_escape, &mode)
  ));

  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
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
leaq 0x8fa9(%rip), %rdi      # 0x126f2
callq 0x40c0
movq %rax, -0x30(%rbp)
leaq 0x8fa7(%rip), %rdi      # 0x12700
callq 0x40c0
movq %rax, -0x38(%rbp)
leaq 0x8f9c(%rip), %rdi      # 0x12705
callq 0x40c0
movq %rax, -0x40(%rbp)
leaq 0x8f93(%rip), %rdi      # 0x1270c
callq 0x40c0
movq %rax, -0x48(%rbp)
leaq 0x8f88(%rip), %rdi      # 0x12711
callq 0x40c0
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0xd0(%rbp)
movl $0x7c, %edi
callq 0x4580
movq %rax, %rdx
movq -0x30(%rbp), %rcx
movl $0x2, %edi
movq 0xd74b(%rip), %rsi      # 0x16f10
movq 0xd754(%rip), %r8       # 0x16f20
movb $0x0, %al
callq 0x41c0
movq %rax, %rdi
callq 0x47a0
movq -0xd0(%rbp), %rdx
movq %rax, %rcx
movl $0x2, %edi
leaq 0x2ef(%rip), %rsi       # 0x9ae0
movq 0xd778(%rip), %r8       # 0x16f70
movb $0x0, %al
callq 0x41c0
movq -0xc8(%rbp), %rdi
movq %rax, %rsi
callq 0x40f0
movq -0x38(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x40(%rbp), %rsi
leaq 0x30c(%rip), %rdi       # 0x9b30
callq 0x4280
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x40f0
movq -0x40(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x98(%rbp)
movl $0x2a, %edi
callq 0x4580
movq %rax, -0xb8(%rbp)
movl $0x2b, %edi
callq 0x4580
movq %rax, -0xb0(%rbp)
movl $0x3f, %edi
callq 0x4580
movq %rax, -0xa8(%rbp)
callq 0x4320
movq %rax, %rdi
movq 0xd690(%rip), %rsi      # 0x16f20
callq 0x4060
movq %rax, -0xa0(%rbp)
callq 0x4530
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
movq -0xa8(%rbp), %rcx
movq -0xa0(%rbp), %r8
movq %rax, %r9
movl $0x5, %edi
movb $0x0, %al
callq 0x4790
movq -0x98(%rbp), %rdx
movq %rax, %rcx
movl $0x2, %edi
leaq 0x2ce(%rip), %rsi       # 0x9bb0
movq 0xd687(%rip), %r8       # 0x16f70
movb $0x0, %al
callq 0x41c0
movq -0x90(%rbp), %rdi
movq %rax, %rsi
callq 0x40f0
movq -0x48(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x30(%rbp), %rdi
movq 0xd65e(%rip), %rsi      # 0x16f70
callq 0x4750
movq %rax, -0x88(%rbp)
movq -0x50(%rbp), %rdi
movq 0xd647(%rip), %rsi      # 0x16f70
callq 0x4510
movq %rax, -0x80(%rbp)
callq 0x44f0
movq %rax, %rdi
leaq 0x37f(%rip), %rsi       # 0x9cc0
leaq -0xc(%rbp), %rdx
callq 0x44a0
movq %rax, -0x78(%rbp)
leaq 0x8dc2(%rip), %rdi      # 0x12717
callq 0x4220
movq %rax, %rdi
leaq 0x35c(%rip), %rsi       # 0x9cc0
leaq -0xc(%rbp), %rdx
callq 0x44a0
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq -0x78(%rbp), %rcx
movq %rax, %r8
movl $0x4, %edi
movb $0x0, %al
callq 0x4790
movq -0x70(%rbp), %rdi
movq %rax, %rsi
callq 0x40f0
movq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
callq 0x44f0
movq %rax, -0x68(%rbp)
leaq 0x8fbd(%rip), %rdi      # 0x1296c
callq 0x4220
movq -0x68(%rbp), %rsi
movq %rax, %rdx
movl $0x2, %edi
movb $0x0, %al
callq 0x4790
movq %rax, %rsi
movq 0xd5ef(%rip), %rdi      # 0x16fc0
callq 0x4280
movq %rax, %rdi
leaq 0x5a0(%rip), %rsi       # 0x9f80
callq 0x4240
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x40f0
movq -0x30(%rbp), %rdi
callq 0x40d0
movq %rax, %rdi
movq 0xd56c(%rip), %rsi      # 0x16f70
callq 0x4050
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0x4500
movq -0x30(%rbp), %rdi
callq 0x4500
movq -0x38(%rbp), %rdi
callq 0x4500
movq -0x40(%rbp), %rdi
callq 0x4500
movq -0x48(%rbp), %rdi
callq 0x4500
movq -0x50(%rbp), %rdi
callq 0x4500
movq -0x8(%rbp), %rsi
movq -0x58(%rbp), %rdx
leaq 0x8cc8(%rip), %rdi      # 0x1271a
leaq -0x28(%rbp), %rcx
callq 0x4830
cmpl $0x0, %eax
jne 0x9a9d
movq -0x28(%rbp), %rdi
callq 0x44b0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq 0x8cb4(%rip), %rdi      # 0x1272c
movb $0x0, %al
callq 0x4340
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rdi
callq 0x4550
movq -0x18(%rbp), %rdi
callq 0x4850
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x58(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
movq -0x48(%rbp), %r9
movq -0x50(%rbp), %rax
movl $0x6, %edi
movq %rax, (%rsp)
movb $0x0, %al
callq 0x4700
movq -0x28(%rbp), %rdi
callq 0x4500
movq -0x28(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax,%rax)