// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_decl.c
// Function: parseType
const Type *parseType(Compiler *comp, const Ident *ident)
{
    if (ident)
    {
        if (ident->kind != IDENT_TYPE)
            comp->error.handler(comp->error.context, "Type expected");
        lexNext(&comp->lex);
        return ident->type;
    }

    switch (comp->lex.tok.kind)
    {
        case TOK_IDENT:     return parseType(comp, parseQualIdent(comp));
        case TOK_CARET:
        case TOK_WEAK:      return parsePtrType(comp);
        case TOK_LBRACKET:  return parseArrayType(comp);
        case TOK_STR:       return parseStrType(comp);
        case TOK_ENUM:      return parseEnumType(comp);
        case TOK_MAP:       return parseMapType(comp);
        case TOK_STRUCT:    return parseStructType(comp);
        case TOK_INTERFACE: return parseInterfaceType(comp);
        case TOK_FN:        return parseClosureType(comp);

        default:            comp->error.handler(comp->error.context, "Type expected"); return NULL;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3a8, %rsp            # imm = 0x3A8
movq %rsi, %rbx
movq %rdi, %r13
testq %rbx, %rbx
jne 0x6f4a
movl 0x4bd0(%r13), %r14d
cmpl $0x45, %r14d
jne 0x6e62
movq %r13, %rdi
callq 0xa110
movq %rax, %rbx
jmp 0x6e3f
leal -0x7(%r14), %eax
cmpl $0xe, %eax
ja 0x6eda
leaq 0x6325a(%rip), %rcx     # 0x6a0cc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
movq %r13, (%rsp)
jmpq *%rax
leaq 0x4ba8(%r13), %r15
pushq $0x7
popq %rsi
movq %r15, %rdi
callq 0x118d3
cmpl $0x38, 0x4bd0(%r13)
jne 0x73ff
movq %r15, %rdi
callq 0x10f6e
movq %r13, %rdi
xorl %esi, %esi
callq 0x6e28
movq %rax, %rbx
leaq 0x4e18(%r13), %rdi
movq 0x5240(%r13), %rsi
movq %rax, %rdx
callq 0x15600
pushq $0x39
popq %rsi
movq %r15, %rdi
callq 0x118d3
jmp 0x7406
cmpl $0x3a, %r14d
je 0x73cc
cmpl $0x3e, %r14d
jne 0x73ad
leaq 0x4ba8(%r13), %rbx
cmpl $0x15, %r14d
jne 0x6f03
movq %rbx, %rdi
callq 0x10f6e
pushq $0x3e
popq %rsi
movq %rbx, %rdi
callq 0x118d3
movq %r13, %rdi
callq 0x7ef6
leaq 0x4e18(%r13), %rdi
addq $0x4220, %r13           # imm = 0x4220
movq %r13, %rsi
movq %rax, %rdx
addq $0x3a8, %rsp            # imm = 0x3A8
cmpl $0x15, %r14d
jne 0x739e
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x15112
cmpl $0x2, (%rbx)
je 0x6f66
movq 0x5118(%r13), %rdi
leaq 0x63207(%rip), %rsi     # 0x6a164
xorl %eax, %eax
callq *0x50f8(%r13)
addq $0x4ba8, %r13           # imm = 0x4BA8
movq %r13, %rdi
callq 0x10f6e
movq 0x108(%rbx), %r14
jmp 0x76b3
movq %r13, %rdi
addq $0x3a8, %rsp            # imm = 0x3A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x76c8
leaq 0x4ba8(%r13), %r15
pushq $0xb
popq %rsi
movq %r15, %rdi
callq 0x118d3
pushq $0x3c
popq %rsi
movq %r15, %rdi
callq 0x118d3
leaq 0x4e18(%r13), %r12
leaq 0x4220(%r13), %rsi
pushq $0x17
popq %rdx
movq %r12, %rdi
movq %rsi, 0x10(%rsp)
callq 0x14da9
movq %rax, %r14
movq 0x5298(%r13), %rdx
leaq 0x5f3ea(%rip), %rcx     # 0x663d0
movq %r12, %rdi
movq %rax, %rsi
callq 0x159f0
movq 0x5298(%r13), %rdx
leaq 0x5f3d7(%rip), %rcx     # 0x663d6
movq %r12, %rdi
movq %r14, %rsi
callq 0x159f0
leaq 0xf0(%r13), %rbp
leaq 0x4bd8(%r13), %rax
movq %rax, 0x20(%rsp)
movq %r14, %r13
movq %r15, 0x28(%rsp)
movq %r14, 0x18(%rsp)
movq (%rsp), %rax
cmpl $0x45, 0x4bd0(%rax)
jne 0x718d
movl $0x270, %edx            # imm = 0x270
leaq 0x130(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3260
movq %rbx, %rdi
callq 0x10f6e
cmpl $0x38, 0x158(%rsp)
jne 0x70fc
leaq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x30a0
movq %r15, %rdi
callq 0x10f6e
movq %r12, %rdi
movq 0x10(%rsp), %rsi
pushq $0x1a
popq %rdx
callq 0x14da9
movq %rax, %rbx
leaq 0x28(%rax), %r14
movb $0x1, 0x30(%rax)
movq (%rsp), %r15
movq 0x5298(%r15), %rdx
movq %r12, %rdi
movq %r14, %rsi
leaq 0x5f31d(%rip), %rcx     # 0x663d0
xorl %r8d, %r8d
callq 0x15e11
movq %r15, %rdi
movq %r14, %rsi
callq 0x8155
movq %r12, %rdi
movq 0x18(%rsp), %rsi
movq %rbx, %rdx
leaq 0x30(%rsp), %rcx
callq 0x159f0
movl 0x110(%rax), %eax
movl %eax, 0x34(%rbx)
movq 0x28(%rsp), %r15
movq %r15, %rdi
pushq $0x40
popq %rsi
callq 0x118d3
movq %r13, %r14
jmp 0x702a
movq (%rsp), %rdi
xorl %esi, %esi
callq 0x6e28
movq %rax, %rbx
cmpl $0x17, (%rax)
je 0x7129
movq (%rsp), %rcx
movq 0x5118(%rcx), %rdi
leaq 0x63184(%rip), %rsi     # 0x6a2a5
xorl %eax, %eax
callq *0x50f8(%rcx)
pushq $0x2
popq %r15
movslq 0x10(%rbx), %rax
cmpq %rax, %r15
jge 0x70e4
movq %r12, %rdi
movq 0x10(%rsp), %rsi
pushq $0x1a
popq %rdx
callq 0x14da9
movq %rax, %r14
movq 0x28(%rbx), %rax
movq (%rax,%r15,8), %rax
movq 0x108(%rax), %rdx
movq %rbp, %rdi
movq %r14, %rsi
callq 0x14fa7
movq 0x28(%rbx), %rax
movq (%rax,%r15,8), %rcx
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x159f0
movb $0x1, 0x30(%r14)
movl 0x110(%rax), %eax
movl %eax, 0x34(%r14)
incq %r15
jmp 0x712d
pushq $0x3d
popq %rsi
movq %r15, %rdi
callq 0x118d3
jmp 0x76b3
leaq 0x4ba8(%r13), %rdi
pushq $0x8
popq %rsi
callq 0x118d3
leaq 0x4e18(%r13), %rbx
leaq 0x4220(%r13), %r14
pushq $0x18
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14da9
movq %rax, %r15
pushq $0x1a
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14da9
movq %rax, %r14
leaq 0x28(%rax), %rsi
movq %r13, %rdi
callq 0x8155
leaq 0x5f1fb(%rip), %rcx     # 0x663ea
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r15, %r14
callq 0x159f0
movq 0x52a8(%r13), %rdx
leaq 0x5f1d2(%rip), %rcx     # 0x663e0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x159f0
jmp 0x76b3
leaq 0x4ba8(%r13), %rdi
pushq $0x10
popq %rsi
callq 0x118d3
movq 0x5288(%r13), %r14
jmp 0x76b3
movq %r13, %r14
addq $0x4ba8, %r13           # imm = 0x4BA8
pushq $0xe
popq %rsi
movq %r13, %rdi
callq 0x118d3
pushq $0x3a
popq %rsi
movq %r13, %rdi
callq 0x118d3
leaq 0x4e18(%r14), %r15
leaq 0x4220(%r14), %r12
pushq $0x15
popq %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x14da9
movq %rax, 0x18(%rsp)
movq %r14, %rdi
xorl %esi, %esi
callq 0x6e28
movq %rax, %rbx
pushq $0x2e
popq %rsi
movq %rax, %rdi
callq 0x15753
testb %al, %al
jne 0x72ad
movq 0x5118(%r14), %rdi
leaq 0x62f47(%rip), %rsi     # 0x6a1eb
xorl %eax, %eax
callq *0x50f8(%r14)
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x15100
movq %rax, %rbp
pushq $0x3b
popq %rsi
movq %r13, %rdi
callq 0x118d3
movq %r14, %rdi
callq 0x7ef6
movq %rax, %rbx
cmpl $0x2, (%rax)
jne 0x72f0
movq 0x5118(%r14), %rdi
leaq 0x62f23(%rip), %rsi     # 0x6a20a
xorl %eax, %eax
callq *0x50f8(%r14)
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x15100
movq %rax, %r13
pushq $0x16
popq %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x14da9
movq %rax, %rbx
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x15100
movq %rax, %r12
movq 0x5240(%r14), %rdx
leaq 0x62ef2(%rip), %rcx     # 0x6a223
movq %r15, %rdi
movq %rbx, %rsi
callq 0x159f0
leaq 0x62ee5(%rip), %rcx     # 0x6a228
movq %r15, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x159f0
leaq 0x5f096(%rip), %rcx     # 0x663ee
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x159f0
leaq 0x62ec0(%rip), %rcx     # 0x6a22d
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x159f0
leaq 0x62eb1(%rip), %rcx     # 0x6a233
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x159f0
movq 0x18(%rsp), %r14
movq %rbx, 0x8(%r14)
jmp 0x76b3
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x15100
movq 0x5118(%r13), %rdi
leaq 0x62da9(%rip), %rsi     # 0x6a164
xorl %r14d, %r14d
xorl %eax, %eax
callq *0x50f8(%r13)
jmp 0x76b3
leaq 0x4ba8(%r13), %r14
pushq $0x3a
popq %rsi
movq %r14, %rdi
callq 0x118d3
movl 0x4bd0(%r13), %r12d
cmpl $0x3b, %r12d
jne 0x7586
andq $0x0, 0x130(%rsp)
pushq $0x13
jmp 0x75dd
movq 0x5240(%r13), %rbx
leaq 0x4e18(%r13), %r12
leaq 0x4220(%r13), %rsi
movl (%rbx), %edx
movq %r12, %rdi
callq 0x14da9
movq %rax, %r14
movb $0x1, 0x16(%rax)
leaq 0x8(%rsp), %rax
orq $-0x1, (%rax)
pushq $0x3c
popq %rsi
movq %r15, %rdi
callq 0x118d3
leaq 0x4bd8(%r13), %rbp
movq %r15, 0x10(%rsp)
cmpl $0x45, 0x4bd0(%r13)
jne 0x754f
movq %r15, %rdi
pushq $0x45
popq %rsi
callq 0x1187f
leaq 0x130(%rsp), %rdi
movq %rbp, %rsi
callq 0x30a0
movq %r15, %rdi
callq 0x10f6e
cmpl $0x31, 0x4bd0(%r13)
jne 0x74be
movq %r15, %rdi
pushq $0x31
popq %rsi
callq 0x118d3
andq $0x0, 0x30(%rsp)
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0xd3a5
movq 0x5240(%r13), %rsi
movq 0x30(%rsp), %rdx
movq %r12, %rdi
callq 0x15600
movq 0x8(%rsp), %rbx
jmp 0x74cb
movq 0x8(%rsp), %rbx
incq %rbx
movq %rbx, 0x8(%rsp)
movl (%r14), %r13d
movl %r13d, %edi
movq %rbx, %rsi
callq 0x8013
testb %al, %al
je 0x7525
movq (%rsp), %rax
movq %r12, %r15
movq %rbp, %r12
movq %r14, %rbp
movq 0x50f8(%rax), %r14
movq 0x5118(%rax), %rbx
movl %r13d, %edi
callq 0x1601e
movq %rbx, %rdi
leaq 0x62cd2(%rip), %rsi     # 0x6a1dc
movq %rax, %rdx
xorl %eax, %eax
callq *%r14
movq %rbp, %r14
movq %r12, %rbp
movq %r15, %r12
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %rbx
movq %r12, %rdi
movq %r14, %rsi
leaq 0x130(%rsp), %rdx
movq %rbx, %rcx
callq 0x15ccf
movq %r15, %rdi
pushq $0x40
popq %rsi
callq 0x118d3
movq (%rsp), %r13
jmp 0x7445
pushq $0x3d
popq %rsi
movq %r15, %rdi
callq 0x118d3
movq %r14, %rdi
xorl %esi, %esi
callq 0x15c96
testq %rax, %rax
jne 0x76b3
leaq 0x62ae3(%rip), %rdx     # 0x6a057
movq %r12, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x15ccf
jmp 0x76b3
leaq 0x30(%rsp), %rbx
andq $0x0, (%rbx)
leaq 0x130(%rsp), %r15
movq %r13, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xd3a5
leaq 0x4e18(%r13), %rdi
movq 0x5240(%r13), %rsi
movq (%rbx), %rdx
callq 0x15600
movq (%r15), %rax
shrq $0x1f, %rax
je 0x75db
movq 0x5118(%r13), %rdi
leaq 0x62bc7(%rip), %rsi     # 0x6a199
xorl %eax, %eax
callq *0x50f8(%r13)
pushq $0x12
popq %rbp
pushq $0x3b
popq %rsi
movq %r14, %rdi
callq 0x118d3
movq %r13, %rdi
cmpl $0x3b, %r12d
jne 0x75f9
callq 0x7ef6
jmp 0x7600
xorl %esi, %esi
callq 0x6e28
movq %rax, %r15
cmpl $0x2, (%rax)
jne 0x761f
movq 0x5118(%r13), %rdi
leaq 0x62b98(%rip), %rsi     # 0x6a1ae
xorl %eax, %eax
callq *0x50f8(%r13)
cmpq $0x0, 0x130(%rsp)
jle 0x7667
leaq 0x4e18(%r13), %rdi
movq %r15, %rsi
callq 0x15124
movslq %eax, %rcx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %edx, %edx
idivq 0x130(%rsp)
cmpq %rcx, %rax
jge 0x7667
movq 0x5118(%r13), %rdi
leaq 0x62b6b(%rip), %rsi     # 0x6a1c9
xorl %eax, %eax
callq *0x50f8(%r13)
leaq 0x4e18(%r13), %rdi
addq $0x4220, %r13           # imm = 0x4220
movq %r13, %rsi
movl %ebp, %edx
callq 0x14da9
movq %rax, %r14
movq %r15, 0x8(%rax)
cmpl $0x12, (%rax)
jne 0x76b3
movl 0x130(%rsp), %eax
movl %eax, 0x10(%r14)
imull 0xc0(%r15), %eax
movl %eax, 0xc0(%r14)
movl 0xc4(%r15), %eax
movl %eax, 0xc4(%r14)
movq %r14, %rax
addq $0x3a8, %rsp            # imm = 0x3A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq