// File: /workspace/github_c_makefile_star2_O0/orangeduck[P]mpc/mpc.c
// Function: mpca_grammar_st
mpc_parser_t *mpca_grammar_st(const char *grammar, mpca_grammar_st_t *st) {

  char *err_msg;
  mpc_parser_t *err_out;
  mpc_result_t r;
  mpc_parser_t *GrammarTotal, *Grammar, *Term, *Factor, *Base;

  GrammarTotal = mpc_new("grammar_total");
  Grammar = mpc_new("grammar");
  Term = mpc_new("term");
  Factor = mpc_new("factor");
  Base = mpc_new("base");

  mpc_define(GrammarTotal,
    mpc_predictive(mpc_total(Grammar, mpc_soft_delete))
  );

  mpc_define(Grammar, mpc_and(2, mpcaf_grammar_or,
    Term,
    mpc_maybe(mpc_and(2, mpcf_snd_free, mpc_sym("|"), Grammar, free)),
    mpc_soft_delete
  ));

  mpc_define(Term, mpc_many1(mpcaf_grammar_and, Factor));

  mpc_define(Factor, mpc_and(2, mpcaf_grammar_repeat,
    Base,
      mpc_or(6,
        mpc_sym("*"),
        mpc_sym("+"),
        mpc_sym("?"),
        mpc_sym("!"),
        mpc_tok_brackets(mpc_int(), free),
        mpc_pass()),
    mpc_soft_delete
  ));

  mpc_define(Base, mpc_or(5,
    mpc_apply_to(mpc_tok(mpc_string_lit()), mpcaf_grammar_string, st),
    mpc_apply_to(mpc_tok(mpc_char_lit()),   mpcaf_grammar_char, st),
    mpc_tok(mpc_and(3, mpcaf_fold_regex, mpc_regex_lit(), mpc_many(mpcf_strfold, mpc_oneof("ms")), mpc_lift_val(st), free, free)),
    mpc_apply_to(mpc_tok_braces(mpc_or(2, mpc_digits(), mpc_ident()), free), mpcaf_grammar_id, st),
    mpc_tok_parens(Grammar, mpc_soft_delete)
  ));

  mpc_optimise(GrammarTotal);
  mpc_optimise(Grammar);
  mpc_optimise(Factor);
  mpc_optimise(Term);
  mpc_optimise(Base);

  if(!mpc_parse("<mpc_grammar_compiler>", grammar, GrammarTotal, &r)) {
    err_msg = mpc_err_string(r.error);
    err_out = mpc_failf("Invalid Grammar: %s", err_msg);
    mpc_err_delete(r.error);
    free(err_msg);
    r.output = err_out;
  }

  mpc_cleanup(5, GrammarTotal, Grammar, Term, Factor, Base);

  mpc_optimise(r.output);

  return (st->flags & MPCA_LANG_PREDICTIVE) ? mpc_predictive(r.output) : r.output;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x5e2a(%rip), %rdi      # 0x12754
callq 0x40c0
movq %rax, -0x30(%rbp)
leaq 0x5e28(%rip), %rdi      # 0x12762
callq 0x40c0
movq %rax, -0x38(%rbp)
leaq 0x5db6(%rip), %rdi      # 0x12700
callq 0x40c0
movq %rax, -0x40(%rbp)
leaq 0x5dab(%rip), %rdi      # 0x12705
callq 0x40c0
movq %rax, -0x48(%rbp)
leaq 0x5da2(%rip), %rdi      # 0x1270c
callq 0x40c0
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x38(%rbp), %rdi
leaq 0x3e7(%rip), %rsi       # 0xcd70
callq 0x4650
movq %rax, %rdi
callq 0x40d0
movq -0xe8(%rbp), %rdi
movq %rax, %rsi
callq 0x40f0
movq -0x38(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq 0x5d56(%rip), %rdi      # 0x12718
callq 0x47b0
movq %rax, %rdx
movq -0x38(%rbp), %rcx
movl $0x2, %edi
movq 0xa536(%rip), %rsi      # 0x16f10
movq 0xa53f(%rip), %r8       # 0x16f20
movb $0x0, %al
callq 0x41c0
movq %rax, %rdi
callq 0x47a0
movq -0xe0(%rbp), %rdx
movq %rax, %rcx
movl $0x2, %edi
leaq 0x38a(%rip), %rsi       # 0xcd90
leaq 0x363(%rip), %r8        # 0xcd70
movb $0x0, %al
callq 0x41c0
movq -0xd8(%rbp), %rdi
movq %rax, %rsi
callq 0x40f0
movq -0x40(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x48(%rbp), %rsi
leaq 0x3a7(%rip), %rdi       # 0xcde0
callq 0x4250
movq -0xd0(%rbp), %rdi
movq %rax, %rsi
callq 0x40f0
movq -0x48(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq 0x5d00(%rip), %rdi      # 0x1276a
callq 0x47b0
movq %rax, -0xc8(%rbp)
leaq 0x5cef(%rip), %rdi      # 0x1276c
callq 0x47b0
movq %rax, -0xc0(%rbp)
leaq 0x5ef7(%rip), %rdi      # 0x12987
callq 0x47b0
movq %rax, -0xb8(%rbp)
leaq 0x5f4c(%rip), %rdi      # 0x129ef
callq 0x47b0
movq %rax, -0xb0(%rbp)
callq 0x4320
movq %rax, %rdi
movq 0xa462(%rip), %rsi      # 0x16f20
callq 0x43e0
movq %rax, -0xa8(%rbp)
callq 0x4530
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
movq -0xb8(%rbp), %rcx
movq -0xb0(%rbp), %r8
movq -0xa8(%rbp), %r9
movl $0x6, %edi
movq %rax, (%rsp)
movb $0x0, %al
callq 0x4790
movq -0xa0(%rbp), %rdx
movq %rax, %rcx
movl $0x2, %edi
leaq 0x338(%rip), %rsi       # 0xce50
leaq 0x251(%rip), %r8        # 0xcd70
movb $0x0, %al
callq 0x41c0
movq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0x40f0
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
callq 0x4310
movq %rax, %rdi
callq 0x4780
movq %rax, %rdi
movq -0x10(%rbp), %rdx
leaq 0x418(%rip), %rsi       # 0xcf70
callq 0x44a0
movq %rax, -0x78(%rbp)
callq 0x4680
movq %rax, %rdi
callq 0x4780
movq %rax, %rdi
movq -0x10(%rbp), %rdx
leaq 0x494(%rip), %rsi       # 0xd010
callq 0x44a0
movq %rax, -0x70(%rbp)
callq 0x4760
movq %rax, -0x90(%rbp)
leaq 0x5bd6(%rip), %rdi      # 0x1276e
callq 0x4080
movq %rax, %rsi
movq 0xa419(%rip), %rdi      # 0x16fc0
callq 0x4280
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
callq 0x42b0
movq -0x90(%rbp), %rdx
movq -0x88(%rbp), %rcx
movq %rax, %r8
movl $0x3, %edi
leaq 0x4d7(%rip), %rsi       # 0xd0b0
movq 0xa340(%rip), %rax      # 0x16f20
movq %rax, %r9
movq %rax, (%rsp)
movb $0x0, %al
callq 0x41c0
movq %rax, %rdi
callq 0x4780
movq %rax, -0x68(%rbp)
callq 0x4260
movq %rax, -0x80(%rbp)
callq 0x46d0
movq -0x80(%rbp), %rsi
movq %rax, %rdx
movl $0x2, %edi
movb $0x0, %al
callq 0x4790
movq %rax, %rdi
movq 0xa2fb(%rip), %rsi      # 0x16f20
callq 0x4420
movq %rax, %rdi
movq -0x10(%rbp), %rdx
leaq 0x578(%rip), %rsi       # 0xd1b0
callq 0x44a0
movq %rax, -0x60(%rbp)
movq -0x38(%rbp), %rdi
leaq 0x124(%rip), %rsi       # 0xcd70
callq 0x4490
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq -0x68(%rbp), %rcx
movq -0x60(%rbp), %r8
movq %rax, %r9
movl $0x5, %edi
movb $0x0, %al
callq 0x4790
movq -0x58(%rbp), %rdi
movq %rax, %rsi
callq 0x40f0
movq -0x30(%rbp), %rdi
callq 0x4500
movq -0x38(%rbp), %rdi
callq 0x4500
movq -0x48(%rbp), %rdi
callq 0x4500
movq -0x40(%rbp), %rdi
callq 0x4500
movq -0x50(%rbp), %rdi
callq 0x4500
movq -0x8(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq 0x5ab9(%rip), %rdi      # 0x12771
leaq -0x28(%rbp), %rcx
callq 0x4830
cmpl $0x0, %eax
jne 0xcd03
movq -0x28(%rbp), %rdi
callq 0x44b0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq 0x5aaa(%rip), %rdi      # 0x12788
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 -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x48(%rbp), %r8
movq -0x50(%rbp), %r9
movl $0x5, %edi
movb $0x0, %al
callq 0x4700
movq -0x28(%rbp), %rdi
callq 0x4500
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xcd4d
movq -0x28(%rbp), %rdi
callq 0x40d0
movq %rax, -0xf0(%rbp)
jmp 0xcd58
movq -0x28(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopl (%rax,%rax)