// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_vm.c
// Function: doGetMapKeysRecursively
static void doGetMapKeysRecursively(const Map *map, const MapNode *node, void *keys, int *numKeys, Error *error)
{
    if (node->left)
        doGetMapKeysRecursively(map, node->left, keys, numKeys, error);

    if (node->key)
    {
        const Type *keyType = typeMapKey(map->type);
        void *destKey = (char *)keys + keyType->size * (*numKeys);

        Slot srcKey = {.ptrVal = node->key};
        doDerefImpl(&srcKey, keyType->kind, error);
        doAssignImpl(destKey, srcKey, keyType->kind, keyType->size, error);

        (*numKeys)++;
    }

    if (node->right)
        doGetMapKeysRecursively(map, node->right, keys, numKeys, error);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, 0x28(%rsp)
movq %rcx, %r13
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movq %rcx, 0x20(%rsp)
movq %rdx, 0x10(%rsp)
movq %rdi, 0x18(%rsp)
movq 0x18(%r12), %rsi
testq %rsi, %rsi
je 0x3e9c3
movq %r15, %rdi
movq %r14, %rdx
movq %r13, %rcx
movq 0x28(%rsp), %r8
callq 0x3e978
movq 0x8(%r12), %rbp
testq %rbp, %rbp
je 0x3ec04
movq (%r15), %rax
movq 0x8(%rax), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movq 0x108(%rax), %rax
movq 0x8(%rax), %r14
movslq 0xc0(%r14), %r15
movslq (%r13), %rbx
movl (%r14), %r13d
leal -0x4(%r13), %eax
cmpl $0x16, %eax
ja 0x3ebb3
leaq 0x2ea37(%rip), %rcx     # 0x6d444
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl %r15d, 0xc(%rsp)
jmp 0x3eb1b
movq (%rbp), %rbp
movl %r15d, 0xc(%rsp)
pushq $0xf
jmp 0x3eb17
movzbl (%rbp), %ebp
movl %r15d, 0xc(%rsp)
pushq $0x8
jmp 0x3eb17
movq (%rbp), %rbp
movl %r15d, 0xc(%rsp)
pushq $0x10
jmp 0x3eb17
movzbl (%rbp), %ebp
movl %r15d, 0xc(%rsp)
pushq $0xd
jmp 0x3eb17
movslq (%rbp), %rbp
movl %r15d, 0xc(%rsp)
pushq $0x6
jmp 0x3eb17
movq (%rbp), %rbp
movl %r15d, 0xc(%rsp)
pushq $0x14
jmp 0x3eb17
movq (%rbp), %rbp
movl %r15d, 0xc(%rsp)
pushq $0x19
jmp 0x3eb17
movq (%rbp), %rbp
movl %r15d, 0xc(%rsp)
pushq $0x7
jmp 0x3eb17
movq (%rbp), %rbp
movl %r15d, 0xc(%rsp)
pushq $0xb
jmp 0x3eb17
movsbq (%rbp), %rbp
movl %r15d, 0xc(%rsp)
pushq $0x4
jmp 0x3eb17
movswq (%rbp), %rbp
movl %r15d, 0xc(%rsp)
pushq $0x5
jmp 0x3eb17
movzwl (%rbp), %ebp
movl %r15d, 0xc(%rsp)
pushq $0x9
jmp 0x3eb17
movq (%rbp), %rbp
movl %r15d, 0xc(%rsp)
pushq $0x11
jmp 0x3eb17
movl (%rbp), %ebp
movl %r15d, 0xc(%rsp)
pushq $0xa
jmp 0x3eb17
cvtss2sd (%rbp), %xmm0
movq %xmm0, %rbp
movl %r15d, 0xc(%rsp)
pushq $0xe
jmp 0x3eb17
movzbl (%rbp), %ebp
movl %r15d, 0xc(%rsp)
pushq $0xc
jmp 0x3eb17
movq (%rbp), %rbp
movl %r15d, 0xc(%rsp)
pushq $0x1a
popq %rax
movl %eax, %r13d
movq 0x10(%rsp), %r14
testq %r14, %r14
je 0x3ec14
movl %r13d, %edi
movq %rbp, %rsi
callq 0x3d27e
testb %al, %al
jne 0x3ec31
addl $-0x4, %r13d
cmpl $0x16, %r13d
ja 0x3ebde
imulq %r15, %rbx
addq %r14, %rbx
leaq 0x2e948(%rip), %rcx     # 0x6d4a0
movslq (%rcx,%r13,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbp, (%rbx)
jmp 0x3ebf6
testq %rbp, %rbp
movq 0x20(%rsp), %r13
movq 0x18(%rsp), %r15
je 0x3ec6c
movslq 0xc(%rsp), %rdx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x3260
jmp 0x3ec00
movb %bpl, (%rbx)
jmp 0x3ebf6
movl %ebp, (%rbx)
jmp 0x3ebf6
movw %bp, (%rbx)
jmp 0x3ebf6
movq %rbp, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rbx)
jmp 0x3ebf6
testq %rbp, %rbp
setne (%rbx)
jmp 0x3ebf6
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rdi
pushq $-0x1
popq %rsi
leaq 0x2b44a(%rip), %rdx     # 0x6a010
xorl %eax, %eax
callq *0x8(%rcx)
movl (%r14), %r13d
movl 0xc0(%r14), %eax
movl %eax, 0xc(%rsp)
jmp 0x3eb1b
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rdi
pushq $-0x1
popq %rsi
leaq 0x2b41f(%rip), %rdx     # 0x6a010
xorl %eax, %eax
callq *0x8(%rcx)
movq 0x20(%rsp), %r13
movq 0x18(%rsp), %r15
incl (%r13)
movq 0x20(%r12), %r12
testq %r12, %r12
jne 0x3e9a6
jmp 0x3ec89
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rdi
pushq $-0x1
popq %rsi
leaq 0x2b3d9(%rip), %rdx     # 0x6a000
xorl %eax, %eax
callq *0x8(%rcx)
jmp 0x3eb29
movq 0x28(%rsp), %rax
movq 0x8(%rax), %r14
movq 0x20(%rax), %rax
movq %rax, 0x30(%rsp)
movl %r13d, %edi
callq 0x1601e
movq 0x30(%rsp), %rdi
pushq $-0x1
popq %rsi
leaq 0x2b582(%rip), %rdx     # 0x6a1dc
movq %rax, %rcx
xorl %eax, %eax
callq *%r14
movq 0x10(%rsp), %r14
jmp 0x3eb3c
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rdi
pushq $-0x1
popq %rsi
leaq 0x2b381(%rip), %rdx     # 0x6a000
xorl %eax, %eax
callq *0x8(%rcx)
jmp 0x3eb7c
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq