// File: 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
movq %rsp, %rbp
subq $0x3e0, %rsp            # imm = 0x3E0
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x374f0
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
movq (%rsi), %rax
leaq -0x38(%rbp), %rdi
callq *(%rax)
leaq -0x38(%rbp), %rdi
leaq 0x377a5(%rip), %rsi     # 0x67400
callq 0x16920
testb $0x1, %al
jne 0x2fc66
jmp 0x2fc7a
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x3c(%rbp)
jmp 0x304e8
leaq -0x38(%rbp), %rdi
leaq 0x3765b(%rip), %rsi     # 0x672e0
callq 0x16920
testb $0x1, %al
jne 0x2fc93
jmp 0x2ffe7
movq -0x10(%rbp), %rdi
callq 0x373f0
cmpq $0x2, %rax
je 0x2fde9
movl $0x28, %edi
callq 0x52a0
movq %rax, -0x378(%rbp)
jmp 0x2fcb9
movb $0x1, -0xb1(%rbp)
movq -0x10(%rbp), %rdi
callq 0x373f0
movq %rax, %rsi
leaq -0xb0(%rbp), %rdi
callq 0x37410
jmp 0x2fcda
leaq 0x15c38(%rip), %rsi     # 0x45919
leaq -0x90(%rbp), %rdi
leaq -0xb0(%rbp), %rdx
callq 0x1bde0
jmp 0x2fcf6
leaq 0x15e21(%rip), %rdx     # 0x45b1e
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x1bb10
jmp 0x2fd0f
movq -0x378(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2b980
jmp 0x2fd21
movq -0x378(%rbp), %rax
movb $0x0, -0xb1(%rbp)
movq %rax, -0x8(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x5518
leaq -0x90(%rbp), %rdi
callq 0x5518
leaq -0xb0(%rbp), %rdi
callq 0x5518
movl $0x1, -0x3c(%rbp)
jmp 0x304e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x304fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2fdc8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2fdbc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2fdb0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x5518
leaq -0x90(%rbp), %rdi
callq 0x5518
leaq -0xb0(%rbp), %rdi
callq 0x5518
testb $0x1, -0xb1(%rbp)
jne 0x2fdd3
jmp 0x2fde4
movq -0x378(%rbp), %rdi
movl $0x28, %esi
callq 0x52b0
jmp 0x304fe
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x374f0
movq (%rax), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0xd8(%rbp), %rdi
callq *%rax
jmp 0x2fe0b
leaq -0xd8(%rbp), %rdi
leaq 0x375e7(%rip), %rsi     # 0x67400
callq 0x16920
movb %al, -0x379(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x5518
movb -0x379(%rbp), %al
testb $0x1, %al
jne 0x2fe3c
jmp 0x2fe5d
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x374f0
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x3c(%rbp)
jmp 0x304e8
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x374f0
movq (%rax), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x138(%rbp), %rdi
callq *%rax
jmp 0x2fe7f
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x374f0
movq (%rax), %rsi
movq (%rsi), %rax
movq 0x8(%rax), %rax
leaq -0x158(%rbp), %rdi
callq *%rax
jmp 0x2fea2
leaq -0x118(%rbp), %rdi
leaq -0x138(%rbp), %rsi
leaq -0x158(%rbp), %rdx
callq 0x37af0
jmp 0x2febe
leaq -0x158(%rbp), %rdi
callq 0x5518
leaq -0x138(%rbp), %rdi
callq 0x5518
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x388(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x374f0
movq %rax, %rdx
leaq -0x1a0(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x37b90
jmp 0x2ff0b
movq -0x388(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x37b50
movb %dl, -0x391(%rbp)
movq %rax, -0x390(%rbp)
jmp 0x2ff2d
movb -0x391(%rbp), %al
movq -0x390(%rbp), %rcx
movq %rcx, -0x1b0(%rbp)
movb %al, -0x1a8(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x37bd0
leaq 0x36666(%rip), %rax     # 0x665c0
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x3c(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x37bf0
jmp 0x304e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2ff9f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x5518
leaq -0x138(%rbp), %rdi
callq 0x5518
jmp 0x304fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2ffd6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x37bd0
leaq -0x118(%rbp), %rdi
callq 0x37bf0
jmp 0x304fe
leaq -0x38(%rbp), %rdi
leaq 0x372ce(%rip), %rsi     # 0x672c0
callq 0x16920
testb $0x1, %al
jne 0x30000
jmp 0x30403
movq -0x10(%rbp), %rdi
callq 0x373f0
cmpq $0x3, %rax
je 0x30151
movl $0x28, %edi
callq 0x52a0
movq %rax, -0x3a0(%rbp)
jmp 0x30026
movb $0x1, -0x211(%rbp)
movq -0x10(%rbp), %rdi
callq 0x373f0
movq %rax, %rsi
leaq -0x210(%rbp), %rdi
callq 0x37410
jmp 0x30047
leaq 0x158cb(%rip), %rsi     # 0x45919
leaq -0x1f0(%rbp), %rdi
leaq -0x210(%rbp), %rdx
callq 0x1bde0
jmp 0x30063
leaq 0x15ae4(%rip), %rdx     # 0x45b4e
leaq -0x1d0(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x1bb10
jmp 0x3007f
movq -0x3a0(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x2b980
jmp 0x30094
movq -0x3a0(%rbp), %rax
movb $0x0, -0x211(%rbp)
movq %rax, -0x8(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x5518
leaq -0x1f0(%rbp), %rdi
callq 0x5518
leaq -0x210(%rbp), %rdi
callq 0x5518
movl $0x1, -0x3c(%rbp)
jmp 0x304e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x30130
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x30124
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x30118
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x5518
leaq -0x1f0(%rbp), %rdi
callq 0x5518
leaq -0x210(%rbp), %rdi
callq 0x5518
testb $0x1, -0x211(%rbp)
jne 0x3013b
jmp 0x3014c
movq -0x3a0(%rbp), %rdi
movl $0x28, %esi
callq 0x52b0
jmp 0x304fe
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x374f0
movq (%rax), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x238(%rbp), %rdi
callq *%rax
jmp 0x30173
leaq -0x238(%rbp), %rdi
leaq 0x3727f(%rip), %rsi     # 0x67400
callq 0x16920
movb %al, -0x3a1(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x5518
movb -0x3a1(%rbp), %al
testb $0x1, %al
jne 0x301a4
jmp 0x301c5
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x374f0
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x3c(%rbp)
jmp 0x304e8
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x374f0
movq (%rax), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x258(%rbp), %rdi
callq *%rax
jmp 0x301e7
leaq -0x258(%rbp), %rdi
leaq 0x3720b(%rip), %rsi     # 0x67400
callq 0x16920
movb %al, -0x3a2(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x5518
movb -0x3a2(%rbp), %al
testb $0x1, %al
jne 0x30218
jmp 0x30239
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x374f0
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x3c(%rbp)
jmp 0x304e8
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x374f0
movq (%rax), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x2b8(%rbp), %rdi
callq *%rax
jmp 0x3025b
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x374f0
movq (%rax), %rsi
movq (%rsi), %rax
movq 0x8(%rax), %rax
leaq -0x2d8(%rbp), %rdi
callq *%rax
jmp 0x3027e
leaq -0x298(%rbp), %rdi
leaq -0x2b8(%rbp), %rsi
leaq -0x2d8(%rbp), %rdx
callq 0x37af0
jmp 0x3029a
leaq -0x2d8(%rbp), %rdi
callq 0x5518
leaq -0x2b8(%rbp), %rdi
callq 0x5518
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x374f0
movq (%rax), %rax
movq %rax, -0x3b0(%rbp)
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x374f0
movq -0x3b0(%rbp), %rsi
movq (%rax), %rdx
leaq -0x2e8(%rbp), %rdi
callq 0x37c20
jmp 0x302f0
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x374f0
movq (%rax), %rax
addq $0x8, %rax
movq %rax, -0x3b8(%rbp)
leaq -0x338(%rbp), %rdi
leaq -0x298(%rbp), %rsi
leaq -0x2e8(%rbp), %rdx
callq 0x37c90
jmp 0x30327
movq -0x3b8(%rbp), %rdi
leaq -0x338(%rbp), %rsi
callq 0x37c50
movb %dl, -0x3c1(%rbp)
movq %rax, -0x3c0(%rbp)
jmp 0x30349
movb -0x3c1(%rbp), %al
movq -0x3c0(%rbp), %rcx
movq %rcx, -0x348(%rbp)
movb %al, -0x340(%rbp)
leaq -0x338(%rbp), %rdi
callq 0x37ce0
leaq 0x3624a(%rip), %rax     # 0x665c0
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x3c(%rbp)
leaq -0x298(%rbp), %rdi
callq 0x37bf0
jmp 0x304e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x303bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x5518
leaq -0x2b8(%rbp), %rdi
callq 0x5518
jmp 0x304fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x303f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x338(%rbp), %rdi
callq 0x37ce0
leaq -0x298(%rbp), %rdi
callq 0x37bf0
jmp 0x304fe
jmp 0x30405
jmp 0x30407
movl $0x28, %edi
callq 0x52a0
movq %rax, -0x3d0(%rbp)
jmp 0x3041a
movb $0x1, -0x36a(%rbp)
leaq -0x369(%rbp), %rdi
movq %rdi, -0x3d8(%rbp)
callq 0x54a0
movq -0x3d8(%rbp), %rdx
leaq 0x1573c(%rip), %rsi     # 0x45b7e
leaq -0x368(%rbp), %rdi
callq 0x134c0
jmp 0x30450
movq -0x3d0(%rbp), %rdi
leaq -0x368(%rbp), %rsi
callq 0x2b980
jmp 0x30465
movq -0x3d0(%rbp), %rax
movb $0x0, -0x36a(%rbp)
movq %rax, -0x8(%rbp)
leaq -0x368(%rbp), %rdi
callq 0x5518
leaq -0x369(%rbp), %rdi
callq 0x52f0
movl $0x1, -0x3c(%rbp)
jmp 0x304e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x304be
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x368(%rbp), %rdi
callq 0x5518
leaq -0x369(%rbp), %rdi
callq 0x52f0
testb $0x1, -0x36a(%rbp)
jne 0x304d5
jmp 0x304e6
movq -0x3d0(%rbp), %rdi
movl $0x28, %esi
callq 0x52b0
jmp 0x304fe
leaq -0x38(%rbp), %rdi
callq 0x5518
movq -0x8(%rbp), %rax
addq $0x3e0, %rsp            # imm = 0x3E0
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x5518
movq -0x48(%rbp), %rdi
callq 0x5490