// File: /workspace/github_cpp_makefile_star2_O1/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 0x5fe6(%rip), %rdi      # 0x10570
callq 0xa98e
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 0xa758
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), %rbx
leaq -0xe8(%rbp), %r15
movq -0x2f0(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x2f0(%rbp), %r14
addq %r14, %rdi
movl $0xa, %esi
callq 0x3370
movsbl %al, %edx
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
callq 0x3620
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xa7a0
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), %r14
movq %r12, %rdi
movq %r13, %rsi
movl $0x2c, %edx
callq 0x3620
movq %r14, %rdi
movq %r13, %rsi
callq 0x3220
movq %r12, %rdi
movq %r13, %rsi
movl $0x2c, %edx
callq 0x3620
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3220
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xa926
leaq 0x5e80(%rip), %rdi      # 0x10570
movq %r15, %rsi
callq 0x8be2
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0xa710
callq 0x3360
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0xa728
callq 0x3360
movq %r12, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x3620
movq %r12, %rdi
movq 0x5886(%rip), %rsi      # 0xffc8
callq 0x34d0
leaq -0x3f8(%rbp), %rdi
callq 0x3160
jmp 0xa63d
movq 0x5871(%rip), %rbx      # 0xffd0
leaq 0x2140(%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 0x583f(%rip), %rdi      # 0xffd0
callq 0x3030
movq %rax, %rdi
callq 0x3280
jmp 0xa7c4
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xa7b2
callq 0x3360
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa7c4
callq 0x3360
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xa7d9
callq 0x3360
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0xa7f1
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 0xa82b
movq %rax, %rbx
jmp 0xa876
jmp 0xa82b
jmp 0xa830
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x74b4
jmp 0xa833
movq %rax, %rbx
jmp 0xa852
movq %rax, %rbx
movq 0x578e(%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 0xa864
callq 0x3360
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa876
callq 0x3360
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xa88b
callq 0x3360
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0xa8a3
callq 0x3360
leaq -0x2f0(%rbp), %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x35c0
nop