// File: lukewagner[P]asmjs2wasm/src/cashew/parser.h
// Function: cashew::Parser<asmjs_ast::Node*, Builder>::parseElement(char*&, char const*)
NodeRef parseElement(char*& src, const char* seps=";") {
    //dump("parseElement", src);
    src = skipSpace(src);
    Frag frag(src);
    src += frag.size;
    switch (frag.type) {
      case KEYWORD: {
        return parseAfterKeyword(frag, src, seps);
      }
      case IDENT:
      case STRING:
      case INT:
      case DOUBLE: {
        src = skipSpace(src);
        if (frag.type == IDENT) return parseAfterIdent(frag, src, seps);
        else return parseExpression(parseFrag(frag), src, seps);
      }
      case SEPARATOR: {
        if (frag.str == OPEN_PAREN) return parseExpression(parseAfterParen(src), src, seps);
        if (frag.str == OPEN_BRACE) return parseExpression(parseAfterBrace(src), src, seps);
        if (frag.str == OPEN_CURLY) return parseExpression(parseAfterCurly(src), src, seps);
        assert(0);
      }
      case OPERATOR: {
        return parseExpression(frag.str, src, seps);
      }
      default: /* dump("parseElement", src); printf("bad frag type: %d\n", frag.type); */ assert(0);
    }
    return nullptr;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x5d30
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rsi
leaq -0x30(%rbp), %rdi
callq 0x5f00
movslq -0x28(%rbp), %rdx
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq %rdx, %rcx
movq %rcx, (%rax)
movl -0x24(%rbp), %eax
movq %rax, -0x90(%rbp)
subq $0x6, %rax
ja 0x9adb
movq -0x90(%rbp), %rax
leaq 0xb8e9(%rip), %rcx      # 0x151b4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x98(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x30(%rbp), %rsi
callq 0x9b30
movq %rax, -0x8(%rbp)
jmp 0x9afa
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x5d30
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
cmpl $0x2, -0x24(%rbp)
jne 0x9932
movq -0x98(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x30(%rbp), %rsi
callq 0x9df0
movq %rax, -0x8(%rbp)
jmp 0x9afa
movq -0x98(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xaf00
movq %rax, %rsi
leaq -0x40(%rbp), %rdi
callq 0xaff0
movq -0x98(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
movb -0x40(%rbp), %al
movq -0x38(%rbp), %rdx
movzbl %al, %esi
callq 0xa060
movq %rax, -0x8(%rbp)
jmp 0x9afa
leaq -0x30(%rbp), %rdi
leaq 0x18a68(%rip), %rsi     # 0x223e8
callq 0x6680
testb $0x1, %al
jne 0x998b
jmp 0x99ce
movq -0x98(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xb010
movq %rax, %rsi
leaq -0x50(%rbp), %rdi
callq 0xaff0
movq -0x98(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
movb -0x50(%rbp), %al
movq -0x48(%rbp), %rdx
movzbl %al, %esi
callq 0xa060
movq %rax, -0x8(%rbp)
jmp 0x9afa
leaq -0x30(%rbp), %rdi
leaq 0x18a17(%rip), %rsi     # 0x223f0
callq 0x6680
testb $0x1, %al
jne 0x99e4
jmp 0x9a27
movq -0x98(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xb110
movq %rax, %rsi
leaq -0x60(%rbp), %rdi
callq 0xaff0
movq -0x98(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
movb -0x60(%rbp), %al
movq -0x58(%rbp), %rdx
movzbl %al, %esi
callq 0xa060
movq %rax, -0x8(%rbp)
jmp 0x9afa
leaq -0x30(%rbp), %rdi
leaq 0x189c6(%rip), %rsi     # 0x223f8
callq 0x6680
testb $0x1, %al
jne 0x9a3d
jmp 0x9a7d
movq -0x98(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xb290
movq %rax, %rsi
leaq -0x70(%rbp), %rdi
callq 0xaff0
movq -0x98(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
movb -0x70(%rbp), %al
movq -0x68(%rbp), %rdx
movzbl %al, %esi
callq 0xa060
movq %rax, -0x8(%rbp)
jmp 0x9afa
leaq 0xc137(%rip), %rdi      # 0x15bbb
leaq 0xb87c(%rip), %rsi      # 0x15307
movl $0x133, %edx            # imm = 0x133
leaq 0xb94d(%rip), %rcx      # 0x153e4
callq 0x2130
movq -0x30(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0xb4d0
movq -0x98(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
movb -0x80(%rbp), %al
movq -0x78(%rbp), %rdx
movzbl %al, %esi
callq 0xa060
movq %rax, -0x8(%rbp)
jmp 0x9afa
leaq 0xc0d9(%rip), %rdi      # 0x15bbb
leaq 0xb81e(%rip), %rsi      # 0x15307
movl $0x138, %edx            # imm = 0x138
leaq 0xb8ef(%rip), %rcx      # 0x153e4
callq 0x2130
movq -0x8(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopw (%rax,%rax)