// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x448, %rsp            # imm = 0x448
movq %rdi, %rbx
leaq 0x6b52(%rip), %rdi      # 0xf580
callq 0x8cea
movq (%rbx), %rsi
leaq -0x2f0(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x3610
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq -0x98(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
xorl %edx, %edx
movb %dl, (%rax)
movb %dl, (%rcx)
leaq -0x278(%rbp), %rdi
callq 0x30e0
testb %al, %al
je 0x8b7f
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq -0x78(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq -0x2f0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x30a0
leaq -0x470(%rbp), %r15
leaq -0x88(%rbp), %r13
pushq $0x2c
popq %r12
leaq -0xa8(%rbp), %r14
leaq -0xe8(%rbp), %rbx
leaq -0x2f0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x30a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x8b9c
movq %r15, %rdi
leaq -0x48(%rbp), %rsi
pushq $0x8
popq %rdx
callq 0x35a0
movq %r15, %rdi
movq %r13, %rsi
movl %r12d, %edx
callq 0x3620
movq %r15, %rdi
movq %r13, %rsi
movl %r12d, %edx
callq 0x3620
leaq -0x68(%rbp), %rdi
movq %r13, %rsi
callq 0x3240
movq %r15, %rdi
movq %r13, %rsi
movl %r12d, %edx
callq 0x3620
movq %r14, %rdi
movq %r13, %rsi
callq 0x3240
movq %rbx, %rdi
leaq -0x68(%rbp), %rsi
movq %r14, %rdx
callq 0x8cb4
leaq 0x6a2c(%rip), %rdi      # 0xf580
movq %rbx, %rsi
callq 0x775c
movq %rbx, %rdi
callq 0x5fe4
movq %r15, %rdi
movq %r13, %rsi
pushq $0xa
popq %rdx
callq 0x3620
movq %r15, %rdi
callq 0x31e0
jmp 0x8acc
movq 0x644a(%rip), %rdi      # 0xefd0
leaq 0x1cf9(%rip), %rsi      # 0xa886
callq 0x3370
movq %rax, %rdi
callq 0x31f0
jmp 0x8bb1
leaq -0x88(%rbp), %rdi
callq 0x36a8
leaq -0x48(%rbp), %rdi
callq 0x36a8
leaq -0xa8(%rbp), %rdi
callq 0x36a8
leaq -0x68(%rbp), %rdi
callq 0x36a8
leaq -0x2f0(%rbp), %rdi
callq 0x3110
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8c00
movq %rax, %rbx
jmp 0x8c29
jmp 0x8c00
jmp 0x8c05
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x5fe4
jmp 0x8c08
movq %rax, %rbx
jmp 0x8c14
movq %rax, %rbx
leaq -0x470(%rbp), %rdi
callq 0x31e0
leaq -0x88(%rbp), %rdi
callq 0x36a8
leaq -0x48(%rbp), %rdi
callq 0x36a8
leaq -0xa8(%rbp), %rdi
callq 0x36a8
leaq -0x68(%rbp), %rdi
callq 0x36a8
leaq -0x2f0(%rbp), %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x35c0