// File: /workspace/github_c_makefile_star2_O3/vtereshkov[P]umka-lang/src/umka_decl.c
// Function: parseDecl
void parseDecl(Compiler *comp)
{
    switch (comp->lex.tok.kind)
    {
        case TOK_TYPE:   parseTypeDecl(comp);       break;
        case TOK_CONST:  parseConstDecl(comp);      break;
        case TOK_VAR:    parseFullVarDecl(comp);    break;
        case TOK_IDENT:  parseShortVarDecl(comp);   break;
        case TOK_FN:     parseFnDecl(comp);         break;

        case TOK_EOF:    if (comp->blocks.top == 0)
                             break;

        default: comp->error.handler(comp->error.context, "Declaration expected but %s found", lexSpelling(comp->lex.tok.kind)); break;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdi, %rbx
movl 0x4bd0(%rdi), %edi
cmpl $0x13, %edi
jg 0xb5fc
cmpl $0x3, %edi
je 0xb658
cmpl $0x8, %edi
je 0xb720
cmpl $0x13, %edi
jne 0xb620
leaq 0x4ba8(%rbx), %r15
movq %r15, %rdi
movl $0x13, %esi
callq 0x1637d
leaq 0x4e18(%rbx), %r14
movq %r14, %rdi
movl $0x1, %esi
callq 0x1a553
cmpl $0x38, 0x4bd0(%rbx)
jne 0xb9e0
movq %r15, %rdi
callq 0x15914
cmpl $0x45, 0x4bd0(%rbx)
jne 0xb9d1
movq %rbx, %rdi
callq 0xc0c3
movq %r15, %rdi
movl $0x40, %esi
callq 0x1637d
jmp 0xb5d8
cmpl $0x14, %edi
je 0xb6d3
cmpl $0x45, %edi
je 0xb96d
cmpl $0x4c, %edi
jne 0xb620
cmpl $0x0, 0x4b84(%rbx)
je 0xba0e
movq 0x50f8(%rbx), %r14
movq 0x5118(%rbx), %rbx
callq 0x1636f
leaq 0x6ab94(%rip), %rsi     # 0x761ce
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
movq %r14, %rcx
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rcx
leaq 0x4ba8(%rbx), %r14
movq %r14, %rdi
movl $0x3, %esi
callq 0x1637d
movq $0x0, 0x20(%rsp)
cmpl $0x38, 0x4bd0(%rbx)
jne 0xb986
movq %r14, %rdi
callq 0x15914
cmpl $0x45, 0x4bd0(%rbx)
jne 0xb6c1
leaq 0x20(%rsp), %r15
leaq 0x18(%rsp), %r12
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xc19d
movq %r14, %rdi
movl $0x40, %esi
callq 0x1637d
cmpl $0x45, 0x4bd0(%rbx)
je 0xb69d
movq %r14, %rdi
movl $0x39, %esi
callq 0x1637d
jmp 0xba0e
leaq 0x4ba8(%rbx), %r14
movq %r14, %rdi
movl $0x14, %esi
callq 0x1637d
cmpl $0x38, 0x4bd0(%rbx)
jne 0xb99a
movq %r14, %rdi
callq 0x15914
cmpl $0x45, 0x4bd0(%rbx)
jne 0xb9b3
movq %rbx, %rdi
callq 0xc3c6
movq %r14, %rdi
movl $0x40, %esi
callq 0x1637d
jmp 0xb6fc
leaq 0x4220(%rbx), %r15
cmpl $0x0, 0x4b84(%rbx)
je 0xb746
movq 0x5118(%rbx), %rdi
leaq 0x6ad1f(%rip), %rsi     # 0x7645d
xorl %eax, %eax
callq *0x50f8(%rbx)
leaq 0x4ba8(%rbx), %r12
movq %r12, %rdi
movl $0x8, %esi
callq 0x1637d
leaq 0x4e18(%rbx), %rbp
movq %rbp, %rdi
movq %r15, %rsi
movl $0x1a, %edx
callq 0x19a70
movq %rax, %r13
movq %rax, %r14
cmpl $0x38, 0x4bd0(%rbx)
movq %rax, 0x8(%rsp)
jne 0xb885
movq %r12, %rdi
movl $0x38, %esi
callq 0x1637d
movq %r12, %rdi
movl $0x45, %esi
callq 0x1637d
leaq 0x4bd8(%rbx), %rsi
leaq 0x20(%rsp), %rdi
callq 0x30a0
movq %r12, %rdi
movl $0x41, %esi
callq 0x1637d
movq %rbx, %rdi
xorl %esi, %esi
callq 0xa954
movq %rax, %r14
cmpl $0x10, (%rax)
jne 0xb7e0
movq 0x8(%r14), %rax
movq 0x18(%rax), %rcx
testq %rcx, %rcx
jne 0xb7fe
movq 0x5118(%rbx), %rdi
leaq 0x6acbf(%rip), %rsi     # 0x764ad
xorl %eax, %eax
callq *0x50f8(%rbx)
movq 0x8(%r14), %rax
movq 0x18(%rax), %rcx
movq %r15, 0x10(%rsp)
movl 0x110(%rcx), %ecx
cmpl 0x4b88(%rbx), %ecx
je 0xb82b
movq 0x5118(%rbx), %rdi
leaq 0x6acbd(%rip), %rsi     # 0x764dc
xorl %eax, %eax
callq *0x50f8(%rbx)
movq 0x8(%r14), %rax
leaq 0x28(%r13), %r15
movl (%rax), %eax
cmpl $0x17, %eax
je 0xb83b
cmpl $0x10, %eax
jne 0xb851
movq 0x5118(%rbx), %rdi
leaq 0x6acca(%rip), %rsi     # 0x76513
xorl %eax, %eax
callq *0x50f8(%rbx)
movq 0x8(%rsp), %rax
movb $0x1, 0x30(%rax)
leaq 0x20(%rsp), %rcx
movq %rbp, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rax, %r14
xorl %r8d, %r8d
callq 0x1ab67
movq %r12, %rdi
movl $0x39, %esi
callq 0x1637d
movq 0x10(%rsp), %r15
movq %r12, %rdi
movl $0x45, %esi
callq 0x16329
leaq 0x4bd8(%rbx), %rsi
leaq 0x20(%rsp), %rdi
callq 0x30a0
cmpb $0x1, 0x30(%r14)
jne 0xb8ea
movq 0x38(%r14), %rax
movq 0x108(%rax), %rax
movq 0x8(%rax), %rdi
cmpl $0x16, (%rdi)
jne 0xb8ea
leaq 0x20(%rsp), %rsi
xorl %edx, %edx
callq 0x1a5a1
testq %rax, %rax
je 0xb8ea
movq 0x5118(%rbx), %rdi
leaq 0x6abb1(%rip), %rsi     # 0x7648e
leaq 0x20(%rsp), %rdx
xorl %eax, %eax
callq *0x50f8(%rbx)
addq $0x28, %r13
movq %r12, %rdi
callq 0x15914
movl 0x4bd0(%rbx), %r14d
cmpl $0x18, %r14d
jne 0xb90b
movq %r12, %rdi
callq 0x162fb
xorl %ebp, %ebp
cmpl $0x18, %r14d
sete %bpl
movq %rbx, %rdi
movq %r13, %rsi
callq 0xbd89
movslq 0x4e78(%rbx), %rax
leaq 0x4e38(%rbx), %rdi
leaq 0x100(%rbx), %rsi
movq %rax, (%rsp)
leaq 0x20(%rsp), %rcx
movq %r15, %rdx
movq 0x8(%rsp), %r8
movl %ebp, %r9d
callq 0x14d61
cmpl $0x3c, 0x4bd0(%rbx)
jne 0xba03
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x17b56
jmp 0xba0e
movq %rbx, %rdi
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb415
leaq 0x20(%rsp), %rsi
leaq 0x18(%rsp), %rdx
movq %rbx, %rdi
callq 0xc19d
jmp 0xba0e
movq %rbx, %rdi
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc3c6
movq %r14, %rdi
movl $0x39, %esi
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1637d
movq %r15, %rdi
movl $0x39, %esi
callq 0x1637d
jmp 0xb9e8
movq %rbx, %rdi
callq 0xc0c3
movq %r14, %rdi
xorl %esi, %esi
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1a553
movq %rbx, %rdi
movq %rax, %rsi
callq 0x19526
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq