// File: /workspace/github_c_makefile_star2_O3/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 %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
leaq 0x8(%r8), %rax
movq %rax, 0x28(%rsp)
movq %r8, 0x30(%rsp)
leaq 0x20(%r8), %rax
movq %rax, 0x20(%rsp)
movq %rcx, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movq %rdi, (%rsp)
movq 0x18(%r12), %rsi
testq %rsi, %rsi
je 0x472af
movq %r14, %rdi
movq %r15, %rdx
movq %rbx, %rcx
movq 0x30(%rsp), %r8
callq 0x47253
movq 0x8(%r12), %rbp
testq %rbp, %rbp
je 0x475a5
movq (%r14), %rax
movq 0x8(%rax), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movq 0x108(%rax), %rax
movq 0x8(%rax), %r15
movslq 0xc0(%r15), %r14
movslq (%rbx), %rbx
movl (%r15), %r13d
leal -0x4(%r13), %eax
cmpl $0x16, %eax
ja 0x47542
leaq 0x32428(%rip), %rcx     # 0x79720
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl %r14d, %edx
movq 0x10(%rsp), %r15
testq %r15, %r15
je 0x475d4
imulq %r14, %rbx
addq %r15, %rbx
leal -0x4(%r13), %r14d
cmpl $0x16, %r14d
ja 0x475b5
leaq 0x3244e(%rip), %rcx     # 0x7977c
movslq (%rcx,%r14,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x16, %r14d
ja 0x4757d
leaq 0x32490(%rip), %rcx     # 0x797d8
movslq (%rcx,%r14,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbp, (%rbx)
jmp 0x4759a
testq %rbp, %rbp
je 0x475fe
movslq %edx, %rdx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x3260
jmp 0x4759a
cmpq $0xff, %rbp
jbe 0x473a1
jmp 0x475b5
movslq %ebp, %rax
cmpq %rbp, %rax
je 0x47432
jmp 0x475b5
movsbq %bpl, %rax
cmpq %rbp, %rax
jne 0x475b5
movb %bpl, (%rbx)
jmp 0x4759a
cmpq $0x1, %rbp
ja 0x475b5
testq %rbp, %rbp
setne (%rbx)
jmp 0x4759a
movq %rbp, %xmm0
movdqa %xmm0, %xmm1
pand 0x2ebe1(%rip), %xmm1    # 0x75fb0
ucomisd 0x2ec21(%rip), %xmm1    # 0x75ff8
jbe 0x47573
jmp 0x475b5
cmpq $0xffff, %rbp           # imm = 0xFFFF
jbe 0x4741d
jmp 0x475b5
movq %rbp, %rax
btrq $0x3f, %rax
movq %rax, %xmm0
ucomisd 0x2ebeb(%rip), %xmm0    # 0x75ff0
jbe 0x47351
jmp 0x475b5
movswq %bp, %rax
cmpq %rbp, %rax
jne 0x475b5
movw %bp, (%rbx)
jmp 0x4759a
movq %rbp, %rax
shrq $0x20, %rax
jne 0x475b5
movl %ebp, (%rbx)
jmp 0x4759a
movl (%rbp), %ebp
movl $0xa, %r13d
jmp 0x47301
movslq (%rbp), %rbp
movl $0x6, %r13d
jmp 0x47301
movzbl (%rbp), %ebp
movl $0xd, %r13d
jmp 0x47301
movzbl (%rbp), %ebp
movl $0x8, %r13d
jmp 0x47301
movq (%rbp), %rbp
movl $0xb, %r13d
jmp 0x47301
movq (%rbp), %rbp
movl $0xf, %r13d
jmp 0x47301
movq (%rbp), %rbp
movl $0x14, %r13d
jmp 0x47301
movq (%rbp), %rbp
movl $0x19, %r13d
jmp 0x47301
movq (%rbp), %rbp
movl $0x10, %r13d
jmp 0x47301
movsbq (%rbp), %rbp
movl $0x4, %r13d
jmp 0x47301
movswq (%rbp), %rbp
movl $0x5, %r13d
jmp 0x47301
movq (%rbp), %rbp
movl $0x7, %r13d
jmp 0x47301
movzwl (%rbp), %ebp
movl $0x9, %r13d
jmp 0x47301
movq (%rbp), %rbp
movl $0x1a, %r13d
jmp 0x47301
movzbl (%rbp), %ebp
movl $0xc, %r13d
jmp 0x47301
movq (%rbp), %rbp
movl $0x11, %r13d
jmp 0x47301
xorps %xmm0, %xmm0
cvtss2sd (%rbp), %xmm0
movq %xmm0, %rbp
movl $0xe, %r13d
jmp 0x47301
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x2eaba(%rip), %rdx     # 0x76010
xorl %eax, %eax
movq 0x28(%rsp), %rcx
callq *(%rcx)
movl (%r15), %r13d
movl 0xc0(%r15), %edx
jmp 0x47304
movq %rbp, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rbx)
jmp 0x4759a
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x2ea7f(%rip), %rdx     # 0x76010
xorl %eax, %eax
movq 0x28(%rsp), %rcx
callq *(%rcx)
movq 0x8(%rsp), %rbx
movq (%rsp), %r14
incl (%rbx)
movq 0x20(%r12), %r12
testq %r12, %r12
jne 0x47292
jmp 0x47626
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl %edx, 0x1c(%rsp)
movl %r13d, %edx
callq 0x4f97
movl 0x1c(%rsp), %edx
jmp 0x47337
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl %edx, 0x1c(%rsp)
leaq 0x2ea14(%rip), %rdx     # 0x76000
xorl %eax, %eax
movq 0x28(%rsp), %rcx
callq *(%rcx)
movl 0x1c(%rsp), %edx
jmp 0x47312
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl %edx, %r14d
leaq 0x2e9eb(%rip), %rdx     # 0x76000
xorl %eax, %eax
movq 0x28(%rsp), %rcx
callq *(%rcx)
movl %r14d, %edx
jmp 0x47362
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq