// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/vm.c
// Function: register_natives
static void register_natives(VM* vm) {
    vm->allocator.gc_off = true;

#define Register(name, arity_min, arity_max)                                                        \
    do {                                                                                            \
        RavCFunction *func = object_cfunction(&vm->allocator, native_##name, arity_min, arity_max); \
        RavString *name_string = object_string(&vm->allocator, #name, strlen(#name));               \
        table_set(&vm->globals, name_string, Obj_Value(func));                                      \
    } while (false)

    Register(import,  1, 1);
    Register(assert,  1, 2);
    Register(print,   0, PARAMS_LIMIT); // variadic
    Register(println, 0, PARAMS_LIMIT); // variadic
    Register(len,     1, 1);
    Register(push,    2, PARAMS_LIMIT); // variadic
    Register(pop,     1, 1);
    Register(insert,  3, 3);
    Register(remove,  2, 2);

#undef Register
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb $0x1, 0x40(%rdi)
leaq 0x19ee(%rip), %rsi      # 0x3fcb
pushq $0x1
popq %r12
movl %r12d, %edx
movl %r12d, %ecx
callq 0x50d2
movq %rax, %r15
leaq 0x6ac2(%rip), %rsi      # 0x90b8
pushq $0x6
popq %rbp
movq %rbx, %rdi
movl %ebp, %edx
callq 0x4de8
leaq 0x40c70(%rbx), %r14
movabsq $-0x4000000000000, %rcx # imm = 0xFFFC000000000000
orq %rcx, %r15
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x4b15
leaq 0x1c15(%rip), %rsi      # 0x4241
pushq $0x2
popq %rcx
movq %rbx, %rdi
movl %r12d, %edx
callq 0x50d2
movq %rax, %r13
leaq 0x6a7b(%rip), %rsi      # 0x90bf
movq %rbx, %rdi
movl %ebp, %edx
callq 0x4de8
movabsq $-0x4000000000000, %r15 # imm = 0xFFFC000000000000
orq %r15, %r13
movq %r14, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x4b15
leaq 0x1c8b(%rip), %rsi      # 0x42fb
movq %rbx, %rdi
xorl %edx, %edx
movl $0x100, %ecx            # imm = 0x100
callq 0x50d2
movq %rax, %r13
leaq 0x6a3d(%rip), %rsi      # 0x90c6
pushq $0x5
popq %rdx
movq %rbx, %rdi
callq 0x4de8
orq %r15, %r13
movq %r14, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x4b15
leaq 0x1c98(%rip), %rsi      # 0x4344
movq %rbx, %rdi
xorl %edx, %edx
movl $0x100, %ecx            # imm = 0x100
callq 0x50d2
movq %rax, %r13
leaq 0x6a07(%rip), %rsi      # 0x90cc
pushq $0x7
popq %rdx
movq %rbx, %rdi
callq 0x4de8
orq %r15, %r13
movq %r14, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x4b15
leaq 0x1cad(%rip), %rsi      # 0x4395
movq %rbx, %rdi
movl %r12d, %edx
movl %r12d, %ecx
callq 0x50d2
movq %rax, %rbp
leaq 0x69d4(%rip), %rsi      # 0x90d4
pushq $0x3
popq %r13
movq %rbx, %rdi
movl %r13d, %edx
callq 0x4de8
orq %r15, %rbp
movq %r14, %rdi
movq %rax, %rsi
movq %rbp, %rdx
callq 0x4b15
leaq 0x1d01(%rip), %rsi      # 0x4428
movq %rbx, %rdi
pushq $0x2
popq %rdx
movl $0x100, %ecx            # imm = 0x100
callq 0x50d2
movq %rax, %rbp
leaq 0x6997(%rip), %rsi      # 0x90d8
pushq $0x4
popq %rdx
movq %rbx, %rdi
callq 0x4de8
orq %r15, %rbp
movq %r14, %rdi
movq %rax, %rsi
movq %rbp, %rdx
callq 0x4b15
leaq 0x1d96(%rip), %rsi      # 0x44fa
movq %rbx, %rdi
movl %r12d, %edx
movl %r12d, %ecx
callq 0x50d2
movq %rax, %r12
leaq 0x6961(%rip), %rsi      # 0x90dd
movq %rbx, %rdi
movl %r13d, %edx
callq 0x4de8
orq %r15, %r12
movq %r14, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x4b15
leaq 0x1ddf(%rip), %rsi      # 0x457e
movq %rbx, %rdi
movl %r13d, %edx
movl %r13d, %ecx
callq 0x50d2
movq %rax, %r12
leaq 0x692a(%rip), %rsi      # 0x90e1
movq %rbx, %rdi
pushq $0x6
popq %rbp
movl %ebp, %edx
callq 0x4de8
orq %r15, %r12
movq %r15, %r13
movq %r14, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x4b15
leaq 0x1e3b(%rip), %rsi      # 0x461a
movq %rbx, %rdi
pushq $0x2
popq %rcx
movl %ecx, %edx
callq 0x50d2
movq %rax, %r15
leaq 0x68f2(%rip), %rsi      # 0x90e8
movq %rbx, %rdi
movl %ebp, %edx
callq 0x4de8
orq %r13, %r15
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4b15