// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb $0x1, 0x40(%rdi)
leaq 0x1a67(%rip), %rsi      # 0x43e3
movl $0x1, %edx
movl $0x1, %ecx
callq 0x5655
movq %rax, %r15
leaq 0x8723(%rip), %rsi      # 0xb0b8
movq %rbx, %rdi
movl $0x6, %edx
callq 0x52a0
leaq 0x40c70(%rbx), %r14
movabsq $-0x4000000000000, %r12 # imm = 0xFFFC000000000000
orq %r12, %r15
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x4ee3
leaq 0x1d28(%rip), %rsi      # 0x46f3
movq %rbx, %rdi
movl $0x1, %edx
movl $0x2, %ecx
callq 0x5655
movq %rax, %r15
leaq 0x86d8(%rip), %rsi      # 0xb0bf
movq %rbx, %rdi
movl $0x6, %edx
callq 0x52a0
orq %r12, %r15
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x4ee3
leaq 0x1da8(%rip), %rsi      # 0x47b4
movq %rbx, %rdi
xorl %edx, %edx
movl $0x100, %ecx            # imm = 0x100
callq 0x5655
movq %rax, %r15
leaq 0x86a1(%rip), %rsi      # 0xb0c6
movq %rbx, %rdi
movl $0x5, %edx
callq 0x52a0
orq %r12, %r15
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x4ee3
leaq 0x1db9(%rip), %rsi      # 0x4803
movq %rbx, %rdi
xorl %edx, %edx
movl $0x100, %ecx            # imm = 0x100
callq 0x5655
movq %rax, %r15
leaq 0x8669(%rip), %rsi      # 0xb0cc
movq %rbx, %rdi
movl $0x7, %edx
callq 0x52a0
orq %r12, %r15
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x4ee3
leaq 0x1dd4(%rip), %rsi      # 0x485c
movq %rbx, %rdi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x5655
movq %rax, %r15
leaq 0x8630(%rip), %rsi      # 0xb0d4
movq %rbx, %rdi
movl $0x3, %edx
callq 0x52a0
orq %r12, %r15
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x4ee3
leaq 0x1e36(%rip), %rsi      # 0x48ff
movq %rbx, %rdi
movl $0x2, %edx
movl $0x100, %ecx            # imm = 0x100
callq 0x5655
movq %rax, %r15
leaq 0x85f3(%rip), %rsi      # 0xb0d8
movq %rbx, %rdi
movl $0x4, %edx
callq 0x52a0
orq %r12, %r15
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x4ee3
leaq 0x1efc(%rip), %rsi      # 0x4a06
movq %rbx, %rdi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x5655
movq %rax, %r15
leaq 0x85b7(%rip), %rsi      # 0xb0dd
movq %rbx, %rdi
movl $0x3, %edx
callq 0x52a0
orq %r12, %r15
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x4ee3
leaq 0x1f3f(%rip), %rsi      # 0x4a8a
movq %rbx, %rdi
movl $0x3, %edx
movl $0x3, %ecx
callq 0x5655
movq %rax, %r15
leaq 0x857a(%rip), %rsi      # 0xb0e1
movq %rbx, %rdi
movl $0x6, %edx
callq 0x52a0
orq %r12, %r15
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x4ee3
leaq 0x1fa9(%rip), %rsi      # 0x4b35
movq %rbx, %rdi
movl $0x2, %edx
movl $0x2, %ecx
callq 0x5655
movq %rax, %r15
leaq 0x8540(%rip), %rsi      # 0xb0e8
movq %rbx, %rdi
movl $0x6, %edx
callq 0x52a0
orq %r12, %r15
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4ee3