// File: /workspace/github_c_makefile_star2_O2/orangeduck[P]mpc/tests/grammar.c
// Function: test_qscript
void test_qscript(void) {
  
  mpc_ast_t *t0;
  mpc_parser_t *Qscript = mpc_new("qscript");
  mpc_parser_t *Comment = mpc_new("comment");
  mpc_parser_t *Resource = mpc_new("resource");
  mpc_parser_t *Rtype = mpc_new("rtype");
  mpc_parser_t *Rname = mpc_new("rname");
  mpc_parser_t *InnerBlock = mpc_new("inner_block");
  mpc_parser_t *Statement = mpc_new("statement");
  mpc_parser_t *Function = mpc_new("function");
  mpc_parser_t *Parameter = mpc_new("parameter");
  mpc_parser_t *Literal = mpc_new("literal");
  mpc_parser_t *Block = mpc_new("block");
  mpc_parser_t *Seperator = mpc_new("seperator");
  mpc_parser_t *Qstring = mpc_new("qstring");
  mpc_parser_t *SimpleStr = mpc_new("simplestr");
  mpc_parser_t *ComplexStr = mpc_new("complexstr");
  mpc_parser_t *Number = mpc_new("number");
  mpc_parser_t *Float = mpc_new("float");
  mpc_parser_t *Int = mpc_new("int");
  
  mpc_err_t *err = mpca_lang(0,
    "  qscript        : /^/ (<comment> | <resource>)* /$/ ;\n"
    "   comment     : '#' /[^\\n]*/ ;\n"
    "resource       : '[' (<rtype> <rname>) ']' <inner_block> ;\n"
    "   rtype       : /[*]*/ ;\n"
    "   rname       : <qstring> ;\n"
    "\n"
    "inner_block    : (<comment> | <statement>)* ;\n"
    "   statement   : <function> '(' (<comment> | <parameter> | <block>)* ')'  <seperator> ;\n"
    "   function    : <qstring> ;\n"
    "   parameter   : (<statement> | <literal>) ;\n"
    "      literal  : (<number> | <qstring>) <seperator> ;\n"
    "   block       : '{' <inner_block> '}' ;\n"
    "   seperator   : ',' | \"\" ;\n"
    "\n"
    "qstring        : (<complexstr> | <simplestr>) <qstring>* ;\n"
    "   simplestr   : /[a-zA-Z0-9_!@#$%^&\\*_+\\-\\.=\\/<>]+/ ;\n"
    "   complexstr  : (/\"[^\"]*\"/ | /'[^']*'/) ;\n"
    "\n"
    "number         : (<float> | <int>) ;\n"
    "   float       : /[-+]?[0-9]+\\.[0-9]+/ ;\n"
    "   int         : /[-+]?[0-9]+/ ;\n",
  Qscript, Comment, Resource, Rtype, Rname, InnerBlock, Statement, Function,
  Parameter, Literal, Block, Seperator, Qstring, SimpleStr, ComplexStr, Number,
  Float, Int, NULL);
 
  PT_ASSERT(err == NULL);
  
  t0 = mpc_ast_build(3, ">",
          mpc_ast_new("regex", ""),
          mpc_ast_build(5, "resource|>",
            mpc_ast_new("char", "["),
            mpc_ast_new("rtype|regex", ""),
            mpc_ast_new("rname|qstring|simplestr|regex", "my_func"),
            mpc_ast_new("char", "]"),
            mpc_ast_build(5, "inner_block|statement|>",
              mpc_ast_new("function|qstring|simplestr|regex", "echo"),
              mpc_ast_new("char", "("),
              mpc_ast_build(2, "parameter|literal|>",
                mpc_ast_build(2, "qstring|>",
                  mpc_ast_new("simplestr|regex", "a"),
                  mpc_ast_build(2, "qstring|>",
                    mpc_ast_new("simplestr|regex", "b"),
                    mpc_ast_new("qstring|simplestr|regex", "c")
                  )
                ),
                mpc_ast_new("seperator|string", "")
              ),
              mpc_ast_new("char", ")"),
              mpc_ast_new("seperator|string", "")
            )
          ),
          mpc_ast_new("regex", ""));
  
  PT_ASSERT(mpc_test_pass(Qscript, "[my_func]\n  echo (a b c)\n", t0,
    (int(*)(const void*,const void*))mpc_ast_eq,
    (mpc_dtor_t)mpc_ast_delete,
    (void(*)(const void*))mpc_ast_print));
  
  mpc_ast_delete(t0);

  mpc_cleanup(18, Qscript, Comment, Resource, Rtype, Rname, InnerBlock,
  Statement, Function, Parameter, Literal, Block, Seperator, Qstring,
  SimpleStr, ComplexStr, Number, Float, Int);
  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
leaq 0xb119(%rip), %rdi      # 0xe4c2
callq 0x6a1e
movq %rax, 0x48(%rsp)
leaq 0xc4a4(%rip), %rdi      # 0xf85e
callq 0x6a1e
movq %rax, 0x58(%rsp)
leaq 0xb0ff(%rip), %rdi      # 0xe4ca
callq 0x6a1e
movq %rax, 0x50(%rsp)
leaq 0xb0f7(%rip), %rdi      # 0xe4d3
callq 0x6a1e
movq %rax, 0x40(%rsp)
leaq 0xb0ec(%rip), %rdi      # 0xe4d9
callq 0x6a1e
movq %rax, 0x38(%rsp)
leaq 0xb0e1(%rip), %rdi      # 0xe4df
callq 0x6a1e
movq %rax, 0x30(%rsp)
leaq 0xb0dc(%rip), %rdi      # 0xe4eb
callq 0x6a1e
movq %rax, 0x28(%rsp)
leaq 0xb0d5(%rip), %rdi      # 0xe4f5
callq 0x6a1e
movq %rax, 0x20(%rsp)
leaq 0xb0cd(%rip), %rdi      # 0xe4fe
callq 0x6a1e
movq %rax, 0x18(%rsp)
leaq 0xb0c6(%rip), %rdi      # 0xe508
callq 0x6a1e
movq %rax, 0x10(%rsp)
leaq 0xb092(%rip), %rdi      # 0xe4e5
callq 0x6a1e
movq %rax, 0x8(%rsp)
leaq 0xb0ac(%rip), %rdi      # 0xe510
callq 0x6a1e
movq %rax, %rbx
movq %rax, 0xc0(%rsp)
leaq 0xb09f(%rip), %rdi      # 0xe51a
callq 0x6a1e
movq %rax, %r15
movq %rax, 0xb8(%rsp)
leaq 0xb090(%rip), %rdi      # 0xe522
callq 0x6a1e
movq %rax, %rbp
movq %rax, 0xb0(%rsp)
leaq 0xb083(%rip), %rdi      # 0xe52c
callq 0x6a1e
movq %rax, %r12
movq %rax, 0xa8(%rsp)
leaq 0xae47(%rip), %rdi      # 0xe307
callq 0x6a1e
movq %rax, %r13
movq %rax, 0xa0(%rsp)
leaq 0xb060(%rip), %rdi      # 0xe537
callq 0x6a1e
movq %rax, %r14
movq %rax, 0x98(%rsp)
leaq 0xb04f(%rip), %rdi      # 0xe53d
callq 0x6a1e
movq %rax, 0x90(%rsp)
subq $0x80, %rsp
movq %rax, 0x68(%rsp)
movq %r14, 0x60(%rsp)
movq %r13, 0x58(%rsp)
movq %r12, 0x50(%rsp)
movq %rbp, 0x48(%rsp)
movq %r15, 0x40(%rsp)
movq %rbx, 0x38(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, (%rsp)
andq $0x0, 0x70(%rsp)
leaq 0xafb5(%rip), %rsi      # 0xe541
xorl %edi, %edi
movq 0xc8(%rsp), %rdx
movq 0xd8(%rsp), %rcx
movq 0xd0(%rsp), %r8
movq 0xc0(%rsp), %r9
xorl %eax, %eax
callq 0xafa2
addq $0x80, %rsp
xorl %edi, %edi
testq %rax, %rax
sete %dil
leaq 0xae00(%rip), %rsi      # 0xe3cc
leaq 0xa767(%rip), %rdx      # 0xdd3a
movl $0xdc, %ecx
callq 0x4040
leaq 0xb294(%rip), %rdi      # 0xe878
leaq 0xcea7(%rip), %rbx      # 0x10492
movq %rbx, %rsi
callq 0x9743
movq %rax, 0x88(%rsp)
leaq 0xa65e(%rip), %r12      # 0xdc60
leaq 0xb267(%rip), %rsi      # 0xe870
movq %r12, %rdi
callq 0x9743
movq %rax, 0x80(%rsp)
leaq 0xb252(%rip), %rdi      # 0xe872
movq %rbx, %rsi
callq 0x9743
movq %rax, 0x78(%rsp)
leaq 0xb24a(%rip), %rdi      # 0xe87e
leaq 0xb261(%rip), %rsi      # 0xe89c
callq 0x9743
movq %rax, 0x70(%rsp)
leaq 0xc0d6(%rip), %rsi      # 0xf722
movq %r12, %rdi
callq 0x9743
movq %rax, 0x68(%rsp)
leaq 0xb25c(%rip), %rdi      # 0xe8bc
leaq 0xb276(%rip), %rsi      # 0xe8dd
callq 0x9743
movq %rax, 0x60(%rsp)
leaq 0xce89(%rip), %rsi      # 0x10501
movq %r12, %rdi
callq 0x9743
movq %rax, %r14
leaq 0xb202(%rip), %rbx      # 0xe88c
leaq 0xce0b(%rip), %rsi      # 0x1049c
movq %rbx, %rdi
callq 0x9743
movq %rax, %r15
leaq 0xbe0f(%rip), %rsi      # 0xf4b2
movq %rbx, %rdi
callq 0x9743
movq %rax, %rbx
leaq 0xb1cf(%rip), %rdi      # 0xe884
leaq 0xabb6(%rip), %rsi      # 0xe272
callq 0x9743
leaq 0xb22e(%rip), %r13      # 0xe8f6
pushq $0x2
popq %rbp
movl %ebp, %edi
movq %r13, %rsi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x97b5
movl %ebp, %edi
movq %r13, %rsi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x97b5
movq %rax, %rbx
leaq 0xb207(%rip), %r15      # 0xe900
movq %r15, %rdi
leaq 0xcd8f(%rip), %r13      # 0x10492
movq %r13, %rsi
callq 0x9743
leaq 0xb1d0(%rip), %rsi      # 0xe8e2
movl %ebp, %edi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x97b5
movq %rax, %rbx
leaq 0xbfeb(%rip), %rsi      # 0xf716
movq %r12, %rdi
callq 0x9743
movq %rax, %r12
movq %r15, %rdi
movq %r13, %rsi
callq 0x9743
movq %rax, %r10
subq $0x8, %rsp
leaq 0xb155(%rip), %rsi      # 0xe8a4
pushq $0x5
popq %rbp
movl %ebp, %edi
movq 0x68(%rsp), %rdx
movq %r14, %rcx
movq %rbx, %r8
movq %r12, %r9
xorl %eax, %eax
pushq %r10
callq 0x97b5
popq %rcx
popq %rdx
movq %rax, %r10
subq $0x8, %rsp
leaq 0xb0ea(%rip), %rsi      # 0xe865
movl %ebp, %edi
movq 0x88(%rsp), %rdx
movq 0x80(%rsp), %rcx
movq 0x78(%rsp), %r8
movq 0x70(%rsp), %r9
xorl %eax, %eax
pushq %r10
callq 0x97b5
popq %rcx
popq %rdx
movq %rax, %rbx
leaq 0xb0cc(%rip), %rdi      # 0xe878
movq %r13, %rsi
callq 0x9743
leaq 0xcd17(%rip), %rsi      # 0x104d2
pushq $0x3
popq %rdi
movq 0x88(%rsp), %rdx
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x97b5
movq %rax, %rbx
leaq 0xb134(%rip), %rsi      # 0xe911
leaq 0x6138(%rip), %rcx      # 0x991c
leaq 0x5f08(%rip), %r8       # 0x96f3
leaq 0x6303(%rip), %r9       # 0x9af5
movq 0x48(%rsp), %r14
movq %r14, %rdi
movq %rax, %rdx
callq 0x9642
leaq 0xb122(%rip), %rsi      # 0xe92b
movl %eax, %edi
leaq 0xa528(%rip), %rdx      # 0xdd3a
movl $0xfb, %ecx
callq 0x4040
movq %rbx, %rdi
callq 0x96f3
subq $0x8, %rsp
pushq $0x12
popq %rdi
movq %r14, %rsi
movq 0x60(%rsp), %rdx
movq 0x58(%rsp), %rcx
movq 0x48(%rsp), %r8
movq 0x40(%rsp), %r9
xorl %eax, %eax
pushq 0x98(%rsp)
pushq 0xa8(%rsp)
pushq 0xb8(%rsp)
pushq 0xc8(%rsp)
pushq 0xd8(%rsp)
pushq 0xe8(%rsp)
pushq 0xf8(%rsp)
pushq 0x48(%rsp)
pushq 0x58(%rsp)
pushq 0x68(%rsp)
pushq 0x78(%rsp)
pushq 0x88(%rsp)
pushq 0x98(%rsp)
callq 0x6e12
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq