// File: /workspace/github_cpp_makefile_star2_O1/rfotino[P]consolite-compiler/src/syntax.cpp
// Function: CompoundStatement::parse(Tokenizer*, std::vector<std::shared_ptr<FunctionToken>, std::allocator<std::shared_ptr<FunctionToken>>> const&, std::vector<std::shared_ptr<GlobalVarToken>, std::allocator<std::shared_ptr<GlobalVarToken>>> const&, std::vector<std::shared_ptr<ParamToken>, std::allocator<std::shared_ptr<ParamToken>>> const&, std::vector<std::shared_ptr<LocalVarToken>, std::allocator<std::shared_ptr<LocalVarToken>>> const&, std::vector<std::shared_ptr<LabelStatement>, std::allocator<std::shared_ptr<LabelStatement>>>&, std::vector<std::shared_ptr<GotoStatement>, std::allocator<std::shared_ptr<GotoStatement>>>&, std::shared_ptr<FunctionToken> const&, bool)
bool CompoundStatement::parse(
      Tokenizer *tokenizer,
      const std::vector<std::shared_ptr<FunctionToken>>& functions,
      const std::vector<std::shared_ptr<GlobalVarToken>>& globals,
      const std::vector<std::shared_ptr<ParamToken>>& parameters,
      const std::vector<std::shared_ptr<LocalVarToken>>& localVars,
      std::vector<std::shared_ptr<LabelStatement>>& labels,
      std::vector<std::shared_ptr<GotoStatement>>& gotos,
      const std::shared_ptr<FunctionToken>& currentFunc,
      bool inLoop) {
  _lineNum = tokenizer->peekNext().line();
  // Make sure the first token is a '{'.
  if (!_expect(tokenizer, "{")) {
    return false;
  }
  // Get the inner statements.
  while ("}" != tokenizer->peekNext().str()) {
    auto statement = StatementToken::parse(tokenizer, functions, globals,
                                           parameters, localVars, labels,
                                           gotos, currentFunc, inLoop);
    if (!statement) {
      return false;
    }
    // Local variables are only allowed as top level statements in
    // a function.
    if (std::dynamic_pointer_cast<LocalVarToken>(statement)) {
      _error("Local variables can only be declared as top level "
             "statements in a function.", statement->line());
      return false;
    }
    _statements.push_back(statement);
  }
  // Consume the final '}' token.
  tokenizer->getNext();
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r9, 0x70(%rsp)
movq %r8, 0x68(%rsp)
movq %rcx, 0x60(%rsp)
movq %rdx, 0x58(%rsp)
movq %rsi, %rbx
movq %rdi, %r15
movq %rsp, %r14
movq %r14, %rdi
callq 0x33270
movl 0x8(%r14), %eax
movq %r15, 0x30(%rsp)
movl %eax, 0x8(%r15)
leaq 0x2a5f8(%rip), %rax     # 0x46ce0
movq %rax, (%r14)
movq 0x10(%r14), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1c706
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72c0
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1a2bd(%rip), %rsi     # 0x369d3
leaq 0x1a2b7(%rip), %rdx     # 0x369d4
movq %rsp, %rdi
callq 0xc0a4
movq %rsp, %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x3494f
movl %eax, %ebp
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x1c74d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
testb %bpl, %bpl
je 0x1c8fa
leaq 0x48(%rsp), %r12
addq $0x10, 0x30(%rsp)
movq %rsp, %rbp
leaq 0x38(%rsp), %r14
movzbl 0xf8(%rsp), %r13d
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x33270
movq %r12, 0x38(%rsp)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0xc014
movq %r14, %rdi
leaq 0x1a234(%rip), %rsi     # 0x369d5
callq 0x70c0
movl %eax, %r15d
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0x1c7c0
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x72c0
leaq 0x2a519(%rip), %rax     # 0x46ce0
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1c7e7
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72c0
testl %r15d, %r15d
je 0x1c910
movq %r14, %rdi
movq %rbx, %rsi
movq 0x58(%rsp), %rdx
movq 0x60(%rsp), %rcx
movq 0x68(%rsp), %r8
movq 0x70(%rsp), %r9
pushq %r13
pushq 0xf8(%rsp)
pushq 0xf8(%rsp)
pushq 0xf8(%rsp)
callq 0x1a294
addq $0x20, %rsp
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x1c8cd
leaq 0x2a829(%rip), %rsi     # 0x47068
leaq 0x2aa8a(%rip), %rdx     # 0x472d0
xorl %ecx, %ecx
callq 0x7330
movq %rax, %r15
movl $0x0, %edi
testq %rax, %rax
je 0x1c879
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1c879
movq 0x2b72d(%rip), %rax     # 0x47f98
cmpb $0x0, (%rax)
je 0x1c875
incl 0x8(%rdi)
jmp 0x1c879
lock
incl 0x8(%rdi)
testq %rdi, %rdi
je 0x1c883
callq 0x81ea
testq %r15, %r15
je 0x1c8d2
leaq 0x10(%rsp), %r15
movq %r15, (%rsp)
movq %rbp, %rdi
leaq 0x1a52c(%rip), %rsi     # 0x36dc7
leaq 0x1a570(%rip), %rdx     # 0x36e12
callq 0xc0a4
movq 0x38(%rsp), %rax
movl 0x8(%rax), %esi
movq %rbp, %rdi
callq 0x34811
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x1c8cd
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
xorl %r15d, %r15d
jmp 0x1c8e2
movb $0x1, %r15b
movq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0x22412
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1c8f1
callq 0x81ea
testb %r15b, %r15b
jne 0x1c772
xorl %ebx, %ebx
movl %ebx, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x78(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x32f76
leaq 0x2a3b9(%rip), %rax     # 0x46ce0
movq %rax, (%r14)
movq 0x10(%r14), %rdi
leaq 0x98(%rsp), %rax
movb $0x1, %bl
cmpq %rax, %rdi
je 0x1c8fc
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x1c8fc
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x1c9c2
movq 0x10(%rsp), %rsi
jmp 0x1c9ba
movq %rax, %rbx
jmp 0x1c9c2
jmp 0x1c984
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x1c987
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x1c987
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1c9c2
callq 0x81ea
jmp 0x1c9c2
movq %rax, %rbx
leaq 0x2a33e(%rip), %rax     # 0x46ce0
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1c9c2
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72c0
movq %rbx, %rdi
callq 0x74f0