// File: /workspace/github_cpp_makefile_star2_O3/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 0x7f0c
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 0x77c7
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 0x9314
cmpl $-0x1, %eax
je 0x71d5
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 0x7f0c
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 0x9314
cmpl $-0x1, %eax
je 0x71da
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 0xaf24
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 0xb202
movl %eax, %r12d
leaq -0x128(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6dba
callq 0x3360
testb %r12b, %r12b
je 0x71f0
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 0x80a2
movq -0x70(%rbp), %rcx
movq -0x68(%rbp), %r8
movq -0x88(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %rbx, %rcx
je 0x6e88
movq -0x60(%rbp), %rdi
movq -0x90(%rbp), %rsi
cmpq %rdi, %rax
jbe 0x6ea7
movl $0xf, %edi
cmpq %r12, %rsi
je 0x6ea2
movq -0x80(%rbp), %rdi
cmpq %rdi, %rax
jbe 0x6eb2
leaq -0x70(%rbp), %rdi
callq 0x3140
jmp 0x6ec2
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 0x6edf
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x6ee7
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 0x6f14
callq 0x3360
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x6f26
callq 0x3360
movq -0x50(%rbp), %rdi
callq 0x3320
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x6f3d
callq 0x3360
leaq -0x108(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6f52
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 0x54ef(%rip), %rsi      # 0xc476
leaq 0x54f2(%rip), %rdx      # 0xc480
callq 0x7f0c
movq -0x70(%rbp), %rcx
movq -0x68(%rbp), %r8
movq -0x88(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %rbx, %rcx
je 0x6fb4
movq -0x60(%rbp), %rdi
movq -0x90(%rbp), %rsi
cmpq %rdi, %rax
jbe 0x6fd3
movl $0xf, %edi
cmpq %r12, %rsi
je 0x6fce
movq -0x80(%rbp), %rdi
cmpq %rdi, %rax
jbe 0x6fde
leaq -0x70(%rbp), %rdi
callq 0x3140
jmp 0x6fee
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 0x700b
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x7013
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 0x93e2(%rip), %rdi      # 0x10418
leaq -0x50(%rbp), %r14
movq %r14, %rsi
callq 0x3450
movq (%r14), %rdi
cmpq %r13, %rdi
je 0x704f
callq 0x3360
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
leaq -0x60(%rbp), %r14
je 0x7064
callq 0x3360
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
je 0x7072
callq 0x3360
leaq -0x70(%rbp), %rdi
leaq -0x29(%rbp), %rdx
movq -0x98(%rbp), %rsi
callq 0x3190
leaq -0x90(%rbp), %rdi
movq %r12, (%rdi)
leaq 0x53ea(%rip), %rsi      # 0xc481
leaq 0x53f3(%rip), %rdx      # 0xc491
callq 0x7f0c
movq -0x70(%rbp), %rcx
movq -0x68(%rbp), %r8
movq -0x88(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r14, %rcx
je 0x70c4
movq -0x60(%rbp), %rdi
movq -0x90(%rbp), %rsi
cmpq %rdi, %rax
jbe 0x70e3
movl $0xf, %edi
cmpq %r12, %rsi
je 0x70de
movq -0x80(%rbp), %rdi
cmpq %rdi, %rax
jbe 0x70ee
leaq -0x70(%rbp), %rdi
callq 0x3140
jmp 0x70fe
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 0x711b
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x7123
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 0x92f2(%rip), %rdi      # 0x10438
leaq -0x50(%rbp), %rbx
movq %rbx, %rsi
callq 0x3450
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0x715f
callq 0x3360
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
leaq -0xc8(%rbp), %rbx
je 0x7177
callq 0x3360
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
je 0x7185
callq 0x3360
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x719d
callq 0x3360
leaq -0xe8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x71b2
callq 0x3360
movq -0xd8(%rbp), %rdi
cmpq %rbx, %rdi
je 0x71c3
callq 0x3360
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
jmp 0x71e1
movq -0xb8(%rbp), %rdi
callq 0x35f0
movl $0x1, %edi
callq 0x3440
movq 0x8dd9(%rip), %rdi      # 0xffd0
leaq 0x5244(%rip), %rsi      # 0xc442
movl $0x1a, %edx
callq 0x3400
movq 0x8dc1(%rip), %rdi      # 0xffd0
callq 0x31e0
jmp 0x71e6
jmp 0x721f
jmp 0x7235
jmp 0x72ff
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x7238
callq 0x3360
jmp 0x7238
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
jmp 0x7299
jmp 0x72ff
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
jne 0x727b
jmp 0x7280
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x726e
callq 0x3360
jmp 0x726e
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x7280
callq 0x3360
leaq -0x108(%rbp), %rax
jmp 0x7295
jmp 0x72ff
movq %rax, %rbx
leaq -0x128(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x72c2
jmp 0x7302
jmp 0x72ff
movq %rax, %rbx
leaq -0x148(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x72bf
callq 0x3360
jmp 0x72bf
movq %rax, %rbx
movq %r12, %rdi
callq 0x3360
jmp 0x7302
jmp 0x72ff
jmp 0x72ff
jmp 0x72fa
jmp 0x72fa
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x72e7
callq 0x3360
jmp 0x72e7
movq %rax, %rbx
leaq -0x60(%rbp), %rax
jmp 0x7321
movq %rax, %rdi
callq 0x7536
movq %rax, %rbx
jmp 0x732f
movq %rax, %rbx
jmp 0x731a
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x731a
callq 0x3360
leaq -0xe8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x732f
callq 0x3360
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x7347
callq 0x3360
movq %rbx, %rdi
callq 0x35c0