// File: pranavmodx[P]modlang/src/../header/builtins.hpp
// Function: Remove(std::vector<Object*, std::allocator<Object*>>&)
Object *Remove(std::vector<Object *> &objs)
{
	if (objs.size() != 2)
		return new Error("error: argument length (" + std::to_string(objs.size()) + ") not equal to parameter length (2)");

	Object *obj = objs[0];
	ObjectType type = obj->type();

	if (type == ERROR_OBJ)
		return obj;

	else if (type == HASHSET_OBJ)
	{
		if (((HashSet *)obj)->pairs.empty())
			return new Error("error: cannot remove from empty hashset");

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

		HashKey hashKey(objs[1]->type(), objs[1]->inspect());
		if (((HashSet *)obj)->pairs.find(hashKey) == ((HashSet *)obj)->pairs.end())
			return new Error("error: key not found in hashset -> " + objs[1]->inspect());
		((HashSet *)obj)->pairs.erase(hashKey);

		return __NULL;
	}

	else if (type == HASHMAP_OBJ)
	{
		if (((HashMap *)obj)->pairs.empty())
			return new Error("error: cannot remove from empty hashmap");

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

		HashKey hashKey(objs[1]->type(), objs[1]->inspect());
		if (((HashMap *)obj)->pairs.find(hashKey) == ((HashMap *)obj)->pairs.end())
			return new Error("error: key not found in hashmap -> " + objs[1]->inspect());
		((HashMap *)objs[0])->pairs.erase(hashKey);

		return __NULL;
	}

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x380, %rsp            # imm = 0x380
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x373f0
cmpq $0x2, %rax
je 0x3063a
movl $0x28, %edi
callq 0x52a0
movq %rax, -0x320(%rbp)
movb $0x1, -0x7d(%rbp)
movq -0x10(%rbp), %rdi
callq 0x373f0
movq %rax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x37410
jmp 0x3055e
leaq 0x153b4(%rip), %rsi     # 0x45919
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x1bde0
jmp 0x30574
leaq 0x1562a(%rip), %rdx     # 0x45ba5
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x1bb10
jmp 0x3058a
movq -0x320(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x2b980
jmp 0x3059c
movq -0x320(%rbp), %rax
movb $0x0, -0x7d(%rbp)
movq %rax, -0x8(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x5518
leaq -0x50(%rbp), %rdi
callq 0x5518
leaq -0x70(%rbp), %rdi
callq 0x5518
jmp 0x30fd5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x3061c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x30613
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x3060a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x5518
leaq -0x50(%rbp), %rdi
callq 0x5518
leaq -0x70(%rbp), %rdi
callq 0x5518
testb $0x1, -0x7d(%rbp)
jne 0x30624
jmp 0x30635
movq -0x320(%rbp), %rdi
movl $0x28, %esi
callq 0x52b0
jmp 0x30fe2
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x374f0
movq (%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rsi
movq (%rsi), %rax
leaq -0xa8(%rbp), %rdi
callq *(%rax)
leaq -0xa8(%rbp), %rdi
leaq 0x36d8e(%rip), %rsi     # 0x67400
callq 0x16920
testb $0x1, %al
jne 0x3067d
jmp 0x30697
movq -0x88(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0xac(%rbp)
jmp 0x30fb9
leaq -0xa8(%rbp), %rdi
leaq 0x36c3b(%rip), %rsi     # 0x672e0
callq 0x16920
testb $0x1, %al
jne 0x306b3
jmp 0x30ab8
movq -0x88(%rbp), %rdi
addq $0x8, %rdi
callq 0x37d00
testb $0x1, %al
jne 0x306cc
jmp 0x307c7
movl $0x28, %edi
callq 0x52a0
movq %rax, -0x328(%rbp)
jmp 0x306df
movb $0x1, -0xd2(%rbp)
leaq -0xd1(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x54a0
movq -0x330(%rbp), %rdx
leaq 0x154c2(%rip), %rsi     # 0x45bc9
leaq -0xd0(%rbp), %rdi
callq 0x134c0
jmp 0x30715
movq -0x328(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x2b980
jmp 0x3072a
movq -0x328(%rbp), %rax
movb $0x0, -0xd2(%rbp)
movq %rax, -0x8(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x5518
leaq -0xd1(%rbp), %rdi
callq 0x52f0
movl $0x1, -0xac(%rbp)
jmp 0x30fb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x30fc7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x3079a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x5518
leaq -0xd1(%rbp), %rdi
callq 0x52f0
testb $0x1, -0xd2(%rbp)
jne 0x307b1
jmp 0x307c2
movq -0x328(%rbp), %rdi
movl $0x28, %esi
callq 0x52b0
jmp 0x30fc7
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x374f0
movq (%rax), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0xf8(%rbp), %rdi
callq *%rax
jmp 0x307e9
leaq -0xf8(%rbp), %rdi
leaq 0x36c09(%rip), %rsi     # 0x67400
callq 0x16920
movb %al, -0x331(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x5518
movb -0x331(%rbp), %al
testb $0x1, %al
jne 0x3081a
jmp 0x3083e
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x374f0
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0xac(%rbp)
jmp 0x30fb9
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x374f0
movq (%rax), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x158(%rbp), %rdi
callq *%rax
jmp 0x30860
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x374f0
movq (%rax), %rsi
movq (%rsi), %rax
movq 0x8(%rax), %rax
leaq -0x178(%rbp), %rdi
callq *%rax
jmp 0x30883
leaq -0x138(%rbp), %rdi
leaq -0x158(%rbp), %rsi
leaq -0x178(%rbp), %rdx
callq 0x37af0
jmp 0x3089f
leaq -0x178(%rbp), %rdi
callq 0x5518
leaq -0x158(%rbp), %rdi
callq 0x5518
movq -0x88(%rbp), %rdi
addq $0x8, %rdi
leaq -0x138(%rbp), %rsi
callq 0x37d50
movq %rax, -0x340(%rbp)
jmp 0x308d7
movq -0x340(%rbp), %rax
movq %rax, -0x180(%rbp)
movq -0x88(%rbp), %rdi
addq $0x8, %rdi
callq 0x37d80
movq %rax, -0x188(%rbp)
leaq -0x180(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x37d20
testb $0x1, %al
jne 0x30918
jmp 0x30a65
movl $0x28, %edi
callq 0x52a0
movq %rax, -0x348(%rbp)
jmp 0x3092b
movb $0x1, -0x1c9(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x374f0
movq (%rax), %rsi
movq (%rsi), %rax
movq 0x8(%rax), %rax
leaq -0x1c8(%rbp), %rdi
callq *%rax
jmp 0x30955
leaq 0x15295(%rip), %rsi     # 0x45bf1
leaq -0x1a8(%rbp), %rdi
leaq -0x1c8(%rbp), %rdx
callq 0x1bde0
jmp 0x30971
movq -0x348(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0x2b980
jmp 0x30986
movq -0x348(%rbp), %rax
movb $0x0, -0x1c9(%rbp)
movq %rax, -0x8(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x5518
leaq -0x1c8(%rbp), %rdi
callq 0x5518
movl $0x1, -0xac(%rbp)
jmp 0x30a96
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x309e5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x5518
leaq -0x158(%rbp), %rdi
callq 0x5518
jmp 0x30fc7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x30aa7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x30a47
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x30a3b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x5518
leaq -0x1c8(%rbp), %rdi
callq 0x5518
testb $0x1, -0x1c9(%rbp)
jne 0x30a52
jmp 0x30a63
movq -0x348(%rbp), %rdi
movl $0x28, %esi
callq 0x52b0
jmp 0x30aa7
movq -0x88(%rbp), %rdi
addq $0x8, %rdi
leaq -0x138(%rbp), %rsi
callq 0x37db0
jmp 0x30a7e
leaq 0x35b3b(%rip), %rax     # 0x665c0
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0xac(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x37bf0
jmp 0x30fb9
leaq -0x138(%rbp), %rdi
callq 0x37bf0
jmp 0x30fc7
leaq -0xa8(%rbp), %rdi
leaq 0x367fa(%rip), %rsi     # 0x672c0
callq 0x16920
testb $0x1, %al
jne 0x30ad4
jmp 0x30ed1
movq -0x88(%rbp), %rdi
addq $0x8, %rdi
callq 0x37de0
testb $0x1, %al
jne 0x30aed
jmp 0x30bd7
movl $0x28, %edi
callq 0x52a0
movq %rax, -0x350(%rbp)
jmp 0x30b00
movb $0x1, -0x1f2(%rbp)
leaq -0x1f1(%rbp), %rdi
movq %rdi, -0x358(%rbp)
callq 0x54a0
movq -0x358(%rbp), %rdx
leaq 0x150ed(%rip), %rsi     # 0x45c15
leaq -0x1f0(%rbp), %rdi
callq 0x134c0
jmp 0x30b36
movq -0x350(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x2b980
jmp 0x30b4b
movq -0x350(%rbp), %rax
movb $0x0, -0x1f2(%rbp)
movq %rax, -0x8(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x5518
leaq -0x1f1(%rbp), %rdi
callq 0x52f0
movl $0x1, -0xac(%rbp)
jmp 0x30fb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x30baa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x5518
leaq -0x1f1(%rbp), %rdi
callq 0x52f0
testb $0x1, -0x1f2(%rbp)
jne 0x30bc1
jmp 0x30bd2
movq -0x350(%rbp), %rdi
movl $0x28, %esi
callq 0x52b0
jmp 0x30fc7
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x374f0
movq (%rax), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x218(%rbp), %rdi
callq *%rax
jmp 0x30bf9
leaq -0x218(%rbp), %rdi
leaq 0x367f9(%rip), %rsi     # 0x67400
callq 0x16920
movb %al, -0x359(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x5518
movb -0x359(%rbp), %al
testb $0x1, %al
jne 0x30c2a
jmp 0x30c4e
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x374f0
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0xac(%rbp)
jmp 0x30fb9
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x374f0
movq (%rax), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x278(%rbp), %rdi
callq *%rax
jmp 0x30c70
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x374f0
movq (%rax), %rsi
movq (%rsi), %rax
movq 0x8(%rax), %rax
leaq -0x298(%rbp), %rdi
callq *%rax
jmp 0x30c93
leaq -0x258(%rbp), %rdi
leaq -0x278(%rbp), %rsi
leaq -0x298(%rbp), %rdx
callq 0x37af0
jmp 0x30caf
leaq -0x298(%rbp), %rdi
callq 0x5518
leaq -0x278(%rbp), %rdi
callq 0x5518
movq -0x88(%rbp), %rdi
addq $0x8, %rdi
leaq -0x258(%rbp), %rsi
callq 0x37e30
movq %rax, -0x368(%rbp)
jmp 0x30ce7
movq -0x368(%rbp), %rax
movq %rax, -0x2a0(%rbp)
movq -0x88(%rbp), %rdi
addq $0x8, %rdi
callq 0x37e60
movq %rax, -0x2a8(%rbp)
leaq -0x2a0(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x37e00
testb $0x1, %al
jne 0x30d28
jmp 0x30e75
movl $0x28, %edi
callq 0x52a0
movq %rax, -0x370(%rbp)
jmp 0x30d3b
movb $0x1, -0x2e9(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x374f0
movq (%rax), %rsi
movq (%rsi), %rax
movq 0x8(%rax), %rax
leaq -0x2e8(%rbp), %rdi
callq *%rax
jmp 0x30d65
leaq 0x14ed1(%rip), %rsi     # 0x45c3d
leaq -0x2c8(%rbp), %rdi
leaq -0x2e8(%rbp), %rdx
callq 0x1bde0
jmp 0x30d81
movq -0x370(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
callq 0x2b980
jmp 0x30d96
movq -0x370(%rbp), %rax
movb $0x0, -0x2e9(%rbp)
movq %rax, -0x8(%rbp)
leaq -0x2c8(%rbp), %rdi
callq 0x5518
leaq -0x2e8(%rbp), %rdi
callq 0x5518
movl $0x1, -0xac(%rbp)
jmp 0x30eaf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x30df5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x298(%rbp), %rdi
callq 0x5518
leaq -0x278(%rbp), %rdi
callq 0x5518
jmp 0x30fc7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x30ec0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x30e57
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x30e4b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x2c8(%rbp), %rdi
callq 0x5518
leaq -0x2e8(%rbp), %rdi
callq 0x5518
testb $0x1, -0x2e9(%rbp)
jne 0x30e62
jmp 0x30e73
movq -0x370(%rbp), %rdi
movl $0x28, %esi
callq 0x52b0
jmp 0x30ec0
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x374f0
movq (%rax), %rdi
addq $0x8, %rdi
leaq -0x258(%rbp), %rsi
callq 0x37e90
jmp 0x30e97
leaq 0x35722(%rip), %rax     # 0x665c0
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0xac(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x37bf0
jmp 0x30fb9
leaq -0x258(%rbp), %rdi
callq 0x37bf0
jmp 0x30fc7
jmp 0x30ed3
jmp 0x30ed5
movl $0x28, %edi
callq 0x52a0
movq %rax, -0x378(%rbp)
jmp 0x30ee8
movb $0x1, -0x312(%rbp)
leaq -0x311(%rbp), %rdi
movq %rdi, -0x380(%rbp)
callq 0x54a0
movq -0x380(%rbp), %rdx
leaq 0x14d51(%rip), %rsi     # 0x45c61
leaq -0x310(%rbp), %rdi
callq 0x134c0
jmp 0x30f1e
movq -0x378(%rbp), %rdi
leaq -0x310(%rbp), %rsi
callq 0x2b980
jmp 0x30f33
movq -0x378(%rbp), %rax
movb $0x0, -0x312(%rbp)
movq %rax, -0x8(%rbp)
leaq -0x310(%rbp), %rdi
callq 0x5518
leaq -0x311(%rbp), %rdi
callq 0x52f0
movl $0x1, -0xac(%rbp)
jmp 0x30fb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x30f8f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x310(%rbp), %rdi
callq 0x5518
leaq -0x311(%rbp), %rdi
callq 0x52f0
testb $0x1, -0x312(%rbp)
jne 0x30fa6
jmp 0x30fb7
movq -0x378(%rbp), %rdi
movl $0x28, %esi
callq 0x52b0
jmp 0x30fc7
leaq -0xa8(%rbp), %rdi
callq 0x5518
jmp 0x30fd5
leaq -0xa8(%rbp), %rdi
callq 0x5518
jmp 0x30fe2
movq -0x8(%rbp), %rax
addq $0x380, %rsp            # imm = 0x380
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x5490
nopl (%rax,%rax)