// File: parth-shel[P]xpac/client.cpp
// Function: remove_package(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void remove_package(std::string pkg_name){
	auto find = indegree_map.find(pkg_name);
	if(find != indegree_map.end()){
		if(find->second>1){
			std::cout<<"Cannot delete "<<pkg_name<<" as it breaks a dependency"<<std::endl;
		}
		else{
			std::cout<<"Removing "<<pkg_name<<std::endl;
			//Removing relevant metadata files:
			remove(std::string(metadata_dir + "/." + pkg_name + ".metadata").c_str());
			//Deleting it from the dependency list of base, if applicable:
			base->get_dep_list()->erase(std::remove(base->get_dep_list()->begin(), base->get_dep_list()->end(), pkg_name), base->get_dep_list()->end());
			//Rewriting base's metadata:
			metadata::write_package(base, metadata_dir.c_str());
			//Removing package from list of all installed packages:
			user_installed_list.erase(user_installed_list.find(pkg_name));
			//Rewriting the user installed packages list:
			rewrite_installed_packages();
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, %rsi
movq %rsi, -0x100(%rbp)
movq %rsi, -0x8(%rbp)
leaq 0x17f90(%rip), %rdi     # 0x1e5e0
callq 0x9a10
movq %rax, -0x10(%rbp)
leaq 0x17f80(%rip), %rdi     # 0x1e5e0
callq 0x9a70
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x9a40
testb $0x1, %al
jne 0x667f
jmp 0x697b
leaq -0x10(%rbp), %rdi
callq 0x9aa0
cmpl $0x1, 0x20(%rax)
jle 0x66d3
movq 0x1793b(%rip), %rdi     # 0x1dfd0
leaq 0xea21(%rip), %rsi      # 0x150bd
callq 0x4400
movq -0x100(%rbp), %rsi
movq %rax, %rdi
callq 0x43d0
movq %rax, %rdi
leaq 0xea12(%rip), %rsi      # 0x150cc
callq 0x4400
movq %rax, %rdi
movq 0x178ef(%rip), %rsi     # 0x1dfb8
callq 0x4440
jmp 0x6979
movq 0x178f6(%rip), %rdi     # 0x1dfd0
leaq 0xea06(%rip), %rsi      # 0x150e7
callq 0x4400
movq -0x100(%rbp), %rsi
movq %rax, %rdi
callq 0x43d0
movq %rax, %rdi
movq 0x178b9(%rip), %rsi     # 0x1dfb8
callq 0x4440
leaq 0x17d45(%rip), %rsi     # 0x1e450
leaq 0xe9a3(%rip), %rdx      # 0x150b5
leaq -0x78(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x9170
movq -0x108(%rbp), %rsi
movq -0x100(%rbp), %rdx
leaq -0x58(%rbp), %rdi
callq 0x94c0
jmp 0x673b
leaq 0xed49(%rip), %rdx      # 0x1548b
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x9470
jmp 0x6751
leaq -0x38(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x41c0
movq %rax, %rdi
callq 0x4710
movq -0x130(%rbp), %rdi
callq 0x47e8
leaq -0x58(%rbp), %rdi
callq 0x47e8
leaq -0x78(%rbp), %rdi
callq 0x47e8
movq 0x17d2a(%rip), %rdi     # 0x1e4b8
callq 0x11810
movq %rax, -0x128(%rbp)
movq 0x17d17(%rip), %rdi     # 0x1e4b8
callq 0x11810
movq %rax, %rdi
callq 0x95e0
movq %rax, -0xa0(%rbp)
movq 0x17cfc(%rip), %rdi     # 0x1e4b8
callq 0x11810
movq %rax, %rdi
callq 0x9650
movq -0x100(%rbp), %rdx
movq %rax, -0xa8(%rbp)
movq -0xa0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
callq 0x9c50
movq %rax, -0x98(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x9ca0
movq 0x17cad(%rip), %rdi     # 0x1e4b8
callq 0x11810
movq %rax, %rdi
callq 0x9650
movq %rax, -0xb8(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x9ca0
movq -0x128(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq -0xb0(%rbp), %rdx
callq 0x9bc0
movq %rax, -0xc0(%rbp)
movq 0x17c5e(%rip), %rax     # 0x1e4b8
movq %rax, -0x120(%rbp)
leaq 0x17be8(%rip), %rdi     # 0x1e450
callq 0x41c0
movq %rax, -0x118(%rbp)
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x46e0
movq -0x118(%rbp), %rsi
movq -0x110(%rbp), %rdx
leaq -0xe0(%rbp), %rdi
callq 0x4560
jmp 0x68a3
movq -0x120(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x11830
jmp 0x68b8
leaq -0xe0(%rbp), %rdi
callq 0x47e8
leaq -0xe1(%rbp), %rdi
callq 0x4460
movq -0x100(%rbp), %rsi
leaq 0x17d92(%rip), %rdi     # 0x1e670
callq 0x9440
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rsi
leaq 0x17d78(%rip), %rdi     # 0x1e670
callq 0x9760
movq %rax, -0xf8(%rbp)
callq 0x12aa0
jmp 0x6979
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x6934
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x47e8
leaq -0x78(%rbp), %rdi
callq 0x47e8
jmp 0x6984
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x696b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x47e8
leaq -0xe1(%rbp), %rdi
callq 0x4460
jmp 0x6984
jmp 0x697b
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x46d0
nopl (%rax)