// File: /workspace/github_cpp_makefile_star2_O1/parth-shel[P]xpac/client.cpp
// Function: remove_orphans()
void remove_orphans(){

	std::vector<std::string> to_remove;

	for(auto itr=indegree_map.begin(); itr!=indegree_map.end(); itr++) {
		if(itr->second == 0){
			to_remove.push_back(itr->first);
		}
	}

	if(to_remove.empty()){
		std::cout<<"No orphaned packages found!";
		exit(0);
	}

	std::cout<<"The following packages will be removed from the system: "<<std::endl;
	for(auto str:to_remove) {
		std::cout<<str<<std::endl;
	}

	char confirm;
	do {
		std::cout<<"Do you confirm?[Y/n]"<<std::endl;
		std::cin>>confirm;
	} while(confirm != 'Y' && confirm != 'n' && confirm != 'N' && confirm != 'y');

	if(confirm == 'n' || confirm == 'N') {
		exit(0);
	}
	else { //Deleting all packages:
		for(auto str:to_remove){
			remove_package(str);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
movq 0xa82b(%rip), %rbx      # 0x10548
leaq 0xa814(%rip), %r15      # 0x10538
cmpq %r15, %rbx
je 0x5d4f
leaq -0x50(%rbp), %r14
cmpl $0x0, 0x40(%rbx)
jne 0x5d3f
leaq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0x741a
movq %rbx, %rdi
callq 0x3290
movq %rax, %rbx
cmpq %r15, %rax
jne 0x5d2d
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
je 0x5f3d
movq 0xa26c(%rip), %rbx      # 0xffd0
leaq 0x638e(%rip), %rsi      # 0xc0f9
movl $0x38, %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 0xa23a(%rip), %rdi      # 0xffd0
callq 0x3030
movq %rax, %rdi
callq 0x3280
movq -0x50(%rbp), %r13
movq -0x48(%rbp), %r14
cmpq %r14, %r13
je 0x5e24
leaq -0x60(%rbp), %rbx
movq 0xa215(%rip), %r15      # 0xffd0
movq %rbx, -0x70(%rbp)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq -0x70(%rbp), %rdi
callq 0x8092
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq %r15, %rdi
callq 0x3400
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3370
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3280
movq -0x70(%rbp), %rdi
cmpq %rbx, %rdi
je 0x5e1b
callq 0x3360
addq $0x20, %r13
cmpq %r14, %r13
jne 0x5dbb
leaq 0x6261(%rip), %r14      # 0xc08c
movq 0xa1ae(%rip), %r15      # 0xffe0
leaq -0x29(%rbp), %r12
movabsq $0x80100000801, %rbx    # imm = 0x80100000801
movq 0xa189(%rip), %r13      # 0xffd0
movl $0x14, %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x3400
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3370
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3280
movq %r15, %rdi
movq %r12, %rsi
callq 0x3470
movzbl -0x29(%rbp), %eax
leal -0x4e(%rax), %ecx
cmpl $0x2b, %ecx
ja 0x5e47
btq %rcx, %rbx
jae 0x5e47
andb $0x5f, %al
cmpb $0x4e, %al
je 0x5f50
movq -0x50(%rbp), %r12
movq -0x48(%rbp), %r13
cmpq %r13, %r12
je 0x5f25
leaq -0x60(%rbp), %r15
leaq -0x80(%rbp), %rbx
leaq -0x90(%rbp), %r14
movq %r15, -0x70(%rbp)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq -0x70(%rbp), %rdi
callq 0x8092
movq %rbx, -0x90(%rbp)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x8092
movq %r14, %rdi
callq 0x59d1
movq -0x90(%rbp), %rdi
cmpq %rbx, %rdi
je 0x5f0e
callq 0x3360
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0x5f1c
callq 0x3360
addq $0x20, %r12
cmpq %r13, %r12
jne 0x5ec2
leaq -0x50(%rbp), %rdi
callq 0x7466
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xa08c(%rip), %rdi      # 0xffd0
leaq 0x6192(%rip), %rsi      # 0xc0dd
callq 0x3380
xorl %edi, %edi
callq 0x3440
jmp 0x5f83
jmp 0x5f83
jmp 0x5f83
movq %rax, %r14
jmp 0x5f76
movq %rax, %r14
movq -0x90(%rbp), %rdi
cmpq %rbx, %rdi
je 0x5f76
callq 0x3360
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
jne 0x5f94
jmp 0x5f99
jmp 0x5f83
movq %rax, %r14
jmp 0x5f99
movq %rax, %r14
movq -0x70(%rbp), %rdi
cmpq %rbx, %rdi
je 0x5f99
callq 0x3360
leaq -0x50(%rbp), %rdi
callq 0x7466
movq %r14, %rdi
callq 0x35c0