// File: /workspace/github_c_makefile_star2_O0/vtereshkov[P]umka-lang/src/umka_decl.c
// Function: parseConstDeclItem
static void parseConstDeclItem(Compiler *comp, const Type **type, Const *constant)
{
    lexCheck(&comp->lex, TOK_IDENT);
    IdentName name;
    strcpy(name, comp->lex.tok.name);

    lexNext(&comp->lex);
    bool exported = parseExportMark(comp);

    if (*type && typeInteger(*type) && comp->lex.tok.kind != TOK_EQ)
    {
        constant->intVal++;

        if (typeOverflow((*type)->kind, *constant))
            comp->error.handler(comp->error.context, "Overflow of %s", typeKindSpelling((*type)->kind));
    }
    else
    {
        lexEat(&comp->lex, TOK_EQ);
        *type = NULL;
        parseExpr(comp, type, constant);

        if (!typeOrdinal(*type) && !typeReal(*type) && (*type)->kind != TYPE_STR && (*type)->kind != TYPE_CLOSURE)
            comp->error.handler(comp->error.context, "Constant must be ordinal, or real, or string, or closure");
    }

    identAddConst(&comp->idents, &comp->modules, &comp->blocks, name, *type, exported, *constant);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
addq $0x4ba8, %rdi           # imm = 0x4BA8
movl $0x45, %esi
callq 0x1b080
leaq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x4ba8, %rsi           # imm = 0x4BA8
addq $0x28, %rsi
addq $0x8, %rsi
callq 0x30a0
movq -0x8(%rbp), %rdi
addq $0x4ba8, %rdi           # imm = 0x4BA8
callq 0x1ad90
movq -0x8(%rbp), %rdi
callq 0xbe90
andb $0x1, %al
movb %al, -0x121(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0xc118
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xc200
testb $0x1, %al
jne 0xc08f
jmp 0xc118
movq -0x8(%rbp), %rax
cmpl $0x31, 0x4bd0(%rax)
je 0xc118
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl (%rax), %edi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0xb510
testb $0x1, %al
jne 0xc0c5
jmp 0xc113
movq -0x8(%rbp), %rax
movq 0x50f8(%rax), %rax
movq %rax, -0x130(%rbp)
movq -0x8(%rbp), %rax
movq 0x5118(%rax), %rax
movq %rax, -0x138(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl (%rax), %edi
callq 0x23b40
movq -0x138(%rbp), %rdi
movq -0x130(%rbp), %rcx
movq %rax, %rdx
leaq 0x1cc171(%rip), %rsi    # 0x1d8280
movb $0x0, %al
callq *%rcx
jmp 0xc1a4
movq -0x8(%rbp), %rdi
addq $0x4ba8, %rdi           # imm = 0x4BA8
movl $0x31, %esi
callq 0x1b150
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xe8c0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xc240
testb $0x1, %al
jne 0xc1a2
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xc260
testb $0x1, %al
jne 0xc1a2
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $0x14, (%rax)
je 0xc1a2
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $0x18, (%rax)
je 0xc1a2
movq -0x8(%rbp), %rax
movq 0x50f8(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x5118(%rax), %rdi
leaq 0x1cc2ce(%rip), %rsi    # 0x1d846c
movb $0x0, %al
callq *%rcx
jmp 0xc1a4
movq -0x8(%rbp), %rdi
addq $0x4e38, %rdi           # imm = 0x4E38
movq -0x8(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
movq -0x8(%rbp), %rdx
addq $0x4220, %rdx           # imm = 0x4220
leaq -0x120(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %r8
movb -0x121(%rbp), %r9b
movq -0x18(%rbp), %rax
movq (%rax), %rax
andb $0x1, %r9b
movzbl %r9b, %r9d
movq %rax, (%rsp)
callq 0x19a90
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
nopl (%rax,%rax)