// File: parth-shel[P]xpac/xpac_install_utility.cpp
// Function: parse_universe_of_packages(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void parse_universe_of_packages(string filename) {
	universe_list.clear();
	// assuming relative filepath
	// file resides in same directory as xpac_install_utility executable
	// change accordingly to the needs
	ifstream file(filename.c_str());
	string name;
	string version;
	if(file.is_open()) {
		string line;
		string token;
		getline(file, line);// skip first line containing column headings
		while(getline(file, line)) {
			istringstream stream(line);
			// parse PKGID
			getline(stream, token, ',');
			// parse package name
			getline(stream, token, ',');
			name = token;
			// parse package version
			getline(stream, token, ',');
			version = token;
			universe_list.insert(make_pair(name,version));// add package name to set
			// parse executable name
			getline(stream, token, '\n');
		} 
	} else {
		cout<<"Local package database not found!"<<endl;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4c0, %rsp            # imm = 0x4C0
movq %rdi, -0x488(%rbp)
movq %rdi, -0x8(%rbp)
leaq 0xc523(%rip), %rdi      # 0x1e620
callq 0x12480
movq -0x488(%rbp), %rdi
callq 0x41c0
movq %rax, %rsi
leaq -0x210(%rbp), %rdi
movq %rdi, -0x480(%rbp)
movl $0x8, %edx
callq 0x4730
leaq -0x230(%rbp), %rdi
callq 0x4580
leaq -0x250(%rbp), %rdi
callq 0x4580
movq -0x480(%rbp), %rdi
callq 0x4630
movb %al, -0x471(%rbp)
jmp 0x12155
movb -0x471(%rbp), %al
testb $0x1, %al
jne 0x12164
jmp 0x123a3
leaq -0x280(%rbp), %rdi
movq %rdi, -0x490(%rbp)
callq 0x4580
leaq -0x2a0(%rbp), %rdi
callq 0x4580
movq -0x490(%rbp), %rsi
leaq -0x210(%rbp), %rdi
callq 0x40e0
jmp 0x12198
jmp 0x1219a
leaq -0x210(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x40e0
movq %rax, -0x498(%rbp)
jmp 0x121b6
movq -0x498(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x4500
movb %al, -0x499(%rbp)
jmp 0x121d4
movb -0x499(%rbp), %al
testb $0x1, %al
jne 0x121e3
jmp 0x1236f
leaq -0x420(%rbp), %rdi
leaq -0x280(%rbp), %rsi
movl $0x8, %edx
callq 0x4690
jmp 0x121fd
leaq -0x420(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
movl $0x2c, %edx
callq 0x4740
jmp 0x12217
leaq -0x420(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
movl $0x2c, %edx
callq 0x4740
jmp 0x12231
leaq -0x230(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x4050
jmp 0x12246
leaq -0x420(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
movl $0x2c, %edx
callq 0x4740
jmp 0x12260
leaq -0x250(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x4050
jmp 0x12275
leaq -0x460(%rbp), %rdi
leaq -0x230(%rbp), %rsi
leaq -0x250(%rbp), %rdx
callq 0x124a0
jmp 0x12291
leaq 0xc388(%rip), %rdi      # 0x1e620
leaq -0x460(%rbp), %rsi
callq 0x97a0
movb %dl, -0x4a9(%rbp)
movq %rax, -0x4a8(%rbp)
jmp 0x122b3
movb -0x4a9(%rbp), %al
movq -0x4a8(%rbp), %rcx
movq %rcx, -0x470(%rbp)
movb %al, -0x468(%rbp)
leaq -0x460(%rbp), %rdi
callq 0x9850
leaq -0x420(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
movl $0xa, %edx
callq 0x4740
jmp 0x122f3
leaq -0x420(%rbp), %rdi
callq 0x4230
jmp 0x1219a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
jmp 0x12403
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
jmp 0x12389
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
jmp 0x12361
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
leaq -0x460(%rbp), %rdi
callq 0x9850
leaq -0x420(%rbp), %rdi
callq 0x4230
jmp 0x12389
leaq -0x2a0(%rbp), %rdi
callq 0x47e8
leaq -0x280(%rbp), %rdi
callq 0x47e8
jmp 0x123d6
leaq -0x2a0(%rbp), %rdi
callq 0x47e8
leaq -0x280(%rbp), %rdi
callq 0x47e8
jmp 0x12403
movq 0xbc26(%rip), %rdi      # 0x1dfd0
leaq 0x34e7(%rip), %rsi      # 0x15898
callq 0x4400
movq %rax, -0x4b8(%rbp)
jmp 0x123bf
movq -0x4b8(%rbp), %rdi
movq 0xbbeb(%rip), %rsi      # 0x1dfb8
callq 0x4440
jmp 0x123d4
jmp 0x123d6
leaq -0x250(%rbp), %rdi
callq 0x47e8
leaq -0x230(%rbp), %rdi
callq 0x47e8
leaq -0x210(%rbp), %rdi
callq 0x4140
addq $0x4c0, %rsp            # imm = 0x4C0
popq %rbp
retq
leaq -0x250(%rbp), %rdi
callq 0x47e8
leaq -0x230(%rbp), %rdi
callq 0x47e8
leaq -0x210(%rbp), %rdi
callq 0x4140
movq -0x258(%rbp), %rdi
callq 0x46d0
nopw %cs:(%rax,%rax)
nopl (%rax)