// File: /workspace/github_c_makefile_star2_O0/orangeduck[P]mpc/examples/lispy.c
// Function: main
int main(int argc, char **argv) {
  
  mpc_result_t r;  
  
  mpc_parser_t* Number  = mpc_new("number");
  mpc_parser_t* Symbol  = mpc_new("symbol");
  mpc_parser_t* String  = mpc_new("string");
  mpc_parser_t* Comment = mpc_new("comment");
  mpc_parser_t* Sexpr   = mpc_new("sexpr");
  mpc_parser_t* Qexpr   = mpc_new("qexpr");
  mpc_parser_t* Expr    = mpc_new("expr");
  mpc_parser_t* Lispy   = mpc_new("lispy");

  mpca_lang(MPCA_LANG_PREDICTIVE,
    " number  \"number\"  : /[0-9]+/ ;                         "
    " symbol  \"symbol\"  : /[a-zA-Z0-9_+\\-*\\/\\\\=<>!&]+/ ; "
    " string  \"string\"  : /\"(\\\\.|[^\"])*\"/ ;             "
    " comment             : /;[^\\r\\n]*/ ;                    "
    " sexpr               : '(' <expr>* ')' ;                  "
    " qexpr               : '{' <expr>* '}' ;                  "
    " expr                : <number>  | <symbol> | <string>    "
    "                     | <comment> | <sexpr>  | <qexpr> ;   "
    " lispy               : /^/ <expr>* /$/ ;                  ",
    Number, Symbol, String, Comment, Sexpr, Qexpr, Expr, Lispy, NULL);
  
  if (argc > 1) {

    if (mpc_parse_contents(argv[1], Lispy, &r)) {
      mpc_ast_print(r.output);
      mpc_ast_delete(r.output);
    } else {
      mpc_err_print(r.error);
      mpc_err_delete(r.error);
    }
        
  } else {
    
    if (mpc_parse_pipe("<stdin>", stdin, Lispy, &r)) {
      mpc_ast_print(r.output);
      mpc_ast_delete(r.output);
    } else {
      mpc_err_print(r.error);
      mpc_err_delete(r.error);
    }
  
  }

  mpc_cleanup(8, Number, Symbol, String, Comment, Sexpr, Qexpr, Expr, Lispy);
  
  return 0;
  
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movl $0x0, -0x14(%rbp)
movl %edi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
leaq 0xdd11(%rip), %rdi      # 0xf004
callq 0x3920
movq %rax, -0x30(%rbp)
leaq 0xdd08(%rip), %rdi      # 0xf00b
callq 0x3920
movq %rax, -0x38(%rbp)
leaq 0xdcff(%rip), %rdi      # 0xf012
callq 0x3920
movq %rax, -0x40(%rbp)
leaq 0xdcf6(%rip), %rdi      # 0xf019
callq 0x3920
movq %rax, -0x48(%rbp)
leaq 0xdcee(%rip), %rdi      # 0xf021
callq 0x3920
movq %rax, -0x50(%rbp)
leaq 0xdce4(%rip), %rdi      # 0xf027
callq 0x3920
movq %rax, -0x58(%rbp)
leaq 0xdcd5(%rip), %rdi      # 0xf028
callq 0x3920
movq %rax, -0x60(%rbp)
leaq 0xdcca(%rip), %rdi      # 0xf02d
callq 0x3920
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
movq -0x48(%rbp), %r9
movq -0x50(%rbp), %rbx
movq -0x58(%rbp), %r11
movq -0x60(%rbp), %r10
movq -0x68(%rbp), %rax
movl $0x1, %edi
leaq 0xdc9b(%rip), %rsi      # 0xf033
xorl %r14d, %r14d
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
movb $0x0, %al
callq 0xa540
cmpl $0x1, -0x18(%rbp)
jle 0x1406
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x68(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0x35c0
cmpl $0x0, %eax
je 0x13f2
movq -0x28(%rbp), %rdi
callq 0x85c0
movq -0x28(%rbp), %rdi
callq 0x7e40
jmp 0x1404
movq -0x28(%rbp), %rdi
callq 0x1520
movq -0x28(%rbp), %rdi
callq 0x14a0
jmp 0x1451
movq 0x12bd3(%rip), %rax     # 0x13fe0
movq (%rax), %rsi
movq -0x68(%rbp), %rdx
leaq 0xde12(%rip), %rdi      # 0xf22d
leaq -0x28(%rbp), %rcx
callq 0x3420
cmpl $0x0, %eax
je 0x143d
movq -0x28(%rbp), %rdi
callq 0x85c0
movq -0x28(%rbp), %rdi
callq 0x7e40
jmp 0x144f
movq -0x28(%rbp), %rdi
callq 0x1520
movq -0x28(%rbp), %rdi
callq 0x14a0
jmp 0x1451
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x48(%rbp), %r8
movq -0x50(%rbp), %r9
movq -0x58(%rbp), %r11
movq -0x60(%rbp), %r10
movq -0x68(%rbp), %rax
movl $0x8, %edi
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0x4020
xorl %eax, %eax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)