// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x37a2(%rip), %rsi      # 0xae2c
leaq 0x3727(%rip), %rdx      # 0xadb8
callq 0x2be7
leaq 0x31c4(%rip), %rsi      # 0xa861
movq %rbx, %rdi
callq 0x4692
movq %rax, %r14
leaq 0x3712(%rip), %rdx      # 0xadc1
leaq -0x3fe(%rip), %rcx      # 0x72b8
movq %rbx, %rdi
movq %rax, %rsi
xorl %r8d, %r8d
callq 0x46f4
leaq 0x36ff(%rip), %rdx      # 0xadca
leaq -0x3fd(%rip), %rcx      # 0x72d5
movq %rbx, %rdi
movq %r14, %rsi
xorl %r8d, %r8d
callq 0x46f4
leaq 0x36ec(%rip), %rdx      # 0xadd3
leaq -0x3fd(%rip), %rcx      # 0x72f1
movq %rbx, %rdi
movq %r14, %rsi
xorl %r8d, %r8d
callq 0x46f4
leaq 0x36d9(%rip), %rsi      # 0xaddc
movq %rbx, %rdi
callq 0x4692
movq %rax, 0x101838(%rbx)
leaq 0x36c7(%rip), %rsi      # 0xade0
movq %rbx, %rdi
callq 0x4692
movq %rax, 0x101840(%rbx)
leaq 0x36e6(%rip), %rsi      # 0xae15
movq %rbx, %rdi
callq 0x4692
movq %rax, %r14
leaq 0x36a4(%rip), %rdx      # 0xade5
leaq -0x439(%rip), %rcx      # 0x730f
movq %rbx, %rdi
movq %rax, %rsi
xorl %r8d, %r8d
callq 0x46f4
leaq 0x368e(%rip), %rdx      # 0xadeb
leaq -0x43b(%rip), %rcx      # 0x7329
movq %rbx, %rdi
movq %r14, %rsi
xorl %r8d, %r8d
callq 0x46f4
movq %r14, 0x101848(%rbx)
leaq 0x3670(%rip), %rsi      # 0xadf0
movq %rbx, %rdi
callq 0x4692
movq %rax, %r15
leaq 0x3664(%rip), %rdx      # 0xadf6
leaq -0x44d(%rip), %rcx      # 0x734c
movq %rbx, %rdi
movq %rax, %rsi
movl $0x1, %r8d
callq 0x46f4
leaq 0x2b38(%rip), %r12      # 0xa2e9
leaq -0x3eb(%rip), %rcx      # 0x73cd
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %r8d, %r8d
callq 0x46f4
leaq 0x2b59(%rip), %r14      # 0xa329
leaq -0x3f3(%rip), %rcx      # 0x73e4
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl $0x1, %r8d
callq 0x46f4
movq %r15, 0x101850(%rbx)
leaq 0x35cb(%rip), %rsi      # 0xadc4
movq %rbx, %rdi
callq 0x4692
movq %rax, 0x101858(%rbx)
leaq 0x35ec(%rip), %rsi      # 0xadfb
movq %rbx, %rdi
callq 0x4692
movq %rax, 0x101860(%rbx)
leaq 0x35df(%rip), %rsi      # 0xae04
movq %rbx, %rdi
callq 0x4692
movq %rax, %r15
leaq -0x436(%rip), %rcx      # 0x7401
movq %rbx, %rdi
movq %rax, %rsi
movq %r12, %rdx
xorl %r8d, %r8d
callq 0x46f4
leaq 0x35bc(%rip), %rdx      # 0xae0b
leaq -0x43e(%rip), %rcx      # 0x7418
movq %rbx, %rdi
movq %r15, %rsi
xorl %r8d, %r8d
callq 0x46f4
leaq 0x35a8(%rip), %rdx      # 0xae13
leaq -0x3f1(%rip), %rcx      # 0x7481
movq %rbx, %rdi
movq %r15, %rsi
xorl %r8d, %r8d
callq 0x46f4
leaq 0x3595(%rip), %rdx      # 0xae1c
leaq -0x3ed(%rip), %rcx      # 0x74a1
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %r8d
callq 0x46f4
leaq -0x2ef(%rip), %rcx      # 0x75b7
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl $0x1, %r8d
callq 0x46f4
leaq 0x3561(%rip), %rdx      # 0xae22
leaq -0x2c0(%rip), %rcx      # 0x7608
movq %rbx, %rdi
movq %r15, %rsi
movl $0x2, %r8d
callq 0x46f4
movq %r15, 0x101868(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq