// File: /workspace/github_c_makefile_star2_O3/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, %r14
movq %rdi, %rbx
testq %rsi, %rsi
je 0xa9c8
cmpl $0x2, (%r14)
je 0xa98c
movq 0x5118(%rbx), %rdi
leaq 0x6b83c(%rip), %rsi     # 0x761c0
xorl %eax, %eax
callq *0x50f8(%rbx)
addq $0x4ba8, %rbx           # imm = 0x4BA8
movq %rbx, %rdi
callq 0x15914
movq 0x108(%r14), %rbp
movq %rbp, %rax
addq $0x3a8, %rsp            # imm = 0x3A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0xdbb4
testq %rax, %rax
jne 0xaf1c
movl 0x4bd0(%rbx), %r15d
cmpl $0x45, %r15d
je 0xa9b7
leal -0x7(%r15), %eax
cmpl $0xe, %eax
ja 0xaa51
leaq 0x6b6e7(%rip), %rcx     # 0x760cc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
movq %rbx, 0x10(%rsp)
jmpq *%rax
leaq 0x4ba8(%rbx), %r15
movq %r15, %rdi
movl $0x7, %esi
callq 0x1637d
cmpl $0x38, 0x4bd0(%rbx)
jne 0xaf82
movq %r15, %rdi
callq 0x15914
movq %rbx, %rdi
xorl %esi, %esi
callq 0xa954
movq %rax, %r14
leaq 0x4e18(%rbx), %rdi
movq 0x5240(%rbx), %rsi
movq %rax, %rdx
callq 0x1a277
movq %r15, %rdi
movl $0x39, %esi
callq 0x1637d
jmp 0xaf89
cmpl $0x3a, %r15d
je 0xaf33
cmpl $0x3e, %r15d
jne 0xaabf
leaq 0x4ba8(%rbx), %r14
cmpl $0x15, %r15d
jne 0xaa76
movq %r14, %rdi
callq 0x15914
movq %r14, %rdi
movl $0x3e, %esi
callq 0x1637d
movq %rbx, %rdi
callq 0xbba0
leaq 0x4e18(%rbx), %rdi
addq $0x4220, %rbx           # imm = 0x4220
movq %rbx, %rsi
movq %rax, %rdx
addq $0x3a8, %rsp            # imm = 0x3A8
cmpl $0x15, %r15d
jne 0xaf24
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x19e15
movq 0x5118(%rbx), %rdi
leaq 0x6b6f3(%rip), %rsi     # 0x761c0
xorl %ebp, %ebp
xorl %eax, %eax
callq *0x50f8(%rbx)
jmp 0xa9a2
leaq 0x4ba8(%rbx), %r15
movq %r15, %rdi
movl $0xb, %esi
callq 0x1637d
movq %r15, %rdi
movl $0x3c, %esi
callq 0x1637d
leaq 0x4e18(%rbx), %rbp
leaq 0x4220(%rbx), %r13
movq %rbp, %rdi
movq %r13, %rsi
movl $0x17, %edx
callq 0x19a70
movq %rax, %r14
movq 0x5298(%rbx), %rdx
leaq 0x678a4(%rip), %rcx     # 0x723d0
movq %rbp, %rdi
movq %rax, %rsi
callq 0x1a697
movq 0x5298(%rbx), %rdx
leaq 0x67891(%rip), %rcx     # 0x723d6
movq %rbp, %rdi
movq %r14, 0x18(%rsp)
movq %r14, %rsi
callq 0x1a697
cmpl $0x45, 0x4bd0(%rbx)
jne 0xace1
leaq 0xf0(%rbx), %r12
leaq 0x4bd8(%rbx), %rax
movq %rax, 0x20(%rsp)
movq %r15, 0x28(%rsp)
movq %r12, (%rsp)
movq 0x18(%rsp), %r12
movl $0x270, %edx            # imm = 0x270
leaq 0x130(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x3260
movq %r14, %rdi
callq 0x15914
cmpl $0x38, 0x158(%rsp)
jne 0xac2a
leaq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x30a0
movq %r15, %rdi
callq 0x15914
movq %rbp, %rdi
movq %r13, %rsi
movl $0x1a, %edx
callq 0x19a70
movq %rax, %r15
leaq 0x28(%rax), %r14
movb $0x1, 0x30(%rax)
movq 0x5298(%rbx), %rdx
movq %rbp, %rdi
movq %r14, %rsi
leaq 0x677dd(%rip), %rcx     # 0x723d0
xorl %r8d, %r8d
callq 0x1ab67
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbd89
movq %rbp, %rdi
movq 0x18(%rsp), %rsi
movq %r15, %rdx
leaq 0x30(%rsp), %rcx
callq 0x1a697
movl 0x110(%rax), %eax
movl %eax, 0x34(%r15)
jmp 0xacbd
movq %rbx, %rdi
xorl %esi, %esi
callq 0xa954
movq %rax, %r15
cmpl $0x17, (%rax)
je 0xac52
movq 0x5118(%rbx), %rdi
leaq 0x6b6b7(%rip), %rsi     # 0x76301
xorl %eax, %eax
callq *0x50f8(%rbx)
cmpl $0x3, 0x10(%r15)
jl 0xacbd
movl $0x2, %ebx
movq %rbp, %rdi
movq %r13, %rsi
movl $0x1a, %edx
callq 0x19a70
movq %rax, %r14
movq 0x28(%r15), %rax
movq (%rax,%rbx,8), %rax
movq 0x108(%rax), %rdx
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x19c98
movq 0x28(%r15), %rax
movq (%rax,%rbx,8), %rcx
movq %rbp, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x1a697
movb $0x1, 0x30(%r14)
movl 0x110(%rax), %eax
movl %eax, 0x34(%r14)
incq %rbx
movslq 0x10(%r15), %rax
cmpq %rax, %rbx
jl 0xac5e
movq 0x28(%rsp), %r15
movq %r15, %rdi
movl $0x40, %esi
callq 0x1637d
movq 0x10(%rsp), %rbx
cmpl $0x45, 0x4bd0(%rbx)
je 0xab83
movq %r15, %rdi
movl $0x3d, %esi
callq 0x1637d
movq 0x18(%rsp), %rbp
jmp 0xa9a2
movq %rbx, %rdi
addq $0x3a8, %rsp            # imm = 0x3A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb2cf
leaq 0x4ba8(%rbx), %rdi
movl $0x8, %esi
callq 0x1637d
leaq 0x4e18(%rbx), %r15
leaq 0x4220(%rbx), %r14
movq %r15, %rdi
movq %r14, %rsi
movl $0x18, %edx
callq 0x19a70
movq %rax, %rbp
movq %r15, %rdi
movq %r14, %rsi
movl $0x1a, %edx
callq 0x19a70
movq %rax, %r14
leaq 0x28(%rax), %rsi
movq %rbx, %rdi
callq 0xbd89
leaq 0x67681(%rip), %rcx     # 0x723ea
movq %r15, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1a697
movq 0x52a8(%rbx), %rdx
leaq 0x6765b(%rip), %rcx     # 0x723e0
movq %r15, %rdi
movq %rbp, %rsi
callq 0x1a697
jmp 0xa9a2
leaq 0x4ba8(%rbx), %rdi
movl $0x10, %esi
callq 0x1637d
movq 0x5288(%rbx), %rbp
jmp 0xa9a2
leaq 0x4ba8(%rbx), %rbp
movq %rbp, %rdi
movl $0xe, %esi
callq 0x1637d
movq %rbp, %rdi
movl $0x3a, %esi
callq 0x1637d
leaq 0x4e18(%rbx), %r15
leaq 0x4220(%rbx), %r12
movq %r15, %rdi
movq %r12, %rsi
movl $0x15, %edx
callq 0x19a70
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
callq 0xa954
movq %rax, %r13
movq %rax, %rdi
movl $0x2e, %esi
callq 0x1a3e3
testb %al, %al
jne 0xae28
movq 0x5118(%rbx), %rdi
leaq 0x6b427(%rip), %rsi     # 0x76247
xorl %eax, %eax
callq *0x50f8(%rbx)
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x19e01
movq %rax, (%rsp)
movq %rbp, %rdi
movl $0x3b, %esi
callq 0x1637d
movq %rbx, %rdi
callq 0xbba0
movq %rax, %r13
cmpl $0x2, (%rax)
jne 0xae6d
movq 0x5118(%rbx), %rdi
leaq 0x6b401(%rip), %rsi     # 0x76266
xorl %eax, %eax
callq *0x50f8(%rbx)
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x19e01
movq %rax, %r13
movq %r15, %rdi
movq %r12, %rsi
movl $0x16, %edx
callq 0x19a70
movq %rax, %rbp
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x19e01
movq %rax, %r12
movq 0x5240(%rbx), %rdx
leaq 0x6b3cf(%rip), %rcx     # 0x7627f
movq %r15, %rdi
movq %rbp, %rsi
callq 0x1a697
leaq 0x6b3c2(%rip), %rcx     # 0x76284
movq %r15, %rdi
movq %rbp, %rsi
movq (%rsp), %rdx
callq 0x1a697
leaq 0x67516(%rip), %rcx     # 0x723ee
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x1a697
leaq 0x6b39c(%rip), %rcx     # 0x76289
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x1a697
leaq 0x6b38d(%rip), %rcx     # 0x7628f
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x1a697
movq %rbp, 0x8(%r14)
movq %r14, %rbp
jmp 0xa9a2
movq %rax, %r14
jmp 0xa970
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x19e01
leaq 0x4ba8(%rbx), %r14
movq %r14, %rdi
movl $0x3a, %esi
callq 0x1637d
cmpl $0x3b, 0x4bd0(%rbx)
jne 0xb1a3
movq $0x0, 0x130(%rsp)
movq %r14, %rdi
movl $0x3b, %esi
callq 0x1637d
movq %rbx, %rdi
callq 0xbba0
movq %rax, %r15
movl $0x13, %ebp
jmp 0xb21a
movq 0x5240(%rbx), %r14
leaq 0x4e18(%rbx), %r12
leaq 0x4220(%rbx), %rsi
movl (%r14), %edx
movq %r12, %rdi
callq 0x19a70
movq %rax, %rbp
movb $0x1, 0x16(%rax)
movq $-0x1, 0x8(%rsp)
movq %r15, %rdi
movl $0x3c, %esi
callq 0x1637d
cmpl $0x45, 0x4bd0(%rbx)
jne 0xb16a
leaq 0x4bd8(%rbx), %r13
leaq 0x130(%rsp), %r14
movq %r15, %rdi
movl $0x45, %esi
callq 0x16329
movq %r14, %rdi
movq %r13, %rsi
callq 0x30a0
movq %r15, %rdi
callq 0x15914
cmpl $0x31, 0x4bd0(%rbx)
jne 0xb047
movq %r15, %rdi
movl $0x31, %esi
callq 0x1637d
movq $0x0, 0x30(%rsp)
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x111c3
movq 0x5240(%rbx), %rsi
movq 0x30(%rsp), %rdx
movq %r12, %rdi
callq 0x1a277
movq 0x8(%rsp), %rcx
jmp 0xb054
movq 0x8(%rsp), %rcx
incq %rcx
movq %rcx, 0x8(%rsp)
movl (%rbp), %edi
leal -0x4(%rdi), %eax
cmpl $0x16, %eax
ja 0xb0dc
leaq 0x6b0a2(%rip), %rdx     # 0x76108
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
cmpq $0xff, %rcx
ja 0xb0dc
jmp 0xb131
movslq %ecx, %rax
jmp 0xb0d7
movsbq %cl, %rax
jmp 0xb0d7
cmpq $0x1, %rcx
ja 0xb0dc
jmp 0xb131
movq %rcx, %rax
btrq $0x3f, %rax
movq %rax, %xmm0
ucomisd 0x6af50(%rip), %xmm0    # 0x75ff8
ja 0xb0dc
jmp 0xb131
cmpq $0xffff, %rcx           # imm = 0xFFFF
ja 0xb0dc
jmp 0xb131
movq %rcx, %rax
btrq $0x3f, %rax
movq %rax, %xmm0
ucomisd 0x6af21(%rip), %xmm0    # 0x75ff0
ja 0xb0dc
jmp 0xb131
movswq %cx, %rax
cmpq %rcx, %rax
je 0xb131
movq 0x10(%rsp), %rax
movq 0x50f8(%rax), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rax
movq %r12, %rbx
movq %r13, %r12
movq %r14, %r13
movq %rbp, %r14
movq 0x5118(%rax), %rbp
callq 0x1adb4
movq %rbp, %rdi
movq %r14, %rbp
movq %r13, %r14
movq %r12, %r13
movq %rbx, %r12
leaq 0x6b119(%rip), %rsi     # 0x76238
movq %rax, %rdx
xorl %eax, %eax
callq *(%rsp)
movq 0x10(%rsp), %rbx
movq 0x8(%rsp), %rcx
movq %r12, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1a9b3
movq %r15, %rdi
movl $0x40, %esi
callq 0x1637d
cmpl $0x45, 0x4bd0(%rbx)
je 0xafdb
jmp 0xb16a
movq %rcx, %rax
shrq $0x20, %rax
jne 0xb0dc
jmp 0xb131
movq %r15, %rdi
movl $0x3d, %esi
callq 0x1637d
movq %rbp, %rdi
xorl %esi, %esi
callq 0x1a97c
testq %rax, %rax
jne 0xa9a2
leaq 0x6aec6(%rip), %rdx     # 0x76057
movq %r12, %rdi
movq %rbp, %rsi
xorl %ecx, %ecx
callq 0x1a9b3
jmp 0xa9a2
leaq 0x30(%rsp), %r15
movq $0x0, (%r15)
leaq 0x130(%rsp), %r12
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x111c3
leaq 0x4e18(%rbx), %rdi
movq 0x5240(%rbx), %rsi
movq (%r15), %rdx
callq 0x1a277
movq (%r12), %rax
shrq $0x1f, %rax
je 0xb1fb
movq 0x5118(%rbx), %rdi
leaq 0x6b002(%rip), %rsi     # 0x761f5
xorl %eax, %eax
callq *0x50f8(%rbx)
movq %r14, %rdi
movl $0x3b, %esi
callq 0x1637d
movq %rbx, %rdi
xorl %esi, %esi
callq 0xa954
movq %rax, %r15
movl $0x12, %ebp
cmpl $0x2, (%r15)
jne 0xb236
movq 0x5118(%rbx), %rdi
leaq 0x6afdc(%rip), %rsi     # 0x7620a
xorl %eax, %eax
callq *0x50f8(%rbx)
cmpq $0x0, 0x130(%rsp)
jle 0xb27d
leaq 0x4e18(%rbx), %rdi
movq %r15, %rsi
callq 0x19e29
movslq %eax, %rcx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %edx, %edx
idivq 0x130(%rsp)
cmpq %rcx, %rax
jge 0xb27d
movq 0x5118(%rbx), %rdi
leaq 0x6afb0(%rip), %rsi     # 0x76225
xorl %eax, %eax
callq *0x50f8(%rbx)
leaq 0x4e18(%rbx), %rdi
addq $0x4220, %rbx           # imm = 0x4220
movq %rbx, %rsi
movl %ebp, %edx
callq 0x19a70
movq %rax, %rbp
movq %r15, 0x8(%rax)
cmpl $0x12, (%rax)
jne 0xa9a2
movl 0x130(%rsp), %eax
movl %eax, 0x10(%rbp)
imull 0xc0(%r15), %eax
movl %eax, 0xc0(%rbp)
movl 0xc4(%r15), %eax
movl %eax, 0xc4(%rbp)
jmp 0xa9a2