// File: /workspace/github_c_makefile_star2_O1/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, %rbp
testq %r14, %r14
jne 0xfc53
movl 0x4bd0(%rbp), %ebx
cmpl $0x45, %ebx
jne 0xfb6c
movq %rbp, %rdi
callq 0x12c9c
movq %rax, %r14
jmp 0xfb4b
leal -0x7(%rbx), %eax
cmpl $0xe, %eax
movq %rbp, 0x8(%rsp)
ja 0xfbe7
leaq 0x6754c(%rip), %rcx     # 0x770cc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x4ba8(%rbp), %r15
movq %r15, %rdi
movl $0x7, %esi
callq 0x1b41f
cmpl $0x38, 0x4bd0(%rbp)
jne 0x10135
movq %r15, %rdi
callq 0x1a984
movq %rbp, %rdi
xorl %esi, %esi
callq 0xfb34
movq %rax, %r14
leaq 0x4e18(%rbp), %rdi
movq 0x5240(%rbp), %rsi
movq %rax, %rdx
callq 0x1f2a6
movq %r15, %rdi
movl $0x39, %esi
callq 0x1b41f
jmp 0x1013c
cmpl $0x3a, %ebx
je 0x100fc
cmpl $0x3e, %ebx
jne 0xfc8a
leaq 0x4ba8(%rbp), %r14
cmpl $0x15, %ebx
jne 0xfc0d
movq %r14, %rdi
callq 0x1a984
movq %r14, %rdi
movl $0x3e, %esi
callq 0x1b41f
movq %rbp, %rdi
callq 0x10d52
leaq 0x4e18(%rbp), %rdi
addq $0x4220, %rbp           # imm = 0x4220
movq %rbp, %rsi
movq %rax, %rdx
callq 0x1edd3
movq %rax, %r14
cmpl $0x15, %ebx
jne 0x10470
movl $0x11, (%r14)
jmp 0x10470
cmpl $0x2, (%r14)
je 0xfc6f
movq 0x5118(%rbp), %rdi
leaq 0x67559(%rip), %rsi     # 0x771c0
xorl %eax, %eax
callq *0x50f8(%rbp)
addq $0x4ba8, %rbp           # imm = 0x4BA8
movq %rbp, %rdi
callq 0x1a984
movq 0x108(%r14), %r14
jmp 0x10470
movq 0x5118(%rbp), %rdi
leaq 0x67528(%rip), %rsi     # 0x771c0
xorl %r14d, %r14d
xorl %eax, %eax
callq *0x50f8(%rbp)
jmp 0x10470
leaq 0x4ba8(%rbp), %rbx
movq %rbx, %rdi
movl $0xb, %esi
callq 0x1b41f
movq %rbx, %rdi
movl $0x3c, %esi
callq 0x1b41f
leaq 0x4e18(%rbp), %r13
leaq 0x4220(%rbp), %r15
movq %r13, %rdi
movq %r15, %rsi
movl $0x17, %edx
callq 0x1ea48
movq %rax, %r14
movq 0x5298(%rbp), %rdx
leaq 0x636d8(%rip), %rcx     # 0x733d0
movq %r13, %rdi
movq %rax, %rsi
callq 0x1f6e2
movq 0x5298(%rbp), %rdx
leaq 0x636c5(%rip), %rcx     # 0x733d6
movq %r13, %rdi
movq %r14, %rsi
callq 0x1f6e2
cmpl $0x45, 0x4bd0(%rbp)
jne 0xfec4
movq 0x8(%rsp), %rax
leaq 0xf0(%rax), %r12
addq $0x4bd8, %rax           # imm = 0x4BD8
movq %rax, 0x20(%rsp)
movq %rbx, 0x28(%rsp)
movq %r15, 0x10(%rsp)
movl $0x270, %edx            # imm = 0x270
leaq 0x130(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x3260
movq %rbp, %rdi
callq 0x1a984
cmpl $0x38, 0x158(%rsp)
jne 0xfdfb
leaq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x30a0
movq %rbx, %rdi
callq 0x1a984
movq %r13, %rdi
movq %r15, %rsi
movl $0x1a, %edx
callq 0x1ea48
movq %rax, %r15
leaq 0x28(%rax), %rbx
movb $0x1, 0x30(%rax)
movq %r14, %rbp
movq 0x8(%rsp), %r14
movq 0x5298(%r14), %rdx
movq %r13, %rdi
movq %rbx, %rsi
leaq 0x6360a(%rip), %rcx     # 0x733d0
xorl %r8d, %r8d
callq 0x1fbf9
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10f42
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
leaq 0x30(%rsp), %rcx
callq 0x1f6e2
movl 0x110(%rax), %eax
movl %eax, 0x34(%r15)
jmp 0xfe98
movq %r14, %rbp
movq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0xfb34
movq %rax, %r15
cmpl $0x17, (%rax)
je 0xfe2d
movq 0x8(%rsp), %rcx
movq 0x5118(%rcx), %rdi
leaq 0x674dc(%rip), %rsi     # 0x77301
xorl %eax, %eax
callq *0x50f8(%rcx)
cmpl $0x3, 0x10(%r15)
jl 0xfe98
movl $0x2, %r14d
movq %r13, %rdi
movq 0x10(%rsp), %rsi
movl $0x1a, %edx
callq 0x1ea48
movq %rax, %rbx
movq 0x28(%r15), %rax
movq (%rax,%r14,8), %rax
movq 0x108(%rax), %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1ec6f
movq 0x28(%r15), %rax
movq (%rax,%r14,8), %rcx
movq %r13, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x1f6e2
movb $0x1, 0x30(%rbx)
movl 0x110(%rax), %eax
movl %eax, 0x34(%rbx)
incq %r14
movslq 0x10(%r15), %rax
cmpq %rax, %r14
jl 0xfe3a
movq 0x28(%rsp), %rbx
movq %rbx, %rdi
movl $0x40, %esi
callq 0x1b41f
movq 0x8(%rsp), %rax
cmpl $0x45, 0x4bd0(%rax)
movq %rbp, %r14
movq 0x10(%rsp), %r15
je 0xfd4a
movq %rbx, %rdi
movl $0x3d, %esi
callq 0x1b41f
jmp 0x10470
movq %rbp, %rdi
addq $0x3a8, %rsp            # imm = 0x3A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10485
leaq 0x4ba8(%rbp), %rdi
movl $0x8, %esi
callq 0x1b41f
leaq 0x4e18(%rbp), %r15
leaq 0x4220(%rbp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
movl $0x18, %edx
callq 0x1ea48
movq %rax, %r14
movq %r15, %rdi
movq %rbx, %rsi
movl $0x1a, %edx
callq 0x1ea48
movq %rax, %rbx
leaq 0x28(%rax), %rsi
movq %rbp, %rdi
callq 0x10f42
leaq 0x634a3(%rip), %rcx     # 0x733ea
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1f6e2
movq 0x52a8(%rbp), %rdx
leaq 0x6347d(%rip), %rcx     # 0x733e0
movq %r15, %rdi
movq %r14, %rsi
callq 0x1f6e2
jmp 0x10470
leaq 0x4ba8(%rbp), %rdi
movl $0x10, %esi
callq 0x1b41f
movq 0x5288(%rbp), %r14
jmp 0x10470
movq %rbp, %rbx
addq $0x4ba8, %rbp           # imm = 0x4BA8
movq %rbp, %rdi
movl $0xe, %esi
callq 0x1b41f
movq %rbp, %rdi
movl $0x3a, %esi
callq 0x1b41f
leaq 0x4e18(%rbx), %r15
leaq 0x4220(%rbx), %r12
movq %r15, %rdi
movq %r12, %rsi
movl $0x15, %edx
callq 0x1ea48
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
callq 0xfb34
movq %rax, %r13
movq %rax, %rdi
movl $0x2e, %esi
callq 0x1f412
testb %al, %al
jne 0x10009
movq 0x5118(%rbx), %rdi
leaq 0x67246(%rip), %rsi     # 0x77247
xorl %eax, %eax
callq *0x50f8(%rbx)
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x1edd3
movq %rax, 0x10(%rsp)
movq %rbp, %rdi
movl $0x3b, %esi
callq 0x1b41f
movq %rbx, %rdi
callq 0x10d52
movq %rax, %r13
cmpl $0x2, (%rax)
jne 0x1004f
movq 0x5118(%rbx), %rdi
leaq 0x6721f(%rip), %rsi     # 0x77266
xorl %eax, %eax
callq *0x50f8(%rbx)
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x1edd3
movq %rax, %r13
movq %r15, %rdi
movq %r12, %rsi
movl $0x16, %edx
callq 0x1ea48
movq %rax, %rbp
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x1edd3
movq %rax, %r12
movq 0x5240(%rbx), %rdx
leaq 0x671ed(%rip), %rcx     # 0x7727f
movq %r15, %rdi
movq %rbp, %rsi
callq 0x1f6e2
leaq 0x671e0(%rip), %rcx     # 0x77284
movq %r15, %rdi
movq %rbp, %rsi
movq 0x10(%rsp), %rdx
callq 0x1f6e2
leaq 0x63333(%rip), %rcx     # 0x733ee
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x1f6e2
leaq 0x671b9(%rip), %rcx     # 0x77289
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x1f6e2
leaq 0x671aa(%rip), %rcx     # 0x7728f
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x1f6e2
movq %rbp, 0x8(%r14)
jmp 0x10470
leaq 0x4ba8(%rbp), %r14
movq %r14, %rdi
movl $0x3a, %esi
callq 0x1b41f
movl 0x4bd0(%rbp), %ebx
cmpl $0x3b, %ebx
jne 0x1032e
movq $0x0, 0x130(%rsp)
movl $0x13, %ebp
jmp 0x1038b
movq 0x5240(%rbp), %r14
leaq 0x4e18(%rbp), %r12
leaq 0x4220(%rbp), %rsi
movl (%r14), %edx
movq %r12, %rdi
callq 0x1ea48
movq %rax, %r14
movb $0x1, 0x16(%rax)
movq $-0x1, 0x18(%rsp)
movq %r15, %rdi
movl $0x3c, %esi
callq 0x1b41f
cmpl $0x45, 0x4bd0(%rbp)
jne 0x102f5
leaq 0x4bd8(%rbp), %r13
leaq 0x130(%rsp), %rbx
movq %r12, 0x10(%rsp)
movq %r15, %rdi
movl $0x45, %esi
callq 0x1b3c8
movq %rbx, %rdi
movq %r13, %rsi
callq 0x30a0
movq %r15, %rdi
callq 0x1a984
cmpl $0x31, 0x4bd0(%rbp)
jne 0x101fa
movq %r15, %rdi
movl $0x31, %esi
callq 0x1b41f
movq $0x0, 0x30(%rsp)
movq %rbp, %rdi
leaq 0x30(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x1617b
movq 0x5240(%rbp), %rsi
movq 0x30(%rsp), %rdx
movq %r12, %rdi
callq 0x1f2a6
jmp 0x101ff
incq 0x18(%rsp)
movl (%r14), %edi
leal -0x4(%rdi), %ecx
cmpl $0x16, %ecx
ja 0x10282
movq 0x18(%rsp), %rax
leaq 0x66ef2(%rip), %rdx     # 0x77108
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
cmpq $0x100, %rax            # imm = 0x100
jmp 0x10252
movslq %eax, %rcx
jmp 0x10272
movsbq %al, %rcx
jmp 0x10272
cmpq $0x2, %rax
jmp 0x10252
btrq $0x3f, %rax
movq %rax, %xmm0
ucomisd 0x66d66(%rip), %xmm0    # 0x76fb0
jmp 0x10269
cmpq $0x10000, %rax          # imm = 0x10000
setae %al
jmp 0x1027e
btrq $0x3f, %rax
movq %rax, %xmm0
ucomisd 0x66d3f(%rip), %xmm0    # 0x76fa8
seta %al
jmp 0x1027e
movswq %ax, %rcx
cmpq %rax, %rcx
jmp 0x1027b
shrq $0x20, %rax
setne %al
testb %al, %al
je 0x102c8
movq %r13, %r12
movq %rbx, %r13
movq %r14, %rbx
movq 0x50f8(%rbp), %r14
movq 0x8(%rsp), %rax
movq 0x5118(%rax), %rbp
callq 0x1fe46
movq %rbp, %rdi
movq 0x8(%rsp), %rbp
leaq 0x66f86(%rip), %rsi     # 0x77238
movq %rax, %rdx
xorl %eax, %eax
callq *%r14
movq %rbx, %r14
movq %r13, %rbx
movq %r12, %r13
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %rcx
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1fa67
movq %r15, %rdi
movl $0x40, %esi
callq 0x1b41f
cmpl $0x45, 0x4bd0(%rbp)
je 0x10193
movq %r15, %rdi
movl $0x3d, %esi
callq 0x1b41f
movq %r14, %rdi
xorl %esi, %esi
callq 0x1fa0a
testq %rax, %rax
jne 0x10470
leaq 0x66d3b(%rip), %rdx     # 0x77057
movq %r12, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x1fa67
jmp 0x10470
leaq 0x30(%rsp), %r15
movq $0x0, (%r15)
leaq 0x130(%rsp), %r12
movq %rbp, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x1617b
leaq 0x4e18(%rbp), %rdi
movq 0x5240(%rbp), %rsi
movq (%r15), %rdx
callq 0x1f2a6
movq (%r12), %rax
shrq $0x1f, %rax
je 0x10386
movq 0x5118(%rbp), %rdi
leaq 0x66e77(%rip), %rsi     # 0x771f5
xorl %eax, %eax
callq *0x50f8(%rbp)
movl $0x12, %ebp
movq %r14, %rdi
movl $0x3b, %esi
callq 0x1b41f
cmpl $0x3b, %ebx
jne 0x103a9
movq 0x8(%rsp), %rdi
callq 0x10d52
jmp 0x103b5
movq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0xfb34
movq %rax, %r15
cmpl $0x2, (%rax)
jne 0x103d8
movq 0x8(%rsp), %rcx
movq 0x5118(%rcx), %rdi
leaq 0x66e3a(%rip), %rsi     # 0x7720a
xorl %eax, %eax
callq *0x50f8(%rcx)
cmpq $0x0, 0x130(%rsp)
movq 0x8(%rsp), %rbx
jle 0x10424
leaq 0x4e18(%rbx), %rdi
movq %r15, %rsi
callq 0x1ede7
movslq %eax, %rcx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %edx, %edx
idivq 0x130(%rsp)
cmpq %rcx, %rax
jge 0x10424
movq 0x5118(%rbx), %rdi
leaq 0x66e09(%rip), %rsi     # 0x77225
xorl %eax, %eax
callq *0x50f8(%rbx)
leaq 0x4e18(%rbx), %rdi
addq $0x4220, %rbx           # imm = 0x4220
movq %rbx, %rsi
movl %ebp, %edx
callq 0x1ea48
movq %rax, %r14
movq %r15, 0x8(%rax)
cmpl $0x12, (%rax)
jne 0x10470
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