// File: /workspace/github_c_makefile_star2_O0/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeSpellingRecursive
static char *typeSpellingRecursive(const Type *type, char *buf, int size, int depth)
{
    if (type->block == 0 && type->typeIdent)
        snprintf(buf, size, "%s", type->typeIdent->name);
    else
    {
        int len = 0;

        if (type->kind == TYPE_ARRAY)
        {
            len += snprintf(buf + len, nonneg(size - len), "[%d]", type->numItems);
        }
        else if (typeEnum(type))
        {
            len += snprintf(buf + len, nonneg(size - len), "enum(%s)", typeKindSpelling(type->kind));
        }
        else if (type->kind == TYPE_MAP)
        {
            char keyBuf[DEFAULT_STR_LEN + 1];
            len += snprintf(buf + len, nonneg(size - len), "map[%s]", typeSpellingRecursive(typeMapKey(type), keyBuf, DEFAULT_STR_LEN + 1, depth - 1));
        }
        else if (typeExprListStruct(type))
        {
            len += snprintf(buf + len, nonneg(size - len), "{ ");
            for (int i = 0; i < type->numItems; i++)
            {
                char fieldBuf[DEFAULT_STR_LEN + 1];
                len += snprintf(buf + len, nonneg(size - len), "%s ", typeSpellingRecursive(type->field[i]->type, fieldBuf, DEFAULT_STR_LEN + 1, depth - 1));
            }
            len += snprintf(buf + len, nonneg(size - len), "}");
        }
        else if (type->kind == TYPE_FN || type->kind == TYPE_CLOSURE)
        {
            const bool isClosure = type->kind == TYPE_CLOSURE;
            if (isClosure)
                type = type->field[0]->type;

            len += snprintf(buf + len, nonneg(size - len), "fn (");

            if (type->sig.isMethod)
            {
                char paramBuf[DEFAULT_STR_LEN + 1];
                len += snprintf(buf + len, nonneg(size - len), "%s) (", typeSpellingRecursive(type->sig.param[0]->type, paramBuf, DEFAULT_STR_LEN + 1, depth - 1));
            }

            const int numPreHiddenParams = 1;                                                 // #self or #upvalues
            const int numPostHiddenParams = typeStructured(type->sig.resultType) ? 1 : 0;     // #result

            for (int i = numPreHiddenParams; i < type->sig.numParams - numPostHiddenParams; i++)
            {
                if (i > numPreHiddenParams)
                    len += snprintf(buf + len, nonneg(size - len), ", ");

                char paramBuf[DEFAULT_STR_LEN + 1];
                len += snprintf(buf + len, nonneg(size - len), "%s", typeSpellingRecursive(type->sig.param[i]->type, paramBuf, DEFAULT_STR_LEN + 1, depth - 1));
            }

            len += snprintf(buf + len, nonneg(size - len), ")");

            if (type->sig.resultType->kind != TYPE_VOID)
            {
                char resultBuf[DEFAULT_STR_LEN + 1];
                len += snprintf(buf + len, nonneg(size - len), ": %s", typeSpellingRecursive(type->sig.resultType, resultBuf, DEFAULT_STR_LEN + 1, depth - 1));
            }

            if (isClosure)
                len += snprintf(buf + len, nonneg(size - len), " |...|");
        }
        else
        {
            snprintf(buf + len, nonneg(size - len), "%s", spelling[type->kind]);
        }

        if (type->kind == TYPE_PTR || type->kind == TYPE_WEAKPTR || type->kind == TYPE_ARRAY || type->kind == TYPE_DYNARRAY || type->kind == TYPE_MAP)
        {
            const Type *itemType = (type->kind == TYPE_MAP) ? typeMapItem(type) : type->base;

            char itemBuf[DEFAULT_STR_LEN + 1];
            if (depth > 0)
                strncat(buf, typeSpellingRecursive(itemType, itemBuf, DEFAULT_STR_LEN + 1, depth - 1), nonneg(size - len - 1));
            else
                strncat(buf, "...", nonneg(size - len - 1));
        }
    }
    return buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x720, %rsp            # imm = 0x720
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jne 0x23bb5
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x23bb5
movq -0x10(%rbp), %rdi
movslq -0x14(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
addq $0x4, %rcx
leaq 0x1b63fa(%rip), %rdx    # 0x1d9fa3
movb $0x0, %al
callq 0x3170
jmp 0x242b8
movl $0x0, -0x1c(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x12, (%rax)
jne 0x23c0f
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x668(%rbp)
movl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
movslq %eax, %rdi
callq 0x24550
movq -0x668(%rbp), %rdi
movq %rax, %rsi
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
leaq 0x1b6379(%rip), %rdx    # 0x1d9f76
movb $0x0, %al
callq 0x3170
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x241ba
movq -0x8(%rbp), %rdi
callq 0x21f60
testb $0x1, %al
jne 0x23c1e
jmp 0x23c7a
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x678(%rbp)
movl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
movslq %eax, %rdi
callq 0x24550
movq %rax, -0x670(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %edi
callq 0x23b40
movq -0x678(%rbp), %rdi
movq -0x670(%rbp), %rsi
movq %rax, %rcx
leaq 0x1b6313(%rip), %rdx    # 0x1d9f7b
movb $0x0, %al
callq 0x3170
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x241b8
movq -0x8(%rbp), %rax
cmpl $0x15, (%rax)
jne 0x23cf7
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x688(%rbp)
movl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
movslq %eax, %rdi
callq 0x24550
movq %rax, -0x680(%rbp)
movq -0x8(%rbp), %rdi
callq 0x24340
movq %rax, %rdi
leaq -0x120(%rbp), %rsi
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movl $0x100, %edx            # imm = 0x100
callq 0x23b60
movq -0x688(%rbp), %rdi
movq -0x680(%rbp), %rsi
movq %rax, %rcx
leaq 0x1b629f(%rip), %rdx    # 0x1d9f84
movb $0x0, %al
callq 0x3170
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x241b6
movq -0x8(%rbp), %rdi
callq 0x24580
testb $0x1, %al
jne 0x23d09
jmp 0x23e38
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x690(%rbp)
movl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
movslq %eax, %rdi
callq 0x24550
movq -0x690(%rbp), %rdi
movq %rax, %rsi
leaq 0x1b6252(%rip), %rdx    # 0x1d9f8c
movb $0x0, %al
callq 0x3170
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl $0x0, -0x124(%rbp)
movl -0x124(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x23df5
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x6a0(%rbp)
movl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
movslq %eax, %rdi
callq 0x24550
movq %rax, -0x698(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x108(%rax), %rdi
leaq -0x230(%rbp), %rsi
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movl $0x100, %edx            # imm = 0x100
callq 0x23b60
movq -0x6a0(%rbp), %rdi
movq -0x698(%rbp), %rsi
movq %rax, %rcx
leaq 0x1b61bb(%rip), %rdx    # 0x1d9f8f
movb $0x0, %al
callq 0x3170
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x124(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x124(%rbp)
jmp 0x23d51
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x6a8(%rbp)
movl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
movslq %eax, %rdi
callq 0x24550
movq -0x6a8(%rbp), %rdi
movq %rax, %rsi
leaq 0x1b58ff(%rip), %rdx    # 0x1d9725
movb $0x0, %al
callq 0x3170
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x241b4
movq -0x8(%rbp), %rax
cmpl $0x1a, (%rax)
je 0x23e4e
movq -0x8(%rbp), %rax
cmpl $0x18, (%rax)
jne 0x24167
movq -0x8(%rbp), %rax
cmpl $0x18, (%rax)
sete %al
andb $0x1, %al
movb %al, -0x231(%rbp)
testb $0x1, -0x231(%rbp)
je 0x23e7f
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movq 0x108(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x6b0(%rbp)
movl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
movslq %eax, %rdi
callq 0x24550
movq -0x6b0(%rbp), %rdi
movq %rax, %rsi
leaq 0x1b60e3(%rip), %rdx    # 0x1d9f93
movb $0x0, %al
callq 0x3170
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
testb $0x1, 0x30(%rax)
je 0x23f39
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x6c0(%rbp)
movl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
movslq %eax, %rdi
callq 0x24550
movq %rax, -0x6b8(%rbp)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x108(%rax), %rdi
leaq -0x340(%rbp), %rsi
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movl $0x100, %edx            # imm = 0x100
callq 0x23b60
movq -0x6c0(%rbp), %rdi
movq -0x6b8(%rbp), %rsi
movq %rax, %rcx
leaq 0x1b606c(%rip), %rdx    # 0x1d9f98
movb $0x0, %al
callq 0x3170
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl $0x1, -0x344(%rbp)
movq -0x8(%rbp), %rax
movq 0xb8(%rax), %rdi
callq 0x23a80
movb %al, %dl
xorl %eax, %eax
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x348(%rbp)
movl $0x1, -0x34c(%rbp)
movl -0x34c(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x28(%rcx), %ecx
subl -0x348(%rbp), %ecx
cmpl %ecx, %eax
jge 0x24062
cmpl $0x1, -0x34c(%rbp)
jle 0x23fd4
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x6c8(%rbp)
movl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
movslq %eax, %rdi
callq 0x24550
movq -0x6c8(%rbp), %rdi
movq %rax, %rsi
leaq 0x1b5fd7(%rip), %rdx    # 0x1d9f9e
movb $0x0, %al
callq 0x3170
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x6d8(%rbp)
movl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
movslq %eax, %rdi
callq 0x24550
movq %rax, -0x6d0(%rbp)
movq -0x8(%rbp), %rax
movslq -0x34c(%rbp), %rcx
movq 0x38(%rax,%rcx,8), %rax
movq 0x108(%rax), %rdi
leaq -0x450(%rbp), %rsi
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movl $0x100, %edx            # imm = 0x100
callq 0x23b60
movq -0x6d8(%rbp), %rdi
movq -0x6d0(%rbp), %rsi
movq %rax, %rcx
leaq 0x1b5f62(%rip), %rdx    # 0x1d9fa3
movb $0x0, %al
callq 0x3170
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x34c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34c(%rbp)
jmp 0x23f72
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x6e0(%rbp)
movl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
movslq %eax, %rdi
callq 0x24550
movq -0x6e0(%rbp), %rdi
movq %rax, %rsi
leaq 0x1b9f5e(%rip), %rdx    # 0x1ddff1
movb $0x0, %al
callq 0x3170
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq 0xb8(%rax), %rax
cmpl $0x2, (%rax)
je 0x2411e
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x6f0(%rbp)
movl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
movslq %eax, %rdi
callq 0x24550
movq %rax, -0x6e8(%rbp)
movq -0x8(%rbp), %rax
movq 0xb8(%rax), %rdi
leaq -0x550(%rbp), %rsi
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movl $0x100, %edx            # imm = 0x100
callq 0x23b60
movq -0x6f0(%rbp), %rdi
movq -0x6e8(%rbp), %rsi
movq %rax, %rcx
leaq 0x1b5e90(%rip), %rdx    # 0x1d9fa1
movb $0x0, %al
callq 0x3170
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
testb $0x1, -0x231(%rbp)
je 0x24165
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x6f8(%rbp)
movl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
movslq %eax, %rdi
callq 0x24550
movq -0x6f8(%rbp), %rdi
movq %rax, %rsi
leaq 0x1b5e4e(%rip), %rdx    # 0x1d9fa6
movb $0x0, %al
callq 0x3170
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x241b2
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x700(%rbp)
movl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
movslq %eax, %rdi
callq 0x24550
movq -0x700(%rbp), %rdi
movq %rax, %rsi
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, %ecx
leaq 0x1c2310(%rip), %rax    # 0x1e64b0
movq (%rax,%rcx,8), %rcx
leaq 0x1b5df8(%rip), %rdx    # 0x1d9fa3
movb $0x0, %al
callq 0x3170
jmp 0x241b4
jmp 0x241b6
jmp 0x241b8
jmp 0x241ba
movq -0x8(%rbp), %rax
cmpl $0x10, (%rax)
je 0x241eb
movq -0x8(%rbp), %rax
cmpl $0x11, (%rax)
je 0x241eb
movq -0x8(%rbp), %rax
cmpl $0x12, (%rax)
je 0x241eb
movq -0x8(%rbp), %rax
cmpl $0x13, (%rax)
je 0x241eb
movq -0x8(%rbp), %rax
cmpl $0x15, (%rax)
jne 0x242b6
movq -0x8(%rbp), %rax
cmpl $0x15, (%rax)
jne 0x24206
movq -0x8(%rbp), %rdi
callq 0x245c0
movq %rax, -0x708(%rbp)
jmp 0x24215
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x708(%rbp)
movq -0x708(%rbp), %rax
movq %rax, -0x558(%rbp)
cmpl $0x0, -0x18(%rbp)
jle 0x24282
movq -0x10(%rbp), %rax
movq %rax, -0x718(%rbp)
movq -0x558(%rbp), %rdi
leaq -0x660(%rbp), %rsi
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movl $0x100, %edx            # imm = 0x100
callq 0x23b60
movq %rax, -0x710(%rbp)
movl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rdi
callq 0x24550
movq -0x718(%rbp), %rdi
movq -0x710(%rbp), %rsi
movq %rax, %rdx
callq 0x31b0
jmp 0x242b4
movq -0x10(%rbp), %rax
movq %rax, -0x720(%rbp)
movl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rdi
callq 0x24550
movq -0x720(%rbp), %rdi
movq %rax, %rdx
leaq 0x1b5cfe(%rip), %rsi    # 0x1d9fad
callq 0x31b0
jmp 0x242b6
jmp 0x242b8
movq -0x10(%rbp), %rax
addq $0x720, %rsp            # imm = 0x720
popq %rbp
retq
nopw %cs:(%rax,%rax)