// File: /workspace/github_cpp_makefile_star2_O3/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 0x5ffe(%rip), %rdi      # 0x10570
callq 0xa976
movq (%rbx), %rsi
leaq -0x2f0(%rbp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x3610
leaq -0x98(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x78(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x278(%rbp), %rdi
callq 0x30e0
testb %al, %al
je 0xa740
leaq -0x38(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x58(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movq -0x2f0(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3370
movsbl %al, %edx
leaq -0x2f0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3620
leaq -0x470(%rbp), %r12
leaq -0x68(%rbp), %r13
leaq -0x88(%rbp), %r14
leaq -0xe8(%rbp), %r15
movq -0x2f0(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x2f0(%rbp), %rbx
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3370
movsbl %al, %edx
movq %rbx, %rdi
leaq -0x48(%rbp), %rsi
callq 0x3620
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xa788
movq %r12, %rdi
leaq -0x48(%rbp), %rsi
movl $0x8, %edx
callq 0x3590
movq %r12, %rdi
movq %r13, %rsi
movl $0x2c, %edx
callq 0x3620
leaq -0xa8(%rbp), %rbx
movq %r12, %rdi
movq %r13, %rsi
movl $0x2c, %edx
callq 0x3620
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3220
movq %r12, %rdi
movq %r13, %rsi
movl $0x2c, %edx
callq 0x3620
movq %r14, %rdi
movq %r13, %rsi
callq 0x3220
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xa90e
leaq 0x5e98(%rip), %rdi      # 0x10570
movq %r15, %rsi
callq 0x8bc2
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0xa6f8
callq 0x3360
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0xa710
callq 0x3360
movq %r12, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x3620
movq %r12, %rdi
movq 0x589e(%rip), %rsi      # 0xffc8
callq 0x34d0
leaq -0x3f8(%rbp), %rdi
callq 0x3160
jmp 0xa625
movq 0x5889(%rip), %rbx      # 0xffd0
leaq 0x2158(%rip), %rsi      # 0xc8a6
movl $0x21, %edx
movq %rbx, %rdi
callq 0x3400
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3370
movsbl %al, %esi
movq 0x5857(%rip), %rdi      # 0xffd0
callq 0x3030
movq %rax, %rdi
callq 0x3280
jmp 0xa7ac
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xa79a
callq 0x3360
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa7ac
callq 0x3360
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xa7c1
callq 0x3360
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0xa7d9
callq 0x3360
leaq -0x2f0(%rbp), %rdi
callq 0x3100
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa813
movq %rax, %rbx
jmp 0xa85e
jmp 0xa813
jmp 0xa818
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x74b2
jmp 0xa81b
movq %rax, %rbx
jmp 0xa83a
movq %rax, %rbx
movq 0x57a6(%rip), %rsi      # 0xffc8
leaq -0x470(%rbp), %rdi
callq 0x34d0
leaq -0x3f8(%rbp), %rdi
callq 0x3160
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xa84c
callq 0x3360
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa85e
callq 0x3360
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xa873
callq 0x3360
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0xa88b
callq 0x3360
leaq -0x2f0(%rbp), %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x35c0
nop