// File: parth-shel[P]xpac/client.cpp
// Function: calculate_differences()
void calculate_differences() {
	std::string to_update_string;
	std::vector<std::string> updates;
	for(auto key_itr = user_installed_list.begin(); key_itr!=user_installed_list.end(); key_itr++) {
		if(key_itr->second.compare(universe_list.find(key_itr->first)->second) != 0) {
			to_update_string += key_itr->first + " " + key_itr->second + " -> " + universe_list.find(key_itr->first)->second + "\n";
			updates.push_back(key_itr->first);
		}
	}
	std::cout<<"Updates available: "<<std::endl;
	if(to_update_string.compare("") == 0) {
		std::cout<<"None!"<<std::endl;
	}
	else {
		std::cout<<to_update_string;
	}
	
	//Writing all the updates to the file
	std::fstream file;
	file.open(update_file, std::ios::out | std::ios::trunc);

	// Simply appending to file
	for(auto itr = updates.begin(); itr!=updates.end(); itr++)
		file << *itr <<"\n";
	file.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x390, %rsp            # imm = 0x390
leaq -0x20(%rbp), %rdi
callq 0x4580
leaq -0x38(%rbp), %rdi
callq 0x9360
leaq 0x1979c(%rip), %rdi     # 0x1e670
callq 0x9380
movq %rax, -0x40(%rbp)
leaq 0x1978c(%rip), %rdi     # 0x1e670
callq 0x93e0
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x93b0
testb $0x1, %al
jne 0x4f03
jmp 0x5162
leaq -0x40(%rbp), %rdi
movq %rdi, -0x350(%rbp)
callq 0x9410
movq -0x350(%rbp), %rdi
addq $0x20, %rax
movq %rax, -0x348(%rbp)
callq 0x9410
movq %rax, %rsi
leaq 0x196ec(%rip), %rdi     # 0x1e620
callq 0x9440
movq %rax, -0x340(%rbp)
jmp 0x4f42
movq -0x340(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x9410
movq -0x348(%rbp), %rdi
movq %rax, %rsi
addq $0x20, %rsi
callq 0x4040
movl %eax, -0x354(%rbp)
jmp 0x4f71
movl -0x354(%rbp), %eax
cmpl $0x0, %eax
je 0x5149
leaq -0x40(%rbp), %rdi
callq 0x9410
movq %rax, %rsi
leaq 0x10576(%rip), %rdx     # 0x15509
leaq -0x100(%rbp), %rdi
callq 0x9170
jmp 0x4fa1
leaq -0x40(%rbp), %rdi
callq 0x9410
movq %rax, %rdx
addq $0x20, %rdx
leaq -0xe0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x94c0
jmp 0x4fc6
leaq 0x10075(%rip), %rdx     # 0x15042
leaq -0xc0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x9470
jmp 0x4fe2
leaq -0x40(%rbp), %rdi
callq 0x9410
movq %rax, %rsi
leaq 0x1962b(%rip), %rdi     # 0x1e620
callq 0x9440
movq %rax, -0x360(%rbp)
jmp 0x5003
movq -0x360(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x9410
movq %rax, %rdx
addq $0x20, %rdx
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x94c0
jmp 0x5039
leaq 0x107c2(%rip), %rdx     # 0x15802
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x9470
jmp 0x5052
leaq -0x20(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x4510
jmp 0x5061
leaq -0x80(%rbp), %rdi
callq 0x47e8
leaq -0xa0(%rbp), %rdi
callq 0x47e8
leaq -0xc0(%rbp), %rdi
callq 0x47e8
leaq -0xe0(%rbp), %rdi
callq 0x47e8
leaq -0x100(%rbp), %rdi
callq 0x47e8
leaq -0x40(%rbp), %rdi
callq 0x9410
movq %rax, %rsi
leaq -0x38(%rbp), %rdi
callq 0x9510
jmp 0x50b1
jmp 0x5149
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x531a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5138
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x512c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5120
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5114
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x47e8
leaq -0xa0(%rbp), %rdi
callq 0x47e8
leaq -0xc0(%rbp), %rdi
callq 0x47e8
leaq -0xe0(%rbp), %rdi
callq 0x47e8
leaq -0x100(%rbp), %rdi
callq 0x47e8
jmp 0x531a
jmp 0x514b
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0x9580
movq %rax, -0x110(%rbp)
jmp 0x4edd
movq 0x18e67(%rip), %rdi     # 0x1dfd0
leaq 0xfed7(%rip), %rsi      # 0x15047
callq 0x4400
movq %rax, -0x368(%rbp)
jmp 0x517e
movq -0x368(%rbp), %rdi
movq 0x18e2c(%rip), %rsi     # 0x1dfb8
callq 0x4440
jmp 0x5193
leaq -0x20(%rbp), %rdi
leaq 0x10665(%rip), %rsi     # 0x15803
callq 0x4170
cmpl $0x0, %eax
jne 0x51db
movq 0x18e21(%rip), %rdi     # 0x1dfd0
leaq 0xfea5(%rip), %rsi      # 0x1505b
callq 0x4400
movq %rax, -0x370(%rbp)
jmp 0x51c4
movq -0x370(%rbp), %rdi
movq 0x18de6(%rip), %rsi     # 0x1dfb8
callq 0x4440
jmp 0x51d9
jmp 0x51ef
movq 0x18dee(%rip), %rdi     # 0x1dfd0
leaq -0x20(%rbp), %rsi
callq 0x43d0
jmp 0x51ed
jmp 0x51ef
leaq -0x320(%rbp), %rdi
callq 0x44b0
jmp 0x51fd
movl $0x10, %edi
movl $0x20, %esi
callq 0x95c0
movl %eax, -0x374(%rbp)
jmp 0x5214
movl -0x374(%rbp), %edx
leaq 0x1926f(%rip), %rsi     # 0x1e490
leaq -0x320(%rbp), %rdi
callq 0x4570
jmp 0x522f
leaq -0x38(%rbp), %rdi
callq 0x95e0
movq %rax, -0x328(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x9650
movq %rax, -0x330(%rbp)
leaq -0x328(%rbp), %rdi
leaq -0x330(%rbp), %rsi
callq 0x9610
testb $0x1, %al
jne 0x5268
jmp 0x52e5
leaq -0x310(%rbp), %rax
movq %rax, -0x388(%rbp)
leaq -0x328(%rbp), %rdi
callq 0x9680
movq -0x388(%rbp), %rdi
movq %rax, %rsi
callq 0x43d0
movq %rax, -0x380(%rbp)
jmp 0x529a
movq -0x380(%rbp), %rdi
leaq 0x1055a(%rip), %rsi     # 0x15802
callq 0x4400
jmp 0x52af
jmp 0x52b1
leaq -0x328(%rbp), %rdi
xorl %esi, %esi
callq 0x96a0
movq %rax, -0x338(%rbp)
jmp 0x523f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x320(%rbp), %rdi
callq 0x4110
jmp 0x531a
leaq -0x320(%rbp), %rdi
callq 0x40a0
jmp 0x52f3
leaq -0x320(%rbp), %rdi
callq 0x4110
leaq -0x38(%rbp), %rdi
callq 0x96e0
leaq -0x20(%rbp), %rdi
callq 0x47e8
addq $0x390, %rsp            # imm = 0x390
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x96e0
leaq -0x20(%rbp), %rdi
callq 0x47e8
movq -0x58(%rbp), %rdi
callq 0x46d0
nopw %cs:(%rax,%rax)