// File: /workspace/github_cpp_makefile_star2_O2/pranavmodx[P]modlang/src/../header/builtins.hpp
// Function: Insert(std::vector<Object*, std::allocator<Object*>>&)
Object *Insert(std::vector<Object *> &objs)
{
	Object *obj = objs[0];
	ObjectType type = obj->type();

	if (type == ERROR_OBJ)
		return obj;

	else if (type == HASHSET_OBJ)
	{
		if (objs.size() != 2)
			return new Error("error: argument length (" + std::to_string(objs.size()) + ") not equal to parameter length (2) for hashset");

		if (objs[1]->type() == ERROR_OBJ)
			return objs[1];

		HashKey hashKey(objs[1]->type(), objs[1]->inspect());
		((HashSet *)obj)->pairs.insert({hashKey, objs[1]});

		return __NULL;
	}

	else if (type == HASHMAP_OBJ)
	{
		if (objs.size() != 3)
			return new Error("error: argument length (" + std::to_string(objs.size()) + ") not equal to parameter length (3) for hashmap");

		if (objs[1]->type() == ERROR_OBJ)
			return objs[1];

		if (objs[2]->type() == ERROR_OBJ)
			return objs[2];

		HashKey hashKey(objs[1]->type(), objs[1]->inspect());
		HashMapPairObj hashMapPairObj(objs[1], objs[2]);

		((HashMap *)objs[0])->pairs.insert({hashKey, hashMapPairObj});

		return __NULL;
	}

	return new Error("error: unsupported object for insert()");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, %r14
movq (%rdi), %rax
movq (%rax), %rbx
movq (%rbx), %rax
leaq 0x90(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq *(%rax)
leaq 0x18af0(%rip), %rsi     # 0x2d338
movq %r15, %rdi
callq 0xa7b4
testb %al, %al
jne 0x14add
leaq 0x189b9(%rip), %rsi     # 0x2d218
leaq 0x90(%rsp), %rdi
callq 0xa7b4
testb %al, %al
je 0x1495a
movq (%r14), %rax
movq 0x8(%r14), %r15
subq %rax, %r15
cmpq $0x10, %r15
jne 0x149c7
movq 0x8(%rax), %rsi
movq (%rsi), %rax
movq %rsp, %rdi
callq *(%rax)
leaq 0x18a9d(%rip), %rsi     # 0x2d338
movq %rsp, %r15
movq %r15, %rdi
callq 0xa7b4
movl %eax, %ebp
movq %r15, %rdi
callq 0x5388
testb %bpl, %bpl
jne 0x149bb
movq (%r14), %rax
movq 0x8(%rax), %rsi
movq (%rsi), %rax
leaq 0x168(%rsp), %rdi
callq *(%rax)
movq (%r14), %rax
movq 0x8(%rax), %rsi
movq (%rsi), %rax
leaq 0x148(%rsp), %rdi
callq *0x8(%rax)
leaq 0x50(%rsp), %rdi
leaq 0x168(%rsp), %rsi
leaq 0x148(%rsp), %rdx
callq 0x188ee
leaq 0x148(%rsp), %rdi
callq 0x5388
leaq 0x168(%rsp), %rdi
callq 0x5388
movq (%r14), %rdx
addq $0x8, %rdx
movq %rsp, %rdi
leaq 0x50(%rsp), %rsi
callq 0x18924
addq $0x8, %rbx
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x1acbe
movq %rsp, %rdi
callq 0x18942
leaq 0x17bb0(%rip), %rax     # 0x2c4f8
movq (%rax), %rbx
leaq 0x50(%rsp), %rdi
callq 0x18942
jmp 0x14add
leaq 0x18897(%rip), %rsi     # 0x2d1f8
leaq 0x90(%rsp), %rdi
callq 0xa7b4
testb %al, %al
je 0x14a2b
movq (%r14), %rax
movq 0x8(%r14), %r15
subq %rax, %r15
cmpq $0x18, %r15
jne 0x14a67
movq 0x8(%rax), %rsi
movq (%rsi), %rax
movq %rsp, %rdi
callq *(%rax)
leaq 0x1899b(%rip), %rsi     # 0x2d338
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xa7b4
movl %eax, %ebp
movq %rbx, %rdi
callq 0x5388
testb %bpl, %bpl
je 0x14afb
movq (%r14), %rax
movq 0x8(%rax), %rbx
jmp 0x14add
pushq $0x28
popq %rdi
callq 0x51d0
movq %rax, %rbx
sarq $0x3, %r15
leaq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x187d0
leaq 0x7daf(%rip), %rsi      # 0x1c799
movq %rsp, %rdi
leaq 0x50(%rsp), %rdx
callq 0xd257
leaq 0x7fa0(%rip), %rdx      # 0x1c99e
leaq 0x188(%rsp), %rdi
movq %rsp, %rsi
callq 0xd12a
leaq 0x188(%rsp), %rsi
movq %rbx, %rdi
callq 0x12cc2
leaq 0x188(%rsp), %rdi
jmp 0x14ac6
pushq $0x28
popq %rdi
callq 0x51d0
movq %rax, %rbx
leaq 0x7fc1(%rip), %rsi      # 0x1c9fe
leaq 0xc8(%rsp), %rdi
movq %rsp, %rdx
callq 0x9da4
leaq 0xc8(%rsp), %rsi
movq %rbx, %rdi
callq 0x12cc2
leaq 0xc8(%rsp), %rdi
jmp 0x14ad8
pushq $0x28
popq %rdi
callq 0x51d0
movq %rax, %rbx
sarq $0x3, %r15
leaq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x187d0
leaq 0x7d0f(%rip), %rsi      # 0x1c799
movq %rsp, %rdi
leaq 0x50(%rsp), %rdx
callq 0xd257
leaq 0x7f30(%rip), %rdx      # 0x1c9ce
leaq 0x128(%rsp), %rdi
movq %rsp, %rsi
callq 0xd12a
leaq 0x128(%rsp), %rsi
movq %rbx, %rdi
callq 0x12cc2
leaq 0x128(%rsp), %rdi
callq 0x5388
movq %rsp, %rdi
callq 0x5388
leaq 0x50(%rsp), %rdi
callq 0x5388
leaq 0x90(%rsp), %rdi
callq 0x5388
movq %rbx, %rax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rax
movq 0x10(%rax), %rsi
movq (%rsi), %rax
movq %rsp, %rdi
callq *(%rax)
leaq 0x18827(%rip), %rsi     # 0x2d338
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xa7b4
movl %eax, %ebp
movq %rbx, %rdi
callq 0x5388
testb %bpl, %bpl
je 0x14b34
movq (%r14), %rax
movq 0x10(%rax), %rbx
jmp 0x14add
movq (%r14), %rax
movq 0x8(%rax), %rsi
movq (%rsi), %rax
leaq 0x108(%rsp), %rdi
callq *(%rax)
movq (%r14), %rax
movq 0x8(%rax), %rsi
movq (%rsi), %rax
leaq 0xe8(%rsp), %rdi
callq *0x8(%rax)
leaq 0x50(%rsp), %rdi
leaq 0x108(%rsp), %rsi
leaq 0xe8(%rsp), %rdx
callq 0x188ee
leaq 0xe8(%rsp), %rdi
callq 0x5388
leaq 0x108(%rsp), %rdi
callq 0x5388
movq (%r14), %rax
movups 0x8(%rax), %xmm0
movaps %xmm0, 0xb0(%rsp)
movq (%rax), %rbx
movq %rsp, %rdi
leaq 0x50(%rsp), %rsi
callq 0x18d60
movq %rsp, %rsi
movaps 0xb0(%rsp), %xmm0
movups %xmm0, 0x40(%rsi)
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x1b098
jmp 0x14939
jmp 0x14bfd
jmp 0x14c17
movq %rax, %r14
leaq 0xe8(%rsp), %rdi
callq 0x5388
jmp 0x14be9
movq %rax, %r14
leaq 0x108(%rsp), %rdi
jmp 0x14c4a
jmp 0x14ca6
jmp 0x14ca6
movq %rax, %r14
movq %rsp, %rdi
callq 0x18942
jmp 0x14c1a
movq %rax, %r14
leaq 0x128(%rsp), %rdi
jmp 0x14c62
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x18942
jmp 0x14ca9
jmp 0x14c69
movq %rax, %r14
leaq 0x148(%rsp), %rdi
callq 0x5388
jmp 0x14c42
jmp 0x14c83
movq %rax, %r14
leaq 0x168(%rsp), %rdi
callq 0x5388
jmp 0x14ca9
jmp 0x14c94
jmp 0x14ca6
jmp 0x14ca6
movq %rax, %r14
leaq 0x188(%rsp), %rdi
callq 0x5388
jmp 0x14c6c
movq %rax, %r14
movq %rsp, %rdi
callq 0x5388
jmp 0x14c86
movq %rax, %r14
leaq 0xc8(%rsp), %rdi
jmp 0x14c8b
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x5388
jmp 0x14c97
jmp 0x14c94
movq %rax, %r14
pushq $0x28
popq %rsi
movq %rbx, %rdi
callq 0x51e0
jmp 0x14ca9
jmp 0x14ca6
movq %rax, %r14
leaq 0x90(%rsp), %rdi
callq 0x5388
movq %r14, %rdi
callq 0x5330