// File: parth-shel[P]xpac/client.cpp
// Function: install_package(char const*)
static bool install_package(const char * pkg_name){
	//Getting the package from the server itself:
	get_from_server("GPKG-",pkg_name);

	//Working on the dependencies:
	metadata * package = metadata::get_package(metadata_path.c_str());

	//Pushing the install path onto the stack:
	dep_list.push(install_path);

	//Initializing the bfs queue:
	marked.insert(std::string(pkg_name));
	bfs_queue.push(std::string(pkg_name));
	
	while(!bfs_queue.empty()){

		std::string next = bfs_queue.front();
		bfs_queue.pop();


		if(next.compare(std::string(pkg_name)) != 0){
			get_from_server("GPKG-",next.c_str());
			package = metadata::get_package(metadata_path.c_str());
			dep_list.push(install_path);
		}

		std::vector<std::string> * curr_dep_list = package->get_dep_list();

		for(auto itr = curr_dep_list->begin(); itr!=curr_dep_list->end(); itr++){
			auto found = marked.find(*itr);
			if(found == marked.end()){	//Not found
				marked.insert(*itr);
				bfs_queue.push(*itr);
			}
		}

	}

	//Finally installing everything in the stack:
	return install_all_packages();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x200, %rsp            # imm = 0x200
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
leaq 0xfaa4(%rip), %rdi      # 0x1541e
callq 0x79e0
leaq 0x18b42(%rip), %rdi     # 0x1e4c8
callq 0x41c0
movq %rax, -0x168(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x46e0
movq -0x168(%rbp), %rsi
movq -0x160(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x4560
jmp 0x59bb
leaq -0x30(%rbp), %rdi
callq 0x11b80
movq %rax, -0x170(%rbp)
jmp 0x59cd
leaq -0x30(%rbp), %rdi
callq 0x47e8
leaq -0x31(%rbp), %rdi
callq 0x4460
movq -0x170(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq 0x18b17(%rip), %rdi     # 0x1e508
leaq 0x18af0(%rip), %rsi     # 0x1e4e8
callq 0xb1e0
movq -0x8(%rbp), %rax
movq %rax, -0x180(%rbp)
leaq -0x69(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0x46e0
movq -0x180(%rbp), %rsi
movq -0x178(%rbp), %rdx
leaq -0x68(%rbp), %rdi
callq 0x4560
jmp 0x5a31
leaq 0x18b70(%rip), %rdi     # 0x1e5a8
leaq -0x68(%rbp), %rsi
callq 0x9970
movb %dl, -0x189(%rbp)
movq %rax, -0x188(%rbp)
jmp 0x5a50
movb -0x189(%rbp), %al
movq -0x188(%rbp), %rcx
movq %rcx, -0x80(%rbp)
movb %al, -0x78(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x47e8
leaq -0x69(%rbp), %rdi
callq 0x4460
movq -0x8(%rbp), %rax
movq %rax, -0x1a0(%rbp)
leaq -0xa1(%rbp), %rdi
movq %rdi, -0x198(%rbp)
callq 0x46e0
movq -0x1a0(%rbp), %rsi
movq -0x198(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
callq 0x4560
jmp 0x5ab0
leaq 0x18aa1(%rip), %rdi     # 0x1e558
leaq -0xa0(%rbp), %rsi
callq 0x9940
jmp 0x5ac5
leaq -0xa0(%rbp), %rdi
callq 0x47e8
leaq -0xa1(%rbp), %rdi
callq 0x4460
leaq 0x18a74(%rip), %rdi     # 0x1e558
callq 0x99b0
xorb $-0x1, %al
testb $0x1, %al
jne 0x5af4
jmp 0x5ec7
leaq 0x18a5d(%rip), %rdi     # 0x1e558
movq %rdi, -0x1a8(%rbp)
callq 0x99d0
movq %rax, %rsi
leaq -0xc8(%rbp), %rdi
callq 0x41d0
movq -0x1a8(%rbp), %rdi
callq 0x99f0
jmp 0x5b24
movq -0x8(%rbp), %rax
movq %rax, -0x1b8(%rbp)
leaq -0xe9(%rbp), %rdi
movq %rdi, -0x1b0(%rbp)
callq 0x46e0
movq -0x1b8(%rbp), %rsi
movq -0x1b0(%rbp), %rdx
leaq -0xe8(%rbp), %rdi
callq 0x4560
jmp 0x5b5e
leaq -0xc8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x4040
movl %eax, -0x1bc(%rbp)
jmp 0x5b79
leaq -0xe8(%rbp), %rdi
callq 0x47e8
leaq -0xe9(%rbp), %rdi
callq 0x4460
movl -0x1bc(%rbp), %eax
cmpl $0x0, %eax
je 0x5d69
leaq -0xc8(%rbp), %rdi
callq 0x41c0
movq %rax, %rsi
leaq 0xf868(%rip), %rdi      # 0x1541e
callq 0x79e0
jmp 0x5bbd
leaq 0x18904(%rip), %rdi     # 0x1e4c8
callq 0x41c0
movq %rax, -0x1d0(%rbp)
leaq -0x111(%rbp), %rdi
movq %rdi, -0x1c8(%rbp)
callq 0x46e0
movq -0x1d0(%rbp), %rsi
movq -0x1c8(%rbp), %rdx
leaq -0x110(%rbp), %rdi
callq 0x4560
jmp 0x5bff
leaq -0x110(%rbp), %rdi
callq 0x11b80
movq %rax, -0x1d8(%rbp)
jmp 0x5c14
movq -0x1d8(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x47e8
leaq -0x111(%rbp), %rdi
callq 0x4460
leaq 0x188ca(%rip), %rdi     # 0x1e508
leaq 0x188a3(%rip), %rsi     # 0x1e4e8
callq 0xb1e0
jmp 0x5c4c
jmp 0x5d69
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x5c74
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x47e8
leaq -0x31(%rbp), %rdi
callq 0x4460
jmp 0x5ed7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x5ca5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x47e8
leaq -0x69(%rbp), %rdi
callq 0x4460
jmp 0x5ed7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x5cd9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x47e8
leaq -0xa1(%rbp), %rdi
callq 0x4460
jmp 0x5ed7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x5eb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x5d21
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x47e8
leaq -0xe9(%rbp), %rdi
callq 0x4460
jmp 0x5eb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x5d58
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x47e8
leaq -0x111(%rbp), %rdi
callq 0x4460
jmp 0x5eb9
movq -0x10(%rbp), %rdi
callq 0x11810
movq %rax, -0x1e0(%rbp)
jmp 0x5d7b
movq -0x1e0(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x120(%rbp), %rdi
callq 0x95e0
movq %rax, -0x128(%rbp)
movq -0x120(%rbp), %rdi
callq 0x9650
movq %rax, -0x130(%rbp)
leaq -0x128(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x9610
testb $0x1, %al
jne 0x5dcb
jmp 0x5ea8
leaq -0x128(%rbp), %rdi
callq 0x9680
movq %rax, %rsi
leaq 0x187c7(%rip), %rdi     # 0x1e5a8
callq 0x9ac0
movq %rax, -0x1e8(%rbp)
jmp 0x5def
movq -0x1e8(%rbp), %rax
movq %rax, -0x138(%rbp)
leaq 0x187a4(%rip), %rdi     # 0x1e5a8
callq 0x9b20
movq %rax, -0x140(%rbp)
leaq -0x138(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x9af0
testb $0x1, %al
jne 0x5e29
jmp 0x5e8c
leaq -0x128(%rbp), %rdi
callq 0x9680
movq %rax, %rsi
leaq 0x18769(%rip), %rdi     # 0x1e5a8
callq 0x9b50
movb %dl, -0x1f1(%rbp)
movq %rax, -0x1f0(%rbp)
jmp 0x5e53
movb -0x1f1(%rbp), %al
movq -0x1f0(%rbp), %rcx
movq %rcx, -0x150(%rbp)
movb %al, -0x148(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x9680
movq %rax, %rsi
leaq 0x186d5(%rip), %rdi     # 0x1e558
callq 0x9b90
jmp 0x5e8a
jmp 0x5e8c
jmp 0x5e8e
leaq -0x128(%rbp), %rdi
xorl %esi, %esi
callq 0x96a0
movq %rax, -0x158(%rbp)
jmp 0x5d9c
leaq -0xc8(%rbp), %rdi
callq 0x47e8
jmp 0x5add
leaq -0xc8(%rbp), %rdi
callq 0x47e8
jmp 0x5ed7
callq 0x82b0
andb $0x1, %al
addq $0x200, %rsp            # imm = 0x200
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x46d0