// File: /workspace/github_c_makefile_star2_O2/adamjedlicka[P]blu/src/vm/lib/core/core.c
// Function: bluInitCore
void bluInitCore(bluVM* vm) {
	bluInterpret(vm, coreSource, "__CORE__");

	bluObj* objectClass = bluGetGlobal(vm, "Object");
	bluDefineMethod(vm, objectClass, "getClass", Object_getClass, 0);
	bluDefineMethod(vm, objectClass, "isFalsey", Object_isFalsey, 0);
	bluDefineMethod(vm, objectClass, "isTruthy", Object_isTruthy, 0);

	bluObj* nilClass = bluGetGlobal(vm, "Nil");
	vm->nilClass = (bluObjClass*)nilClass;

	bluObj* boolClass = bluGetGlobal(vm, "Bool");
	vm->boolClass = (bluObjClass*)boolClass;

	bluObj* numberClass = bluGetGlobal(vm, "Number");
	bluDefineMethod(vm, numberClass, "floor", Number_floor, 0);
	bluDefineMethod(vm, numberClass, "ceil", Number_ceil, 0);
	vm->numberClass = (bluObjClass*)numberClass;

	bluObj* arrayClass = bluGetGlobal(vm, "Array");
	bluDefineMethod(vm, arrayClass, "push", Array_push, 1);
	bluDefineMethod(vm, arrayClass, "len", Array_len, 0);
	bluDefineMethod(vm, arrayClass, "at", Array_at, 1);
	vm->arrayClass = (bluObjClass*)arrayClass;

	bluObj* classClass = bluGetGlobal(vm, "Class");
	vm->classClass = (bluObjClass*)classClass;

	bluObj* functionClass = bluGetGlobal(vm, "Function");
	vm->functionClass = (bluObjClass*)functionClass;

	bluObj* stringClass = bluGetGlobal(vm, "String");
	bluDefineMethod(vm, stringClass, "len", String_len, 0);
	bluDefineMethod(vm, stringClass, "reverse", String_reverse, 0);
	bluDefineMethod(vm, stringClass, "toNumber", String_toNumber, 0);
	bluDefineMethod(vm, stringClass, "split", String_split, 1);
	bluDefineMethod(vm, stringClass, "at", String_at, 1);
	bluDefineMethod(vm, stringClass, "substring", String_substring, 2);
	vm->stringClass = (bluObjClass*)stringClass;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x4d8b(%rip), %rsi      # 0x9aa3
leaq 0x4d09(%rip), %rdx      # 0x9a28
callq 0x69db
leaq 0x47ac(%rip), %rsi      # 0x94d7
movq %rbx, %rdi
callq 0x7f66
movq %rax, %r14
leaq 0x4cf4(%rip), %rdx      # 0x9a31
leaq -0x3e8(%rip), %rcx      # 0x495c
movq %rbx, %rdi
movq %rax, %rsi
xorl %r8d, %r8d
callq 0x7fc8
leaq 0x4ce1(%rip), %rdx      # 0x9a3a
leaq -0x3e7(%rip), %rcx      # 0x4979
movq %rbx, %rdi
movq %r14, %rsi
xorl %r8d, %r8d
callq 0x7fc8
leaq 0x4cce(%rip), %rdx      # 0x9a43
leaq -0x3ea(%rip), %rcx      # 0x4992
movq %rbx, %rdi
movq %r14, %rsi
xorl %r8d, %r8d
callq 0x7fc8
leaq 0x4cbb(%rip), %rsi      # 0x9a4c
movq %rbx, %rdi
callq 0x7f66
movq %rax, 0x101838(%rbx)
leaq 0x4ca9(%rip), %rsi      # 0x9a50
movq %rbx, %rdi
callq 0x7f66
movq %rax, 0x101840(%rbx)
leaq 0x4ccf(%rip), %rsi      # 0x9a8c
movq %rbx, %rdi
callq 0x7f66
movq %rax, %r14
leaq 0x4c86(%rip), %rdx      # 0x9a55
leaq -0x429(%rip), %rcx      # 0x49ad
movq %rbx, %rdi
movq %rax, %rsi
xorl %r8d, %r8d
callq 0x7fc8
leaq 0x4c70(%rip), %rdx      # 0x9a5b
leaq -0x42b(%rip), %rcx      # 0x49c7
movq %rbx, %rdi
movq %r14, %rsi
xorl %r8d, %r8d
callq 0x7fc8
movq %r14, 0x101848(%rbx)
leaq 0x4c52(%rip), %rsi      # 0x9a60
movq %rbx, %rdi
callq 0x7f66
movq %rax, %r15
leaq 0x4c46(%rip), %rdx      # 0x9a66
leaq -0x43d(%rip), %rcx      # 0x49ea
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %r8d
callq 0x7fc8
leaq 0x4c2c(%rip), %r12      # 0x9a6b
leaq -0x3d5(%rip), %rcx      # 0x4a71
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %r8d, %r8d
callq 0x7fc8
leaq 0x4c11(%rip), %r14      # 0x9a6f
leaq -0x3dd(%rip), %rcx      # 0x4a88
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebp, %r8d
callq 0x7fc8
movq %r15, 0x101850(%rbx)
leaq 0x4bb0(%rip), %rsi      # 0x9a34
movq %rbx, %rdi
callq 0x7f66
movq %rax, 0x101858(%rbx)
leaq 0x4bd8(%rip), %rsi      # 0x9a72
movq %rbx, %rdi
callq 0x7f66
movq %rax, 0x101860(%rbx)
leaq 0x4bcb(%rip), %rsi      # 0x9a7b
movq %rbx, %rdi
callq 0x7f66
movq %rax, %r15
leaq -0x41d(%rip), %rcx      # 0x4aa5
movq %rbx, %rdi
movq %rax, %rsi
movq %r12, %rdx
xorl %r8d, %r8d
callq 0x7fc8
leaq 0x4ba8(%rip), %rdx      # 0x9a82
leaq -0x425(%rip), %rcx      # 0x4abc
movq %rbx, %rdi
movq %r15, %rsi
xorl %r8d, %r8d
callq 0x7fc8
leaq 0x4b94(%rip), %rdx      # 0x9a8a
leaq -0x3df(%rip), %rcx      # 0x4b1e
movq %rbx, %rdi
movq %r15, %rsi
xorl %r8d, %r8d
callq 0x7fc8
leaq 0x4b81(%rip), %rdx      # 0x9a93
leaq -0x3db(%rip), %rcx      # 0x4b3e
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %r8d
callq 0x7fc8
leaq -0x2e7(%rip), %rcx      # 0x4c47
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebp, %r8d
callq 0x7fc8
leaq 0x4b53(%rip), %rdx      # 0x9a99
leaq -0x2b7(%rip), %rcx      # 0x4c96
pushq $0x2
popq %r8
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7fc8
movq %r15, 0x101868(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq