// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdi, %rbx
leaq -0xc8(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x58b2(%rip), %rsi      # 0xc40a
leaq 0x58b0(%rip), %rdx      # 0xc40f
leaq -0xd8(%rbp), %rdi
callq 0x7f00
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rdx
movq %rbx, -0x98(%rbp)
movq %rbx, %rsi
callq 0x3190
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rsi
movl $0xc70f6907, %edx       # imm = 0xC70F6907
callq 0x30b0
movq %rax, %r14
movl $0x1, %esi
cmpq $0xa, %rax
jb 0x6bf4
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %r14, %rcx
cmpq $0x63, %rcx
jbe 0x6bed
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x6bf2
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x6bf4
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x6bb7
addl $-0x3, %esi
jmp 0x6bf4
addl $-0x2, %esi
jmp 0x6bf4
decl %esi
movl %esi, %esi
leaq -0x40(%rbp), %r13
movq %r13, -0x10(%r13)
leaq -0x50(%rbp), %rdi
xorl %edx, %edx
callq 0x3410
movq -0x50(%rbp), %rdi
movl -0x48(%rbp), %esi
movq %r14, %rdx
callq 0x77b7
movq -0x50(%rbp), %rsi
leaq -0xf8(%rbp), %rdi
leaq -0xb8(%rbp), %rdx
callq 0x3190
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x6c3d
callq 0x3360
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6c4f
callq 0x3360
movq -0xf8(%rbp), %rsi
movq -0xf0(%rbp), %rdx
leaq -0xd8(%rbp), %rdi
callq 0x3140
movq -0xd8(%rbp), %r14
leaq 0x5799(%rip), %rdi      # 0xc410
callq 0x3600
movq %r14, %rdi
movq %rax, %rsi
callq 0x9320
cmpl $-0x1, %eax
je 0x71e1
movq 0x9339(%rip), %r15      # 0xffd0
leaq 0x5781(%rip), %rsi      # 0xc41f
movl $0x1b, %edx
movq %r15, %rdi
callq 0x3400
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x3370
movsbl %al, %esi
movq 0x9307(%rip), %rdi      # 0xffd0
callq 0x3030
movq %rax, %rdi
callq 0x3280
leaq -0xa8(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x5753(%rip), %rsi      # 0xc43b
leaq 0x5752(%rip), %rdx      # 0xc441
leaq -0xb8(%rbp), %rdi
callq 0x7f00
movq -0xf8(%rbp), %rsi
movq -0xf0(%rbp), %rdx
leaq -0xb8(%rbp), %rdi
callq 0x3140
movq -0xb8(%rbp), %r15
leaq 0x56ed(%rip), %rdi      # 0xc410
callq 0x3600
movq %r15, %rdi
movq %rax, %rsi
callq 0x9320
cmpl $-0x1, %eax
je 0x71e6
movl $0x40, %edi
callq 0x3390
movq %rax, %r12
leaq -0x158(%rbp), %rdi
leaq -0x50(%rbp), %rdx
movq %r14, %rsi
callq 0x3190
leaq -0x158(%rbp), %rsi
movq %r12, %rdi
callq 0xaf3c
leaq -0x148(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6d80
callq 0x3360
leaq -0x138(%rbp), %rdi
leaq -0x50(%rbp), %rdx
movq %r15, %rsi
callq 0x3190
leaq -0x138(%rbp), %rsi
movq %r12, %rdi
callq 0xb21a
movl %eax, %r12d
leaq -0x128(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6dba
callq 0x3360
testb %r12b, %r12b
je 0x71fc
movq 0x9206(%rip), %r12      # 0xffd0
leaq 0x568c(%rip), %rsi      # 0xc45d
movl $0x18, %edx
movq %r12, %rdi
callq 0x3400
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x3370
movsbl %al, %esi
movq 0x91d3(%rip), %rdi      # 0xffd0
callq 0x3030
movq %rax, %rdi
callq 0x3280
leaq -0x118(%rbp), %rdi
leaq -0x29(%rbp), %rdx
movq %r14, %rsi
callq 0x3190
leaq -0x60(%rbp), %rbx
movq %rbx, -0x70(%rbp)
movabsq $0x6676782d20726174, %rax # imm = 0x6676782D20726174
movq %rax, -0x60(%rbp)
movw $0x20, -0x58(%rbp)
movq $0x9, -0x68(%rbp)
leaq -0x80(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x118(%rbp), %rsi
movq -0x110(%rbp), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0x8092
movq -0x70(%rbp), %rcx
movq -0x68(%rbp), %r8
movq -0x88(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %rbx, %rcx
je 0x6e88
movq -0x60(%rbp), %rsi
cmpq %rsi, %rax
jbe 0x6ea4
movl $0xf, %esi
cmpq %r12, -0x90(%rbp)
je 0x6e9f
movq -0x80(%rbp), %rsi
cmpq %rsi, %rax
jbe 0x6eb6
movq -0x90(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x3140
jmp 0x6ec6
leaq -0x90(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x33d0
movq %r13, -0x50(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x6ee3
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x6eeb
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x48(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x6f18
callq 0x3360
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x6f2a
callq 0x3360
movq -0x50(%rbp), %rdi
callq 0x3320
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x6f41
callq 0x3360
leaq -0x108(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6f56
callq 0x3360
movq %r14, %rdi
callq 0x35f0
movq %r15, %rdi
callq 0x35f0
leaq -0x70(%rbp), %rdi
leaq -0x29(%rbp), %rdx
movq -0x98(%rbp), %rsi
callq 0x3190
leaq -0x90(%rbp), %rdi
movq %r12, (%rdi)
leaq 0x54eb(%rip), %rsi      # 0xc476
leaq 0x54ee(%rip), %rdx      # 0xc480
callq 0x7f00
movq -0x70(%rbp), %rcx
movq -0x68(%rbp), %r8
movq -0x88(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %rbx, %rcx
je 0x6fb8
movq -0x60(%rbp), %rsi
cmpq %rsi, %rax
jbe 0x6fd4
movl $0xf, %esi
cmpq %r12, -0x90(%rbp)
je 0x6fcf
movq -0x80(%rbp), %rsi
cmpq %rsi, %rax
jbe 0x6fe6
movq -0x90(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x3140
jmp 0x6ff6
leaq -0x90(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x33d0
movq %r13, -0x50(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x7013
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x701b
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x48(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x93da(%rip), %rdi      # 0x10418
leaq -0x50(%rbp), %r14
movq %r14, %rsi
callq 0x3450
movq (%r14), %rdi
cmpq %r13, %rdi
je 0x7057
callq 0x3360
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
leaq -0x60(%rbp), %r14
je 0x706c
callq 0x3360
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
je 0x707a
callq 0x3360
leaq -0x70(%rbp), %rdi
leaq -0x29(%rbp), %rdx
movq -0x98(%rbp), %rsi
callq 0x3190
leaq -0x90(%rbp), %rdi
movq %r12, (%rdi)
leaq 0x53e2(%rip), %rsi      # 0xc481
leaq 0x53eb(%rip), %rdx      # 0xc491
callq 0x7f00
movq -0x70(%rbp), %rcx
movq -0x68(%rbp), %r8
movq -0x88(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r14, %rcx
je 0x70cc
movq -0x60(%rbp), %rsi
cmpq %rsi, %rax
jbe 0x70e8
movl $0xf, %esi
cmpq %r12, -0x90(%rbp)
je 0x70e3
movq -0x80(%rbp), %rsi
cmpq %rsi, %rax
jbe 0x70fa
movq -0x90(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x3140
jmp 0x710a
leaq -0x90(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x33d0
movq %r13, -0x50(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x7127
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x712f
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x48(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x92e6(%rip), %rdi      # 0x10438
leaq -0x50(%rbp), %rbx
movq %rbx, %rsi
callq 0x3450
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0x716b
callq 0x3360
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
leaq -0xc8(%rbp), %rbx
je 0x7183
callq 0x3360
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
je 0x7191
callq 0x3360
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x71a9
callq 0x3360
leaq -0xe8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x71be
callq 0x3360
movq -0xd8(%rbp), %rdi
cmpq %rbx, %rdi
je 0x71cf
callq 0x3360
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
jmp 0x71ed
movq -0xb8(%rbp), %rdi
callq 0x35f0
movl $0x1, %edi
callq 0x3440
movq 0x8dcd(%rip), %rdi      # 0xffd0
leaq 0x5238(%rip), %rsi      # 0xc442
movl $0x1a, %edx
callq 0x3400
movq 0x8db5(%rip), %rdi      # 0xffd0
callq 0x31e0
jmp 0x71f2
jmp 0x722b
jmp 0x7241
jmp 0x730b
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x7244
callq 0x3360
jmp 0x7244
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
jmp 0x72a5
jmp 0x730b
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
jne 0x7287
jmp 0x728c
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x727a
callq 0x3360
jmp 0x727a
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x728c
callq 0x3360
leaq -0x108(%rbp), %rax
jmp 0x72a1
jmp 0x730b
movq %rax, %rbx
leaq -0x128(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x72ce
jmp 0x730e
jmp 0x730b
movq %rax, %rbx
leaq -0x148(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x72cb
callq 0x3360
jmp 0x72cb
movq %rax, %rbx
movq %r12, %rdi
callq 0x3360
jmp 0x730e
jmp 0x730b
jmp 0x730b
jmp 0x7306
jmp 0x7306
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x72f3
callq 0x3360
jmp 0x72f3
movq %rax, %rbx
leaq -0x60(%rbp), %rax
jmp 0x732d
movq %rax, %rdi
callq 0x7538
movq %rax, %rbx
jmp 0x733b
movq %rax, %rbx
jmp 0x7326
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x7326
callq 0x3360
leaq -0xe8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x733b
callq 0x3360
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x7353
callq 0x3360
movq %rbx, %rdi
callq 0x35c0