// File: mdpkh[P]retro6k/src/main.cpp
// Function: CollapsePaths()
void CollapsePaths()
{
	// merge config.sessionpath and config.path vectors (sessionpath first)
	config.sessionpath.cartpath.insert(
		config.sessionpath.cartpath.end(),
		config.path.cartpath.begin(),
		config.path.cartpath.end());
	config.sessionpath.rompath.insert(
		config.sessionpath.rompath.end(),
		config.path.rompath.begin(),
		config.path.rompath.end());
	config.sessionpath.savepath.insert(
		config.sessionpath.savepath.end(),
		config.path.savepath.begin(),
		config.path.savepath.end());
	config.sessionpath.screencappath.insert(
		config.sessionpath.screencappath.end(),
		config.path.screencappath.begin(),
		config.path.screencappath.end());
	// in each combined vector, set every path to its canonical form
	// --- delete path item if it doesn't exist in filesystem
	for (auto it = config.sessionpath.cartpath.begin();
		it != config.sessionpath.cartpath.end(); )
	{
		if (std::filesystem::exists(*it))
		{
			*it = std::filesystem::canonical(*it);
			++it;
		}
		else
		{
			it = config.sessionpath.cartpath.erase(it);
		}
	}
	for (auto it = config.sessionpath.rompath.begin();
		it != config.sessionpath.rompath.end(); )
	{
		if (std::filesystem::exists(*it))
		{
			*it = std::filesystem::canonical(*it);
			++it;
		}
		else
		{
			it = config.sessionpath.rompath.erase(it);
		}
	}
	for (auto it = config.sessionpath.savepath.begin();
		it != config.sessionpath.savepath.end(); )
	{
		if (std::filesystem::exists(*it))
		{
			*it = std::filesystem::canonical(*it);
			++it;
		}
		else
		{
			it = config.sessionpath.savepath.erase(it);
		}
	}
	for (auto it = config.sessionpath.screencappath.begin();
		it != config.sessionpath.screencappath.end(); )
	{
		if (std::filesystem::exists(*it))
		{
			*it = std::filesystem::canonical(*it);
			++it;
		}
		else
		{
			it = config.sessionpath.screencappath.erase(it);
		}
	}
	// in each combined vector, remove any duplicates of previous items
	for (auto it1 = config.sessionpath.cartpath.begin();
		it1 != config.sessionpath.cartpath.end(); )
	{
		for (auto it2 = config.sessionpath.cartpath.begin();
			it2 != it1; )
		{
			if (*it1 == *it2)
			{
				it1 = config.sessionpath.cartpath.erase(it1);
				break;
			}
			else
			{
				++it2;
			}
		}
		++it1;
	}
	for (auto it1 = config.sessionpath.rompath.begin();
		it1 != config.sessionpath.rompath.end(); )
	{
		for (auto it2 = config.sessionpath.rompath.begin();
			it2 != it1; )
		{
			if (*it1 == *it2)
			{
				it1 = config.sessionpath.rompath.erase(it1);
				break;
			}
			else
			{
				++it2;
			}
		}
		++it1;
	}
	for (auto it1 = config.sessionpath.savepath.begin();
		it1 != config.sessionpath.savepath.end(); )
	{
		for (auto it2 = config.sessionpath.savepath.begin();
			it2 != it1; )
		{
			if (*it1 == *it2)
			{
				it1 = config.sessionpath.savepath.erase(it1);
				break;
			}
			else
			{
				++it2;
			}
		}
		++it1;
	}
	for (auto it1 = config.sessionpath.screencappath.begin();
		it1 != config.sessionpath.screencappath.end(); )
	{
		for (auto it2 = config.sessionpath.screencappath.begin();
			it2 != it1; )
		{
			if (*it1 == *it2)
			{
				it1 = config.sessionpath.screencappath.erase(it1);
				break;
			}
			else
			{
				++it2;
			}
		}
		++it1;
	}
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
leaq 0x2598e(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x18, %rdi
callq 0x12d30
movq %rax, -0x10(%rbp)
leaq -0x8(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x12d60
leaq 0x25966(%rip), %rdi     # 0x2d420
addq $0x68, %rdi
addq $0x18, %rdi
callq 0x12da0
movq %rax, -0x18(%rbp)
leaq 0x2594e(%rip), %rdi     # 0x2d420
addq $0x68, %rdi
addq $0x18, %rdi
callq 0x12d30
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq 0x2592a(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x18, %rdi
callq 0x12c80
movq %rax, -0x28(%rbp)
leaq 0x2590f(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
callq 0x12d30
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x12d60
leaq 0x258eb(%rip), %rdi     # 0x2d420
addq $0x68, %rdi
callq 0x12da0
movq %rax, -0x40(%rbp)
leaq 0x258d7(%rip), %rdi     # 0x2d420
addq $0x68, %rdi
callq 0x12d30
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x48(%rbp), %rcx
leaq 0x258b7(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
callq 0x12c80
movq %rax, -0x50(%rbp)
leaq 0x258a0(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x30, %rdi
callq 0x12d30
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x12d60
leaq 0x25878(%rip), %rdi     # 0x2d420
addq $0x68, %rdi
addq $0x30, %rdi
callq 0x12da0
movq %rax, -0x68(%rbp)
leaq 0x25860(%rip), %rdi     # 0x2d420
addq $0x68, %rdi
addq $0x30, %rdi
callq 0x12d30
movq %rax, -0x70(%rbp)
movq -0x58(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq -0x70(%rbp), %rcx
leaq 0x2583c(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x30, %rdi
callq 0x12c80
movq %rax, -0x78(%rbp)
leaq 0x25821(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x48, %rdi
callq 0x12d30
movq %rax, -0x88(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x12d60
leaq 0x257f3(%rip), %rdi     # 0x2d420
addq $0x68, %rdi
addq $0x48, %rdi
callq 0x12da0
movq %rax, -0x90(%rbp)
leaq 0x257d8(%rip), %rdi     # 0x2d420
addq $0x68, %rdi
addq $0x48, %rdi
callq 0x12d30
movq %rax, -0x98(%rbp)
movq -0x80(%rbp), %rsi
movq -0x90(%rbp), %rdx
movq -0x98(%rbp), %rcx
leaq 0x257ab(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x48, %rdi
callq 0x12c80
movq %rax, -0xa0(%rbp)
leaq 0x2578d(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x18, %rdi
callq 0x12da0
movq %rax, -0xa8(%rbp)
leaq 0x2576f(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x18, %rdi
callq 0x12d30
movq %rax, -0xb0(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x12dd0
testb $0x1, %al
jne 0x7ce4
jmp 0x7d99
leaq -0xa8(%rbp), %rdi
callq 0x12e40
movq %rax, %rdi
callq 0x12e10
testb $0x1, %al
jne 0x7cfe
jmp 0x7d4e
leaq -0xa8(%rbp), %rdi
callq 0x12e40
movq %rax, %rsi
leaq -0xd8(%rbp), %rdi
callq 0x7280
leaq -0xa8(%rbp), %rdi
callq 0x12e40
movq %rax, %rdi
leaq -0xd8(%rbp), %rsi
callq 0x12e60
leaq -0xd8(%rbp), %rdi
callq 0x12ed0
leaq -0xa8(%rbp), %rdi
callq 0x12f00
jmp 0x7d94
leaq -0xe8(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x12d60
movq -0xe8(%rbp), %rsi
leaq 0x256b1(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x18, %rdi
callq 0x12f20
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0xa8(%rbp)
jmp 0x7caa
leaq 0x25680(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
callq 0x12da0
movq %rax, -0xf0(%rbp)
leaq 0x25666(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
callq 0x12d30
movq %rax, -0xf8(%rbp)
leaq -0xf0(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x12dd0
testb $0x1, %al
jne 0x7de9
jmp 0x7e9a
leaq -0xf0(%rbp), %rdi
callq 0x12e40
movq %rax, %rdi
callq 0x12e10
testb $0x1, %al
jne 0x7e03
jmp 0x7e53
leaq -0xf0(%rbp), %rdi
callq 0x12e40
movq %rax, %rsi
leaq -0x120(%rbp), %rdi
callq 0x7280
leaq -0xf0(%rbp), %rdi
callq 0x12e40
movq %rax, %rdi
leaq -0x120(%rbp), %rsi
callq 0x12e60
leaq -0x120(%rbp), %rdi
callq 0x12ed0
leaq -0xf0(%rbp), %rdi
callq 0x12f00
jmp 0x7e95
leaq -0x130(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x12d60
movq -0x130(%rbp), %rsi
leaq 0x255ac(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
callq 0x12f20
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
movq %rax, -0xf0(%rbp)
jmp 0x7db3
leaq 0x2557f(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x30, %rdi
callq 0x12da0
movq %rax, -0x138(%rbp)
leaq 0x25561(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x30, %rdi
callq 0x12d30
movq %rax, -0x140(%rbp)
leaq -0x138(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x12dd0
testb $0x1, %al
jne 0x7ef2
jmp 0x7fa7
leaq -0x138(%rbp), %rdi
callq 0x12e40
movq %rax, %rdi
callq 0x12e10
testb $0x1, %al
jne 0x7f0c
jmp 0x7f5c
leaq -0x138(%rbp), %rdi
callq 0x12e40
movq %rax, %rsi
leaq -0x168(%rbp), %rdi
callq 0x7280
leaq -0x138(%rbp), %rdi
callq 0x12e40
movq %rax, %rdi
leaq -0x168(%rbp), %rsi
callq 0x12e60
leaq -0x168(%rbp), %rdi
callq 0x12ed0
leaq -0x138(%rbp), %rdi
callq 0x12f00
jmp 0x7fa2
leaq -0x178(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x12d60
movq -0x178(%rbp), %rsi
leaq 0x254a3(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x30, %rdi
callq 0x12f20
movq %rax, -0x170(%rbp)
movq -0x170(%rbp), %rax
movq %rax, -0x138(%rbp)
jmp 0x7eb8
leaq 0x25472(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x48, %rdi
callq 0x12da0
movq %rax, -0x180(%rbp)
leaq 0x25454(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x48, %rdi
callq 0x12d30
movq %rax, -0x188(%rbp)
leaq -0x180(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x12dd0
testb $0x1, %al
jne 0x7fff
jmp 0x80b4
leaq -0x180(%rbp), %rdi
callq 0x12e40
movq %rax, %rdi
callq 0x12e10
testb $0x1, %al
jne 0x8019
jmp 0x8069
leaq -0x180(%rbp), %rdi
callq 0x12e40
movq %rax, %rsi
leaq -0x1b0(%rbp), %rdi
callq 0x7280
leaq -0x180(%rbp), %rdi
callq 0x12e40
movq %rax, %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x12e60
leaq -0x1b0(%rbp), %rdi
callq 0x12ed0
leaq -0x180(%rbp), %rdi
callq 0x12f00
jmp 0x80af
leaq -0x1c0(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x12d60
movq -0x1c0(%rbp), %rsi
leaq 0x25396(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x48, %rdi
callq 0x12f20
movq %rax, -0x1b8(%rbp)
movq -0x1b8(%rbp), %rax
movq %rax, -0x180(%rbp)
jmp 0x7fc5
leaq 0x25365(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x18, %rdi
callq 0x12da0
movq %rax, -0x1c8(%rbp)
leaq 0x25347(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x18, %rdi
callq 0x12d30
movq %rax, -0x1d0(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x12dd0
testb $0x1, %al
jne 0x810c
jmp 0x81e4
leaq 0x2530d(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x18, %rdi
callq 0x12da0
movq %rax, -0x1d8(%rbp)
leaq -0x1d8(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x12dd0
testb $0x1, %al
jne 0x8146
jmp 0x81d3
leaq -0x1c8(%rbp), %rdi
callq 0x12e40
movq %rax, -0x268(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x12e40
movq -0x268(%rbp), %rdi
movq %rax, %rsi
callq 0x12f90
testb $0x1, %al
jne 0x817a
jmp 0x81c2
leaq -0x1e8(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x12d60
movq -0x1e8(%rbp), %rsi
leaq 0x25285(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x18, %rdi
callq 0x12f20
movq %rax, -0x1e0(%rbp)
movq -0x1e0(%rbp), %rax
movq %rax, -0x1c8(%rbp)
jmp 0x81d3
leaq -0x1d8(%rbp), %rdi
callq 0x12f00
jmp 0x812a
leaq -0x1c8(%rbp), %rdi
callq 0x12f00
jmp 0x80d2
leaq 0x25235(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
callq 0x12da0
movq %rax, -0x1f0(%rbp)
leaq 0x2521b(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
callq 0x12d30
movq %rax, -0x1f8(%rbp)
leaq -0x1f0(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x12dd0
testb $0x1, %al
jne 0x8234
jmp 0x8304
leaq 0x251e5(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
callq 0x12da0
movq %rax, -0x200(%rbp)
leaq -0x200(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x12dd0
testb $0x1, %al
jne 0x826a
jmp 0x82f3
leaq -0x1f0(%rbp), %rdi
callq 0x12e40
movq %rax, -0x270(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x12e40
movq -0x270(%rbp), %rdi
movq %rax, %rsi
callq 0x12f90
testb $0x1, %al
jne 0x829e
jmp 0x82e2
leaq -0x210(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x12d60
movq -0x210(%rbp), %rsi
leaq 0x25161(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
callq 0x12f20
movq %rax, -0x208(%rbp)
movq -0x208(%rbp), %rax
movq %rax, -0x1f0(%rbp)
jmp 0x82f3
leaq -0x200(%rbp), %rdi
callq 0x12f00
jmp 0x824e
leaq -0x1f0(%rbp), %rdi
callq 0x12f00
jmp 0x81fe
leaq 0x25115(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x30, %rdi
callq 0x12da0
movq %rax, -0x218(%rbp)
leaq 0x250f7(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x30, %rdi
callq 0x12d30
movq %rax, -0x220(%rbp)
leaq -0x218(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x12dd0
testb $0x1, %al
jne 0x835c
jmp 0x8434
leaq 0x250bd(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x30, %rdi
callq 0x12da0
movq %rax, -0x228(%rbp)
leaq -0x228(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0x12dd0
testb $0x1, %al
jne 0x8396
jmp 0x8423
leaq -0x218(%rbp), %rdi
callq 0x12e40
movq %rax, -0x278(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x12e40
movq -0x278(%rbp), %rdi
movq %rax, %rsi
callq 0x12f90
testb $0x1, %al
jne 0x83ca
jmp 0x8412
leaq -0x238(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0x12d60
movq -0x238(%rbp), %rsi
leaq 0x25035(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x30, %rdi
callq 0x12f20
movq %rax, -0x230(%rbp)
movq -0x230(%rbp), %rax
movq %rax, -0x218(%rbp)
jmp 0x8423
leaq -0x228(%rbp), %rdi
callq 0x12f00
jmp 0x837a
leaq -0x218(%rbp), %rdi
callq 0x12f00
jmp 0x8322
leaq 0x24fe5(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x48, %rdi
callq 0x12da0
movq %rax, -0x240(%rbp)
leaq 0x24fc7(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x48, %rdi
callq 0x12d30
movq %rax, -0x248(%rbp)
leaq -0x240(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x12dd0
testb $0x1, %al
jne 0x848c
jmp 0x8564
leaq 0x24f8d(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x48, %rdi
callq 0x12da0
movq %rax, -0x250(%rbp)
leaq -0x250(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x12dd0
testb $0x1, %al
jne 0x84c6
jmp 0x8553
leaq -0x240(%rbp), %rdi
callq 0x12e40
movq %rax, -0x280(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x12e40
movq -0x280(%rbp), %rdi
movq %rax, %rsi
callq 0x12f90
testb $0x1, %al
jne 0x84fa
jmp 0x8542
leaq -0x260(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x12d60
movq -0x260(%rbp), %rsi
leaq 0x24f05(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
addq $0x48, %rdi
callq 0x12f20
movq %rax, -0x258(%rbp)
movq -0x258(%rbp), %rax
movq %rax, -0x240(%rbp)
jmp 0x8553
leaq -0x250(%rbp), %rdi
callq 0x12f00
jmp 0x84aa
leaq -0x240(%rbp), %rdi
callq 0x12f00
jmp 0x8452
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
nopl (%rax)