// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movb $0x1, 0x40(%rax)
movq -0x8(%rbp), %rdi
leaq 0x334e(%rip), %rsi      # 0x5a80
movl $0x1, %ecx
movl %ecx, %edx
callq 0x7d90
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xb96b(%rip), %rsi      # 0xe0b8
movl $0x6, %edx
callq 0x7880
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
addq $0x40c70, %rdi          # imm = 0x40C70
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
movabsq $-0x4000000000000, %rax # imm = 0xFFFC000000000000
orq %rax, %rdx
callq 0x73f0
jmp 0x2782
movq -0x8(%rbp), %rdi
leaq 0x36a3(%rip), %rsi      # 0x5e30
movl $0x1, %edx
movl $0x2, %ecx
callq 0x7d90
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xb914(%rip), %rsi      # 0xe0bf
movl $0x6, %edx
callq 0x7880
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
addq $0x40c70, %rdi          # imm = 0x40C70
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
movabsq $-0x4000000000000, %rax # imm = 0xFFFC000000000000
orq %rax, %rdx
callq 0x73f0
jmp 0x27e0
movq -0x8(%rbp), %rdi
leaq 0x3745(%rip), %rsi      # 0x5f30
xorl %edx, %edx
movl $0x100, %ecx            # imm = 0x100
callq 0x7d90
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xb8c0(%rip), %rsi      # 0xe0c6
movl $0x5, %edx
callq 0x7880
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
addq $0x40c70, %rdi          # imm = 0x40C70
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movabsq $-0x4000000000000, %rax # imm = 0xFFFC000000000000
orq %rax, %rdx
callq 0x73f0
jmp 0x283b
movq -0x8(%rbp), %rdi
leaq 0x375a(%rip), %rsi      # 0x5fa0
xorl %edx, %edx
movl $0x100, %ecx            # imm = 0x100
callq 0x7d90
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xb86b(%rip), %rsi      # 0xe0cc
movl $0x7, %edx
callq 0x7880
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
addq $0x40c70, %rdi          # imm = 0x40C70
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movabsq $-0x4000000000000, %rax # imm = 0xFFFC000000000000
orq %rax, %rdx
callq 0x73f0
jmp 0x2896
movq -0x8(%rbp), %rdi
leaq 0x377f(%rip), %rsi      # 0x6020
movl $0x1, %ecx
movl %ecx, %edx
callq 0x7d90
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xb818(%rip), %rsi      # 0xe0d4
movl $0x3, %edx
callq 0x7880
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
addq $0x40c70, %rdi          # imm = 0x40C70
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movabsq $-0x4000000000000, %rax # imm = 0xFFFC000000000000
orq %rax, %rdx
callq 0x73f0
jmp 0x28f1
movq -0x8(%rbp), %rdi
leaq 0x3864(%rip), %rsi      # 0x6160
movl $0x2, %edx
movl $0x100, %ecx            # imm = 0x100
callq 0x7d90
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xb7be(%rip), %rsi      # 0xe0d8
movl $0x4, %edx
callq 0x7880
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rdi
addq $0x40c70, %rdi          # imm = 0x40C70
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movabsq $-0x4000000000000, %rax # imm = 0xFFFC000000000000
orq %rax, %rdx
callq 0x73f0
jmp 0x294f
movq -0x8(%rbp), %rdi
leaq 0x3976(%rip), %rsi      # 0x62d0
movl $0x1, %ecx
movl %ecx, %edx
callq 0x7d90
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xb768(%rip), %rsi      # 0xe0dd
movl $0x3, %edx
callq 0x7880
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rdi
addq $0x40c70, %rdi          # imm = 0x40C70
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movabsq $-0x4000000000000, %rax # imm = 0xFFFC000000000000
orq %rax, %rdx
callq 0x73f0
jmp 0x29aa
movq -0x8(%rbp), %rdi
leaq 0x39fb(%rip), %rsi      # 0x63b0
movl $0x3, %ecx
movl %ecx, %edx
callq 0x7d90
movq %rax, -0x80(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xb711(%rip), %rsi      # 0xe0e1
movl $0x6, %edx
callq 0x7880
movq %rax, -0x88(%rbp)
movq -0x8(%rbp), %rdi
addq $0x40c70, %rdi          # imm = 0x40C70
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
movabsq $-0x4000000000000, %rax # imm = 0xFFFC000000000000
orq %rax, %rdx
callq 0x73f0
jmp 0x2a0b
movq -0x8(%rbp), %rdi
leaq 0x3aba(%rip), %rsi      # 0x64d0
movl $0x2, %ecx
movl %ecx, %edx
callq 0x7d90
movq %rax, -0x90(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xb6b4(%rip), %rsi      # 0xe0e8
movl $0x6, %edx
callq 0x7880
movq %rax, -0x98(%rbp)
movq -0x8(%rbp), %rdi
addq $0x40c70, %rdi          # imm = 0x40C70
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
movabsq $-0x4000000000000, %rax # imm = 0xFFFC000000000000
orq %rax, %rdx
callq 0x73f0
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)