// File: /workspace/github_cpp_makefile_star2_O2/parth-shel[P]xpac/client.cpp
// Function: get_from_server(char const*, char const*)
static inline void get_from_server(const char * command_to_server,const char * pkg_name){


	std::string command = std::string(command_to_server);
	std::string pkg_hash = std::to_string(str_hash(std::string(pkg_name))).c_str();
	command.append(pkg_hash);
	char * final_command_to_server = (char*)command.c_str();
	int res = client_driver(final_command_to_server,strdup("repo.xpac.tech"));

	if(res == -1){
		remove(final_command_to_server);
		exit(1);
	}

	//Integrating MD5 Hashing comparing:
	std::cout<<"Verifiying file integrity :"<<std::endl;
	std::string MD5_command  = std::string(std::string("CHKSM-"));
	MD5_command.append(pkg_hash);
	char * MD5_command_to_server = (char*)MD5_command.c_str();
	res = client_driver(MD5_command_to_server,strdup("repo.xpac.tech"));

	if(res == -1){
		remove(MD5_command.c_str());
		exit(1);
	}
	MD5checksum * new_MD5 = new MD5checksum(final_command_to_server);
	if(!new_MD5->compare_saved_hash(std::string(MD5_command_to_server))){
			std::cout<<"File verification failed!!"<<std::endl;
			exit(1);
	}
	
	std::cout<<"File verification passed"<<std::endl;
		
	//To untar the recieved file:
	untar_file(final_command_to_server);

	//Removing the downloaded files from server:
	remove(final_command_to_server);
	remove(MD5_command_to_server);

	//Setting metadata and install_paths
	metadata_path = std::string(pkg_name) + std::string("/.metadata");
	install_path = std::string(pkg_name) + std::string("/.install_script");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
movq %rdi, %rbx
leaq 0x4ae1(%rip), %rsi      # 0xa40a
leaq -0xe8(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0x3180
leaq -0x48(%rbp), %rdi
leaq -0x88(%rbp), %rdx
movq %rbx, %rsi
callq 0x3180
leaq 0x9abd(%rip), %rdi      # 0xf410
leaq -0x48(%rbp), %rsi
callq 0x6340
leaq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0x62fe
movq -0x68(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
callq 0x3180
leaq -0x68(%rbp), %rdi
callq 0x36a8
leaq -0x48(%rbp), %rdi
callq 0x36a8
leaq -0xe8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x3670
movq -0xe8(%rbp), %r14
leaq 0x4a5e(%rip), %rdi      # 0xa410
callq 0x3600
movq %r14, %rdi
movq %rax, %rsi
callq 0x7e5c
cmpl $-0x1, %eax
je 0x5c60
movq 0x95fe(%rip), %rdi      # 0xefd0
leaq 0x4a46(%rip), %rsi      # 0xa41f
callq 0x3370
movq %rax, %rdi
callq 0x31f0
leaq 0x4a4e(%rip), %rsi      # 0xa43b
leaq -0xa8(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0x3180
leaq -0xa8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x3670
movq -0xa8(%rbp), %r15
leaq 0x49f2(%rip), %rdi      # 0xa410
callq 0x3600
movq %r15, %rdi
movq %rax, %rsi
callq 0x7e5c
cmpl $-0x1, %eax
je 0x5c65
pushq $0x40
popq %rdi
callq 0x3380
movq %rax, %r12
leaq -0x148(%rbp), %rdi
leaq -0x68(%rbp), %rdx
movq %r14, %rsi
callq 0x3180
leaq -0x148(%rbp), %rsi
movq %r12, %rdi
callq 0x9148
leaq -0x148(%rbp), %rdi
callq 0x36a8
leaq -0x128(%rbp), %rdi
leaq -0x68(%rbp), %rdx
movq %r15, %rsi
callq 0x3180
leaq -0x128(%rbp), %rsi
movq %r12, %rdi
callq 0x9376
movl %eax, %r12d
leaq -0x128(%rbp), %rdi
callq 0x36a8
testb %r12b, %r12b
je 0x5c79
movq 0x951f(%rip), %rdi      # 0xefd0
leaq 0x49a5(%rip), %rsi      # 0xa45d
callq 0x3370
movq %rax, %rdi
callq 0x31f0
leaq -0x108(%rbp), %rdi
leaq -0x21(%rbp), %rdx
movq %r14, %rsi
callq 0x3180
leaq 0x49b3(%rip), %rsi      # 0xa492
leaq -0x48(%rbp), %rdi
leaq -0x22(%rbp), %rdx
callq 0x3180
leaq -0x88(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x34a0
leaq -0x68(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x5deb
leaq -0x88(%rbp), %rdi
callq 0x36a8
leaq -0x48(%rbp), %rdi
callq 0x36a8
movq -0x68(%rbp), %rdi
callq 0x3310
leaq -0x68(%rbp), %rdi
callq 0x36a8
leaq -0x108(%rbp), %rdi
callq 0x36a8
movq %r14, %rdi
callq 0x35f0
movq %r15, %rdi
callq 0x35f0
leaq -0x48(%rbp), %rdi
leaq -0x22(%rbp), %rdx
movq %rbx, %rsi
callq 0x3180
leaq 0x4909(%rip), %rsi      # 0xa476
leaq -0x88(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x3180
leaq -0x68(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x5deb
leaq 0x9890(%rip), %rdi      # 0xf428
leaq -0x68(%rbp), %r14
movq %r14, %rsi
callq 0x3420
movq %r14, %rdi
callq 0x36a8
leaq -0x88(%rbp), %rdi
callq 0x36a8
leaq -0x48(%rbp), %rdi
callq 0x36a8
leaq -0x48(%rbp), %rdi
leaq -0x22(%rbp), %rdx
movq %rbx, %rsi
callq 0x3180
leaq 0x48a9(%rip), %rsi      # 0xa481
leaq -0x88(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x3180
leaq -0x68(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x5deb
leaq 0x9845(%rip), %rdi      # 0xf448
leaq -0x68(%rbp), %rbx
movq %rbx, %rsi
callq 0x3420
movq %rbx, %rdi
callq 0x36a8
leaq -0x88(%rbp), %rdi
callq 0x36a8
leaq -0x48(%rbp), %rdi
callq 0x36a8
leaq -0xa8(%rbp), %rdi
callq 0x36a8
leaq -0xc8(%rbp), %rdi
callq 0x36a8
leaq -0xe8(%rbp), %rdi
callq 0x36a8
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
jmp 0x5c6c
movq -0xa8(%rbp), %rdi
callq 0x35f0
pushq $0x1
popq %rdi
callq 0x3410
movq 0x9350(%rip), %rdi      # 0xefd0
leaq 0x47bb(%rip), %rsi      # 0xa442
callq 0x3370
movq %rax, %rdi
callq 0x31f0
jmp 0x5c71
jmp 0x5c9f
jmp 0x5cb0
jmp 0x5d4e
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x36a8
jmp 0x5cb3
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
jmp 0x5cfe
jmp 0x5d4e
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
jmp 0x5cdf
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x36a8
jmp 0x5cdb
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x36a8
jmp 0x5ce9
movq %rax, %rbx
leaq -0x108(%rbp), %rdi
jmp 0x5cfe
jmp 0x5d4e
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
callq 0x36a8
jmp 0x5d51
jmp 0x5d4e
movq %rax, %rbx
leaq -0x148(%rbp), %rdi
callq 0x36a8
jmp 0x5d1b
movq %rax, %rbx
movq %r12, %rdi
callq 0x3360
jmp 0x5d51
jmp 0x5d4e
jmp 0x5d4e
jmp 0x5d49
jmp 0x5d49
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x36a8
jmp 0x5d3e
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
jmp 0x5d64
movq %rax, %rbx
jmp 0x5d69
movq %rax, %rbx
jmp 0x5d5d
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
callq 0x36a8
leaq -0xc8(%rbp), %rdi
callq 0x36a8
leaq -0xe8(%rbp), %rdi
callq 0x36a8
movq %rbx, %rdi
callq 0x35c0