// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
leaq 0x10b67(%rip), %rdi     # 0x154c2
callq 0x9350
movq %rax, -0x38(%rbp)
leaq 0x11eaf(%rip), %rdi     # 0x1681a
callq 0x9350
movq %rax, -0x40(%rbp)
leaq 0x10b4f(%rip), %rdi     # 0x154ca
callq 0x9350
movq %rax, -0x48(%rbp)
leaq 0x10b48(%rip), %rdi     # 0x154d3
callq 0x9350
movq %rax, -0x50(%rbp)
leaq 0x10b3e(%rip), %rdi     # 0x154d9
callq 0x9350
movq %rax, -0x58(%rbp)
leaq 0x10b34(%rip), %rdi     # 0x154df
callq 0x9350
movq %rax, -0x60(%rbp)
leaq 0x10b30(%rip), %rdi     # 0x154eb
callq 0x9350
movq %rax, -0x68(%rbp)
leaq 0x10b2a(%rip), %rdi     # 0x154f5
callq 0x9350
movq %rax, -0x70(%rbp)
leaq 0x10b23(%rip), %rdi     # 0x154fe
callq 0x9350
movq %rax, -0x78(%rbp)
leaq 0x10b1d(%rip), %rdi     # 0x15508
callq 0x9350
movq %rax, -0x80(%rbp)
leaq 0x10aea(%rip), %rdi     # 0x154e5
callq 0x9350
movq %rax, -0x88(%rbp)
leaq 0x10b02(%rip), %rdi     # 0x15510
callq 0x9350
movq %rax, -0x90(%rbp)
leaq 0x10af9(%rip), %rdi     # 0x1551a
callq 0x9350
movq %rax, -0x98(%rbp)
leaq 0x10aee(%rip), %rdi     # 0x15522
callq 0x9350
movq %rax, -0xa0(%rbp)
leaq 0x10ae5(%rip), %rdi     # 0x1552c
callq 0x9350
movq %rax, -0xa8(%rbp)
leaq 0x108ad(%rip), %rdi     # 0x15307
callq 0x9350
movq %rax, -0xb0(%rbp)
leaq 0x10aca(%rip), %rdi     # 0x15537
callq 0x9350
movq %rax, -0xb8(%rbp)
leaq 0x10abd(%rip), %rdi     # 0x1553d
callq 0x9350
movq %rax, -0xc0(%rbp)
movq -0x38(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x48(%rbp), %r8
movq -0x50(%rbp), %r9
movq -0x58(%rbp), %rax
movq %rax, -0x190(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x180(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x88(%rbp), %r13
movq -0x90(%rbp), %r12
movq -0x98(%rbp), %r15
movq -0xa0(%rbp), %r14
movq -0xa8(%rbp), %rbx
movq -0xb0(%rbp), %r11
movq -0xb8(%rbp), %r10
movq -0xc0(%rbp), %rax
movq %rax, -0x160(%rbp)
xorl %edi, %edi
leaq 0x10a1b(%rip), %rsi     # 0x15541
xorl %eax, %eax
movq -0x190(%rbp), %rax
movq %rax, (%rsp)
movq -0x188(%rbp), %rax
movq %rax, 0x8(%rsp)
movq -0x180(%rbp), %rax
movq %rax, 0x10(%rsp)
movq -0x178(%rbp), %rax
movq %rax, 0x18(%rsp)
movq -0x170(%rbp), %rax
movq %rax, 0x20(%rsp)
movq -0x168(%rbp), %rax
movq %rax, 0x28(%rsp)
movq -0x160(%rbp), %rax
movq %r13, 0x30(%rsp)
movq %r12, 0x38(%rsp)
movq %r15, 0x40(%rsp)
movq %r14, 0x48(%rsp)
movq %rbx, 0x50(%rsp)
movq %r11, 0x58(%rsp)
movq %r10, 0x60(%rsp)
movq %rax, 0x68(%rsp)
movq $0x0, 0x70(%rsp)
movb $0x0, %al
callq 0xff70
movq %rax, -0xc8(%rbp)
cmpq $0x0, -0xc8(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x10800(%rip), %rsi     # 0x153cc
leaq 0x10167(%rip), %rdx     # 0x14d3a
movl $0xdc, %ecx
callq 0x5780
leaq 0x10c94(%rip), %rdi     # 0x15878
leaq 0x129ff(%rip), %rsi     # 0x175ea
callq 0xd8f0
movq %rax, -0x100(%rbp)
leaq 0x10062(%rip), %rdi     # 0x14c60
leaq 0x10c6b(%rip), %rsi     # 0x15870
callq 0xd8f0
movq %rax, -0x120(%rbp)
leaq 0x10c5a(%rip), %rdi     # 0x15872
leaq 0x129cb(%rip), %rsi     # 0x175ea
callq 0xd8f0
movq %rax, -0x118(%rbp)
leaq 0x10c4c(%rip), %rdi     # 0x1587e
leaq 0x10c63(%rip), %rsi     # 0x1589c
callq 0xd8f0
movq %rax, -0x110(%rbp)
leaq 0x10014(%rip), %rdi     # 0x14c60
leaq 0x11a8b(%rip), %rsi     # 0x166de
callq 0xd8f0
movq %rax, -0x108(%rbp)
leaq 0x10c56(%rip), %rdi     # 0x158bc
leaq 0x10c70(%rip), %rsi     # 0x158dd
callq 0xd8f0
movq %rax, -0x140(%rbp)
leaq 0xffe0(%rip), %rdi      # 0x14c60
leaq 0x129d2(%rip), %rsi     # 0x17659
callq 0xd8f0
movq %rax, -0x138(%rbp)
leaq 0x10bf2(%rip), %rdi     # 0x1588c
leaq 0x12953(%rip), %rsi     # 0x175f4
callq 0xd8f0
movq %rax, -0x150(%rbp)
leaq 0x10bd8(%rip), %rdi     # 0x1588c
leaq 0x117b3(%rip), %rsi     # 0x1646e
callq 0xd8f0
movq %rax, -0x158(%rbp)
leaq 0x10bb6(%rip), %rdi     # 0x15884
leaq 0x1059d(%rip), %rsi     # 0x15272
callq 0xd8f0
movq -0x158(%rbp), %rdx
movq %rax, %rcx
movl $0x2, %edi
leaq 0x10c06(%rip), %rsi     # 0x158f6
movb $0x0, %al
callq 0xda00
movq -0x150(%rbp), %rdx
movq %rax, %rcx
movl $0x2, %edi
leaq 0x10be9(%rip), %rsi     # 0x158f6
movb $0x0, %al
callq 0xda00
movq %rax, -0x148(%rbp)
leaq 0x10bde(%rip), %rdi     # 0x15900
leaq 0x128c1(%rip), %rsi     # 0x175ea
callq 0xd8f0
movq -0x148(%rbp), %rdx
movq %rax, %rcx
movl $0x2, %edi
leaq 0x10b9e(%rip), %rsi     # 0x158e2
movb $0x0, %al
callq 0xda00
movq %rax, -0x130(%rbp)
leaq 0xff07(%rip), %rdi      # 0x14c60
leaq 0x11972(%rip), %rsi     # 0x166d2
callq 0xd8f0
movq %rax, -0x128(%rbp)
leaq 0x10b8d(%rip), %rdi     # 0x15900
leaq 0x12870(%rip), %rsi     # 0x175ea
callq 0xd8f0
movq -0x140(%rbp), %rdx
movq -0x138(%rbp), %rcx
movq -0x130(%rbp), %r8
movq -0x128(%rbp), %r9
movl $0x5, %edi
leaq 0x10afd(%rip), %rsi     # 0x158a4
movq %rax, (%rsp)
movb $0x0, %al
callq 0xda00
movq -0x120(%rbp), %rdx
movq -0x118(%rbp), %rcx
movq -0x110(%rbp), %r8
movq -0x108(%rbp), %r9
movl $0x5, %edi
leaq 0x10a8b(%rip), %rsi     # 0x15865
movq %rax, (%rsp)
movb $0x0, %al
callq 0xda00
movq %rax, -0xf8(%rbp)
leaq 0x10a85(%rip), %rdi     # 0x15878
leaq 0x127f0(%rip), %rsi     # 0x175ea
callq 0xd8f0
movq -0x100(%rbp), %rdx
movq -0xf8(%rbp), %rcx
movq %rax, %r8
movl $0x3, %edi
leaq 0x1280e(%rip), %rsi     # 0x1762a
movb $0x0, %al
callq 0xda00
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x10adb(%rip), %rsi     # 0x15911
leaq 0x8df3(%rip), %rcx      # 0xdc30
leaq 0x8a2c(%rip), %r8       # 0xd870
leaq 0x91a5(%rip), %r9       # 0xdff0
callq 0xd780
movl %eax, %edi
leaq 0x10ad2(%rip), %rsi     # 0x1592b
leaq 0xfeda(%rip), %rdx      # 0x14d3a
movl $0xfb, %ecx
callq 0x5780
movq -0x30(%rbp), %rdi
callq 0xd870
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %r8
movq -0x58(%rbp), %r9
movq -0x60(%rbp), %rax
movq -0x68(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
movq -0x70(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
movq -0x78(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
movq -0x80(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
movq -0x88(%rbp), %r13
movq -0x90(%rbp), %r12
movq -0x98(%rbp), %r15
movq -0xa0(%rbp), %r14
movq -0xa8(%rbp), %rbx
movq -0xb0(%rbp), %r11
movq -0xb8(%rbp), %r10
movq -0xc0(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
movl $0x12, %edi
movq %rax, (%rsp)
movq -0xf0(%rbp), %rax
movq %rax, 0x8(%rsp)
movq -0xe8(%rbp), %rax
movq %rax, 0x10(%rsp)
movq -0xe0(%rbp), %rax
movq %rax, 0x18(%rsp)
movq -0xd8(%rbp), %rax
movq %rax, 0x20(%rsp)
movq -0xd0(%rbp), %rax
movq %r13, 0x28(%rsp)
movq %r12, 0x30(%rsp)
movq %r15, 0x38(%rsp)
movq %r14, 0x40(%rsp)
movq %rbx, 0x48(%rsp)
movq %r11, 0x50(%rsp)
movq %r10, 0x58(%rsp)
movq %rax, 0x60(%rsp)
movb $0x0, %al
callq 0x9a50
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw (%rax,%rax)