// File: /workspace/github_cpp_makefile_star2_O2/rfotino[P]consolite-compiler/src/syntax.cpp
// Function: TypeToken::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&)
bool TypeToken::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) {
  AtomToken typeName = tokenizer->getNext();
  if (!isType(typeName.str())) {
    _error("Invalid type '" + typeName.str() + "'.", typeName.line());
    return false;
  }
  _lineNum = typeName.line();
  _name = typeName.str();
  if ("[" == tokenizer->peekNext().str()) {
    tokenizer->getNext();
    _isArray = true;
    ExprToken expr;
    if (!expr.parse(tokenizer, functions, globals, parameters, localVars)) {
      return false;
    }
    if (!expr.isConst()) {
      _error("Array size must be known at compile time.", expr.line());
      return false;
    }
    _arraySize = expr.val();
    if (!_expect(tokenizer, "]")) {
      return false;
    }
  }
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %r9, 0x60(%rsp)
movq %r8, 0x58(%rsp)
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x88(%rsp), %rdi
callq 0x2772c
leaq 0x98(%rsp), %r15
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x73e0
leaq 0x8(%rsp), %rdi
callq 0x285c8
movl %eax, %r12d
leaq 0x8(%rsp), %rdi
callq 0x75c8
testb %r12b, %r12b
je 0xe458
movl 0x90(%rsp), %eax
movl %eax, 0x8(%r14)
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x73e0
leaq 0x10(%r14), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x7360
movq %r15, %rdi
callq 0x75c8
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x279a6
leaq 0x18(%rsp), %rsi
leaq 0x38(%rsp), %rdi
callq 0x73e0
leaq 0x1b28b(%rip), %rdi     # 0x295f4
leaq 0x38(%rsp), %r15
movq %r15, %rsi
callq 0x97dd
movl %eax, %r12d
movq %r15, %rdi
callq 0x75c8
leaq 0x8(%rsp), %rdi
callq 0x7b20
testb %r12b, %r12b
je 0xe451
leaq 0xb8(%rsp), %rdi
movq %rbx, %rsi
callq 0x2772c
leaq 0xb8(%rsp), %rdi
callq 0x7b20
movb $0x1, %al
movb %al, 0x30(%r14)
leaq 0x8(%rsp), %rdi
orl $-0x1, 0x8(%rdi)
leaq 0x2fc81(%rip), %rcx     # 0x3e048
movq %rcx, (%rdi)
movb %al, 0xc(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0xe(%rdi)
movups %xmm0, 0x18(%rdi)
movq %rbx, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq 0x58(%rsp), %r8
movq 0x60(%rsp), %r9
callq 0xe5a8
testb %al, %al
je 0xe4f0
cmpb $0x0, 0x14(%rsp)
je 0xe4c2
movzwl 0x16(%rsp), %eax
movw %ax, 0x32(%r14)
leaq 0x1b48e(%rip), %rsi     # 0x298a2
leaq 0x38(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x9502
leaq 0x38(%rsp), %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x286c3
movl %eax, %ebx
leaq 0x38(%rsp), %rdi
callq 0x75c8
leaq 0x8(%rsp), %rdi
callq 0x1835a
testb %bl, %bl
je 0xe4fa
movb $0x1, %bl
jmp 0xe4fc
leaq 0x68(%rsp), %rdi
movq %r15, %rsi
callq 0x73e0
leaq 0x1b3fd(%rip), %rsi     # 0x29869
leaq 0x38(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x1832f
leaq 0x1b8c0(%rip), %rdx     # 0x29d42
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x9ad4
movl 0x90(%rsp), %esi
leaq 0x8(%rsp), %rdi
callq 0x285f3
leaq 0x8(%rsp), %rdi
callq 0x75c8
leaq 0x38(%rsp), %rdi
callq 0x75c8
leaq 0x68(%rsp), %rdi
callq 0x75c8
jmp 0xe4fa
leaq 0x1b3af(%rip), %rsi     # 0x29878
leaq 0x38(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x9502
movl 0x10(%rsp), %esi
leaq 0x38(%rsp), %rdi
callq 0x285f3
leaq 0x38(%rsp), %rdi
callq 0x75c8
leaq 0x8(%rsp), %rdi
callq 0x1835a
xorl %ebx, %ebx
leaq 0x88(%rsp), %rdi
callq 0x7b20
movl %ebx, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xe51f
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x75c8
jmp 0xe535
jmp 0xe532
jmp 0xe532
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1835a
jmp 0xe592
jmp 0xe58f
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x75c8
jmp 0xe555
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x75c8
jmp 0xe573
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x7b20
jmp 0xe592
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
jmp 0xe588
jmp 0xe58f
jmp 0xe58f
jmp 0xe58f
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x75c8
jmp 0xe592
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x7b20
movq %rbx, %rdi
callq 0x7510
nop