// File: /workspace/github_c_makefile_star2_O1/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 $0x28, %rsp
movq %r8, 0x10(%rsp)
movq %rcx, %r14
movq %rsi, %r12
movq %rdi, %r15
movq %rdx, 0x8(%rsp)
movq %rdi, 0x18(%rsp)
movq %rcx, (%rsp)
movq 0x18(%r12), %rsi
testq %rsi, %rsi
je 0x4a360
movq %r15, %rdi
movq 0x8(%rsp), %rdx
movq %r14, %rcx
movq 0x10(%rsp), %r8
callq 0x4a312
movq 0x8(%rsp), %rdx
movq 0x8(%r12), %rbp
testq %rbp, %rbp
je 0x4a524
movq (%r15), %rax
movq 0x8(%rax), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movq 0x108(%rax), %rax
movq 0x8(%rax), %r13
movslq 0xc0(%r13), %rsi
movslq (%r14), %rbx
movl (%r13), %eax
addl $-0x4, %eax
cmpl $0x16, %eax
ja 0x4a3e8
leaq 0x30343(%rip), %rcx     # 0x7a6e8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rbp), %rbp
jmp 0x4a40d
movzbl (%rbp), %ebp
jmp 0x4a40d
movslq (%rbp), %rbp
jmp 0x4a40d
movzwl (%rbp), %ebp
jmp 0x4a40d
movl (%rbp), %ebp
jmp 0x4a40d
movsbq (%rbp), %rbp
jmp 0x4a40d
movswq (%rbp), %rbp
jmp 0x4a40d
xorps %xmm0, %xmm0
cvtss2sd (%rbp), %xmm0
movq %xmm0, %rbp
jmp 0x4a40d
movq 0x10(%rsp), %rcx
movq 0x20(%rcx), %rdi
movq %rsi, %r15
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x2cc10(%rip), %rdx     # 0x77010
xorl %eax, %eax
callq *0x8(%rcx)
movq %r15, %rsi
movq 0x8(%rsp), %rdx
movl (%r13), %r15d
movslq 0xc0(%r13), %r13
testq %rdx, %rdx
je 0x4a57f
leal -0x4(%r15), %r14d
cmpl $0x16, %r14d
ja 0x4a55e
leaq 0x3030e(%rip), %rcx     # 0x7a744
movslq (%rcx,%r14,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpq $0x100, %rbp            # imm = 0x100
jmp 0x4a477
movslq %ebp, %rax
jmp 0x4a49a
movsbq %bpl, %rax
jmp 0x4a49a
cmpq $0x2, %rbp
jmp 0x4a477
movq %rbp, %rax
btrq $0x3f, %rax
movq %rax, %xmm0
ucomisd 0x2cb42(%rip), %xmm0    # 0x76fb0
jmp 0x4a491
cmpq $0x10000, %rbp          # imm = 0x10000
setae %al
jmp 0x4a4a9
movq %rbp, %rax
btrq $0x3f, %rax
movq %rax, %xmm0
ucomisd 0x2cb17(%rip), %xmm0    # 0x76fa8
seta %al
jmp 0x4a4a9
movswq %bp, %rax
cmpq %rbp, %rax
jmp 0x4a4a6
movq %rbp, %rax
shrq $0x20, %rax
setne %al
testb %al, %al
jne 0x4a55e
cmpl $0x16, %r14d
ja 0x4a534
imulq %rsi, %rbx
addq %rdx, %rbx
leaq 0x302db(%rip), %rcx     # 0x7a7a0
movslq (%rcx,%r14,4), %rax
addq %rcx, %rax
movq 0x18(%rsp), %r15
jmpq *%rax
movq %rbp, (%rbx)
jmp 0x4a51d
testq %rbp, %rbp
movq (%rsp), %r14
je 0x4a599
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x3260
movq 0x8(%rsp), %rdx
jmp 0x4a521
movb %bpl, (%rbx)
jmp 0x4a51d
movl %ebp, (%rbx)
jmp 0x4a51d
movw %bp, (%rbx)
jmp 0x4a51d
movq %rbp, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rbx)
jmp 0x4a51d
testq %rbp, %rbp
setne (%rbx)
movq (%rsp), %r14
incl (%r14)
movq 0x20(%r12), %r12
testq %r12, %r12
jne 0x4a33c
jmp 0x4a5a8
movq 0x10(%rsp), %rcx
movq 0x20(%rcx), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x2cac7(%rip), %rdx     # 0x77010
xorl %eax, %eax
callq *0x8(%rcx)
movq 0x8(%rsp), %rdx
movq (%rsp), %r14
movq 0x18(%rsp), %r15
jmp 0x4a521
movq 0x10(%rsp), %rdi
movq %rsi, 0x20(%rsp)
movl %r15d, %esi
callq 0x796a
movq 0x20(%rsp), %rsi
movq 0x8(%rsp), %rdx
jmp 0x4a4b1
movq 0x10(%rsp), %rdi
movq %rsi, %r14
callq 0x7954
movq %r14, %rsi
movq 0x8(%rsp), %rdx
jmp 0x4a421
movq 0x10(%rsp), %rdi
callq 0x799c
jmp 0x4a4e5
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq