// File: Matlock42[P]Jeopardy/jgameClass.cpp
// Function: Game::findXML[abi:cxx11](char const*)
std::vector <std::string> Game::findXML ( const char *path)
{
	tinydir_dir dir;
	std::string s;
	std::vector <std::string> output;
	
	// open the current directory
	if (tinydir_open(&dir, path) == -1)
	{
		std::cout << "Error opening directory";
	}
	
	while (dir.has_next)
	{
		tinydir_file file;
		// get the file
		if (tinydir_readfile(&dir, &file) == -1)
		{
			std::cout << "Error getting file";
		}
		
		if (file.is_dir)
		{
			// prevent bad things from happening
			if ( strcmp(file.name, ".") != 0 && strcmp(file.name, "..") != 0 )
			{
				// look one directory deeper and append the directory to the filename
				std::vector <std::string> returnedVector = findXML(file.name);
				for( unsigned j = 0; j<returnedVector.size();j++)
				{
					//output.push_back( file.name  + "/" + returnedVector.at(j) );
					output.push_back( file.name + std::string("/") + returnedVector.at(j) );
				}
			}
		}
		else
		{
			// print the file's name
			s = file.name;
			// don't include the format file
			if ( (s.find(".xml",0) != -1 || s.find(".XML",0) != -1) && (s.find("format") == -1) )
			{
				output.push_back( file.name );
			}
		}
		// next one
		tinydir_next(&dir);
	}
	return output;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2310, %rsp           # imm = 0x2310
movq %rdi, -0x22c0(%rbp)
movq %rdi, %rax
movq %rax, -0x22d0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x22c8(%rbp)
leaq -0x1058(%rbp), %rdi
callq 0x3390
movq -0x22c0(%rbp), %rdi
movb $0x0, -0x1059(%rbp)
callq 0x5630
movq -0x18(%rbp), %rsi
leaq -0x1038(%rbp), %rdi
callq 0x5120
movl %eax, -0x22b8(%rbp)
jmp 0x4cda
movl -0x22b8(%rbp), %eax
cmpl $-0x1, %eax
jne 0x4d13
movq 0xd2dc(%rip), %rdi      # 0x11fc8
leaq 0x756a(%rip), %rsi      # 0xc25d
callq 0x3280
jmp 0x4cfa
jmp 0x4d13
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1068(%rbp)
movl %eax, -0x106c(%rbp)
jmp 0x50f9
jmp 0x4d15
cmpl $0x0, -0x38(%rbp)
je 0x50c1
leaq -0x1038(%rbp), %rdi
leaq -0x2208(%rbp), %rsi
callq 0x5260
movl %eax, -0x22d4(%rbp)
jmp 0x4d3a
movl -0x22d4(%rbp), %eax
cmpl $-0x1, %eax
jne 0x4d5c
movq 0xd27c(%rip), %rdi      # 0x11fc8
leaq 0x7522(%rip), %rsi      # 0xc275
callq 0x3280
jmp 0x4d5a
jmp 0x4d5c
cmpl $0x0, -0x1108(%rbp)
je 0x4f8c
leaq -0x2208(%rbp), %rdi
addq $0x1000, %rdi           # imm = 0x1000
leaq 0x750b(%rip), %rsi      # 0xc289
callq 0x33a0
cmpl $0x0, %eax
je 0x4f87
leaq -0x2208(%rbp), %rdi
addq $0x1000, %rdi           # imm = 0x1000
leaq 0x74e7(%rip), %rsi      # 0xc288
callq 0x33a0
cmpl $0x0, %eax
je 0x4f87
movq -0x22c8(%rbp), %rsi
leaq -0x1208(%rbp), %rdx
leaq -0x2220(%rbp), %rdi
callq 0x4c70
jmp 0x4dcb
movl $0x0, -0x2224(%rbp)
movl -0x2224(%rbp), %eax
movq %rax, -0x22e0(%rbp)
leaq -0x2220(%rbp), %rdi
callq 0x56e0
movq %rax, %rcx
movq -0x22e0(%rbp), %rax
cmpq %rcx, %rax
jae 0x4f7b
leaq -0x1208(%rbp), %rax
movq %rax, -0x22f0(%rbp)
leaq -0x2289(%rbp), %rdi
movq %rdi, -0x22e8(%rbp)
callq 0x34b0
movq -0x22e8(%rbp), %rdx
leaq 0x7402(%rip), %rsi      # 0xc232
leaq -0x2288(%rbp), %rdi
callq 0x5570
jmp 0x4e3e
movq -0x22f0(%rbp), %rsi
leaq -0x2268(%rbp), %rdi
leaq -0x2288(%rbp), %rdx
callq 0x6190
jmp 0x4e5a
movl -0x2224(%rbp), %eax
movl %eax, %esi
leaq -0x2220(%rbp), %rdi
callq 0x5830
movq %rax, -0x22f8(%rbp)
jmp 0x4e77
movq -0x22f8(%rbp), %rdx
leaq -0x2248(%rbp), %rdi
leaq -0x2268(%rbp), %rsi
callq 0x6140
jmp 0x4e93
movq -0x22c0(%rbp), %rdi
leaq -0x2248(%rbp), %rsi
callq 0x6110
jmp 0x4ea8
leaq -0x2248(%rbp), %rdi
callq 0x3180
leaq -0x2268(%rbp), %rdi
callq 0x3180
leaq -0x2288(%rbp), %rdi
callq 0x3180
leaq -0x2289(%rbp), %rdi
callq 0x32d0
movl -0x2224(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2224(%rbp)
jmp 0x4dd5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1068(%rbp)
movl %eax, -0x106c(%rbp)
jmp 0x4f5e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1068(%rbp)
movl %eax, -0x106c(%rbp)
jmp 0x4f52
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1068(%rbp)
movl %eax, -0x106c(%rbp)
jmp 0x4f46
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1068(%rbp)
movl %eax, -0x106c(%rbp)
leaq -0x2248(%rbp), %rdi
callq 0x3180
leaq -0x2268(%rbp), %rdi
callq 0x3180
leaq -0x2288(%rbp), %rdi
callq 0x3180
leaq -0x2289(%rbp), %rdi
callq 0x32d0
leaq -0x2220(%rbp), %rdi
callq 0x5680
jmp 0x50f9
leaq -0x2220(%rbp), %rdi
callq 0x5680
jmp 0x50ae
leaq -0x1208(%rbp), %rsi
leaq -0x1058(%rbp), %rdi
callq 0x3380
jmp 0x4fa1
leaq -0x1058(%rbp), %rdi
leaq 0x72dc(%rip), %rsi      # 0xc28b
xorl %eax, %eax
movl %eax, %edx
callq 0x3540
cmpq $-0x1, %rax
jne 0x4fdf
leaq -0x1058(%rbp), %rdi
leaq 0x72c4(%rip), %rsi      # 0xc290
xorl %eax, %eax
movl %eax, %edx
callq 0x3540
cmpq $-0x1, %rax
je 0x50ac
leaq -0x1058(%rbp), %rdi
leaq 0x72a8(%rip), %rsi      # 0xc295
xorl %eax, %eax
movl %eax, %edx
callq 0x3540
cmpq $-0x1, %rax
jne 0x50ac
leaq -0x1208(%rbp), %rax
movq %rax, -0x2308(%rbp)
leaq -0x22b1(%rbp), %rdi
movq %rdi, -0x2300(%rbp)
callq 0x34b0
movq -0x2308(%rbp), %rsi
movq -0x2300(%rbp), %rdx
leaq -0x22b0(%rbp), %rdi
callq 0x5570
jmp 0x503d
movq -0x22c0(%rbp), %rdi
leaq -0x22b0(%rbp), %rsi
callq 0x6110
jmp 0x5052
leaq -0x22b0(%rbp), %rdi
callq 0x3180
leaq -0x22b1(%rbp), %rdi
callq 0x32d0
jmp 0x50ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1068(%rbp)
movl %eax, -0x106c(%rbp)
jmp 0x509e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1068(%rbp)
movl %eax, -0x106c(%rbp)
leaq -0x22b0(%rbp), %rdi
callq 0x3180
leaq -0x22b1(%rbp), %rdi
callq 0x32d0
jmp 0x50f9
jmp 0x50ae
leaq -0x1038(%rbp), %rdi
callq 0x5410
jmp 0x50bc
jmp 0x4d15
movb $0x1, -0x1059(%rbp)
testb $0x1, -0x1059(%rbp)
jne 0x50dd
movq -0x22c0(%rbp), %rdi
callq 0x5680
leaq -0x1058(%rbp), %rdi
callq 0x3180
movq -0x22d0(%rbp), %rax
addq $0x2310, %rsp           # imm = 0x2310
popq %rbp
retq
movq -0x22c0(%rbp), %rdi
callq 0x5680
leaq -0x1058(%rbp), %rdi
callq 0x3180
movq -0x1068(%rbp), %rdi
callq 0x34a0
nopl (%rax)