// File: /workspace/github_cpp_makefile_star2_O1/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, %rbp
movq %rdx, 0x50(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x68(%rsp), %r15
movq %r15, %rdi
callq 0x32f76
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x10(%r15), %rsi
movq 0x18(%r15), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0xc014
leaq 0x20(%rsp), %rdi
callq 0x347e3
movl %eax, %r15d
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x11161
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x72c0
testb %r15b, %r15b
je 0x11241
movl 0x70(%rsp), %eax
movl %eax, 0x8(%r14)
leaq 0x20(%rsp), %rdi
movq %r12, (%rdi)
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
addq %rsi, %rdx
callq 0xc014
leaq 0x10(%r14), %rdi
leaq 0x20(%rsp), %r15
movq %r15, %rsi
callq 0x7370
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x111b5
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x72c0
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x33270
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
movq %rsp, %rdi
callq 0xc014
leaq 0x2540d(%rip), %rsi     # 0x365f4
movq %rsp, %r12
movq %r12, %rdi
callq 0x70c0
movl %eax, %r15d
movq (%r12), %rdi
cmpq %r13, %rdi
je 0x1120b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
leaq 0x35ace(%rip), %r12     # 0x46ce0
leaq 0x40(%rsp), %rax
movq %r12, -0x20(%rax)
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11231
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x72c0
testl %r15d, %r15d
je 0x11305
movb $0x1, %bl
jmp 0x114c5
leaq 0xa8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
addq %rsi, %rdx
leaq 0x98(%rsp), %rdi
callq 0xc014
leaq 0x255f8(%rip), %rcx     # 0x36869
leaq 0x98(%rsp), %rdi
movl $0xe, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x7320
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x112ae
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x112b5
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rsp, %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x25a6c(%rip), %rsi     # 0x36d42
callq 0x7560
movq %r12, 0x20(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x113fc
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x11404
leaq 0xb8(%rsp), %rdi
movq %rbx, %rsi
callq 0x32f76
leaq 0xd8(%rsp), %rax
movq %r12, -0x20(%rax)
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1133a
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x72c0
movb $0x1, %al
movb %al, 0x30(%r14)
leaq 0x20(%rsp), %rdi
movl $0xffffffff, 0x8(%rdi)  # imm = 0xFFFFFFFF
leaq 0x35ced(%rip), %r15     # 0x47040
movq %r15, (%rdi)
movb %al, 0xc(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0xe(%rdi)
movups %xmm0, 0x18(%rdi)
movq %rbx, %rsi
movq 0x50(%rsp), %rdx
movq %rbp, %rcx
movq 0x58(%rsp), %r8
movq 0x60(%rsp), %r9
callq 0x1160e
testb %al, %al
je 0x114b5
cmpb $0x0, 0x2c(%rsp)
je 0x11475
movzwl 0x2e(%rsp), %eax
movw %ax, 0x32(%r14)
movq %rsp, %rdi
leaq 0x10(%rsp), %r14
movq %r14, (%rdi)
leaq 0x254f5(%rip), %rsi     # 0x368a2
leaq 0x254ef(%rip), %rdx     # 0x368a3
callq 0xc0a4
movq %rsp, %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x3494f
movl %eax, %ebx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x113e1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
leaq 0x30(%rsp), %rdi
movq %r15, -0x10(%rdi)
callq 0x22116
testb %bl, %bl
jne 0x1123a
jmp 0x114c3
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x20(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl 0x70(%rsp), %esi
callq 0x34811
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x11440
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x72c0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x11456
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x98(%rsp), %rdi
cmpq %r14, %rdi
je 0x114c3
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x114c3
movq %rsp, %rdi
leaq 0x10(%rsp), %r14
movq %r14, (%rdi)
leaq 0x253f1(%rip), %rsi     # 0x36878
leaq 0x25413(%rip), %rdx     # 0x368a1
callq 0xc0a4
movl 0x28(%rsp), %esi
movq %rsp, %rdi
callq 0x34811
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x114b5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
leaq 0x30(%rsp), %rdi
movq %r15, -0x10(%rdi)
callq 0x22116
xorl %ebx, %ebx
leaq 0x35814(%rip), %rax     # 0x46ce0
leaq 0x88(%rsp), %rcx
movq %rax, -0x20(%rcx)
movq -0x10(%rcx), %rdi
cmpq %rcx, %rdi
je 0x114f1
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x72c0
movl %ebx, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11507
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x11529
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x11529
jmp 0x11526
jmp 0x11526
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
movq %r15, -0x10(%rdi)
callq 0x22116
jmp 0x115da
jmp 0x115d7
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x11560
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x11560
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x1159e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x1159e
movq %rax, %rbx
leaq 0x3575e(%rip), %rax     # 0x46ce0
leaq 0x40(%rsp), %rcx
movq %rax, -0x20(%rcx)
movq -0x10(%rcx), %rdi
cmpq %rcx, %rdi
je 0x115da
movq 0x40(%rsp), %rsi
jmp 0x115cd
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r14, %rdi
je 0x115da
movq 0xa8(%rsp), %rsi
jmp 0x115cd
jmp 0x115d7
jmp 0x115d7
jmp 0x115d7
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x115da
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x115da
movq %rax, %rbx
leaq 0x356ff(%rip), %rax     # 0x46ce0
leaq 0x88(%rsp), %rcx
movq %rax, -0x20(%rcx)
movq -0x10(%rcx), %rdi
cmpq %rcx, %rdi
je 0x11606
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x72c0
movq %rbx, %rdi
callq 0x74f0