// File: /workspace/github_cpp_makefile_star2_O2/princelab[P]emass/parser.cpp
// Function: Parser::parse()
Parser::ElementListNode * Parser::parse()
{
  Parser::ElementListNode * inner;
  Parser::ElementListNode * outer = new Parser::ElementListNode();
  while(_tokenizer._ttype == LPAREN ||
	_tokenizer._ttype == ELEMENT) {
    if(_tokenizer._ttype == LPAREN) {
      try {
	_tokenizer.get_token();
      } catch (Parser::Error e) {
	delete outer;
	throw e;
      }
      inner = parse();
      if(_tokenizer._ttype != RPAREN) {
	delete outer;
	delete inner;
	_tokenizer.error(L"Expected right parenthesis");
      }
    } else {
      ElemMap::const_iterator i = _elements.find(_tokenizer._tval);
      if(i != _elements.end())
	inner = new ElementListNode((*i).second);
      else {
	delete outer;
	_tokenizer.error(L"\'" + _tokenizer._tval + L"\' is not an element");
      }
    }
    _tokenizer.get_token();
    if(_tokenizer._ttype == NUM) {
      inner->set_count(wcstol(_tokenizer._tval.c_str(), NULL, 0));
      _tokenizer.get_token();
    }
    outer->append(inner);
  }
  return outer;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r15
pushq $0x28
popq %rdi
callq 0x32a0
movq %rax, %r14
leaq 0x539b(%rip), %rax      # 0xad18
movq %rax, (%r14)
leaq 0x8(%r14), %rax
movq %rax, 0x10(%r14)
movq %rax, 0x8(%r14)
andq $0x0, 0x18(%r14)
movq $0x1, 0x20(%r14)
leaq 0x8(%r15), %rbx
leaq 0x10(%r15), %r13
movl (%rbx), %eax
cmpl $0x4, %eax
je 0x59cc
testl %eax, %eax
jne 0x5a38
movq %rbx, %rdi
callq 0x5628
movq %r15, %rdi
callq 0x595a
movq %rax, %rbp
cmpl $0x1, 0x8(%r15)
je 0x5a02
jmp 0x5a4a
movq (%r15), %rdi
movq %r13, %rsi
callq 0x6466
movq %rax, %r12
movq (%r15), %rax
addq $0x8, %rax
cmpq %rax, %r12
je 0x5a85
pushq $0x28
popq %rdi
callq 0x32a0
movq %rax, %rbp
movq 0x40(%r12), %rsi
movq %rax, %rdi
callq 0x5d7a
movq %rbx, %rdi
callq 0x5628
cmpl $0x3, (%rbx)
jne 0x5a28
movq (%r13), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3360
movq %rax, 0x20(%rbp)
movq %rbx, %rdi
callq 0x5628
movq %r14, %rdi
movq %rbp, %rsi
callq 0x5f9e
jmp 0x59a1
movq %r14, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
testq %rbp, %rbp
je 0x5a62
movq (%rbp), %rax
movq %rbp, %rdi
callq *0x8(%rax)
leaq 0x17cf(%rip), %rsi      # 0x7238
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x5eca
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0x5b84
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
leaq 0x1967(%rip), %rsi      # 0x73fc
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %r13, %rdx
callq 0x5f28
leaq 0x17f8(%rip), %rdx      # 0x72a4
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0x5f09
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x5b84
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x34c0
jmp 0x5ad8
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0x5ae7
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x34c0
jmp 0x5b74
movq %rax, %rbx
jmp 0x5b74
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %rbp, %rdi
callq 0x32c0
jmp 0x5b74
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x5b74
movq %rbx, %rdi
callq 0x3320
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x3220
movq %rbx, %rdi
callq 0x30d0
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
pushq $0x20
popq %rdi
callq 0x3110
movq %rax, %rbx
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x34a0
leaq 0x51a5(%rip), %rsi      # 0xacf8
leaq 0x3aa(%rip), %rdx       # 0x5f04
movq %rbx, %rdi
callq 0x33c0
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x34c0
callq 0x33a0
movq %rbx, %rdi
callq 0x33f0
movq %rax, %rdi
callq 0x4559