// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmergo/KmerGO_io.h
// Function: getFiles(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, bool)
inline void getFiles(std::string path, std::vector<std::string>& files, bool absolute_path)
{
	char path_str[1024];
	strcpy(path_str, path.c_str());
	files.clear();

#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
	char path_buf[1024] = "";	// absolute path

	/* get real path */
	_fullpath(path_buf, path_str, 1024);
	if (path_buf[strlen(path_buf) - 1] != '\\')
	{
		path_buf[strlen(path_buf)] = '\\';
		path_buf[strlen(path_buf) + 1] = '\0';
	}
	/* get files */
	std::string p;
	int64 hFile = 0;
	struct _finddata_t fileinfo;
	if ((hFile = _findfirst(p.assign(std::string(path_buf)).append("*").c_str(), &fileinfo)) != -1) {
		do
		{
			if (fileinfo.name[0] == '.') continue;
			if (absolute_path == true) files.push_back(p.assign(std::string(path_buf)).append(fileinfo.name));
			else files.push_back(fileinfo.name);
		} while (_findnext(hFile, &fileinfo) == 0);
		_findclose(hFile);
	}
#elif defined(__linux__) || defined(linux)
	/* get files */
	DIR* dp;
	struct dirent* dirp;
	if ((dp = opendir(path_str)) != NULL)
	{
		while ((dirp = readdir(dp)) != NULL) {
			if (dirp->d_name[0] == '.') continue;
			if (absolute_path == true) files.push_back(joinPath(path_str, dirp->d_name));
			else files.push_back(dirp->d_name);
		}
	}
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x478, %rsp            # imm = 0x478
movl %edx, 0xc(%rsp)
movq %rsi, %r14
movq (%rdi), %rsi
leaq 0x70(%rsp), %r15
movq %r15, %rdi
callq 0x4010a8
movq (%r14), %rsi
movq %r14, %rdi
callq 0x407c88
movq %r15, %rdi
callq 0x54dde0
testq %rax, %rax
je 0x407a39
movq %rax, %r15
movq %rax, %rdi
callq 0x54e040
testq %rax, %rax
je 0x407a39
movq %rax, %r13
leaq 0x20(%rsp), %rbp
leaq 0x10(%rsp), %r12
cmpb $0x2e, 0x13(%r13)
je 0x407a25
addq $0x13, %r13
cmpb $0x0, 0xc(%rsp)
je 0x4079e7
movq %rbp, %rbx
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x70(%rsp), %rbp
movq %rbp, %rdi
callq 0x401140
leaq (%rsp,%rax), %rdx
addq $0x70, %rdx
leaq 0x30(%rsp), %rdi
movq %rbp, %rsi
callq 0x408096
leaq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
movq %r13, %rdi
callq 0x401140
leaq (%rax,%r13), %rdx
leaq 0x50(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0x408096
movq %r12, %rdi
leaq 0x30(%rsp), %rsi
movq %rbp, %rdx
callq 0x407aca
movq %rbx, %rbp
movq %r14, %rdi
movq %r12, %rsi
callq 0x407d24
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x4079b5
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x4079d1
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x407a25
movq 0x40(%rsp), %rsi
jmp 0x407a1d
movq %rbp, 0x10(%rsp)
movq %r13, %rdi
callq 0x401140
leaq (%rax,%r13), %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0x408096
movq %r14, %rdi
movq %r12, %rsi
callq 0x407d24
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x407a25
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq %r15, %rdi
callq 0x54e040
movq %rax, %r13
testq %rax, %rax
jne 0x407911
addq $0x478, %rsp            # imm = 0x478
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x407ac2
movq 0x20(%rsp), %rsi
jmp 0x407ab5
jmp 0x407abf
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x407a80
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x41ae90
jmp 0x407a80
movq %rax, %rbx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x407aa1
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x41ae90
jmp 0x407aa1
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x407ac2
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x41ae90
jmp 0x407ac2
movq %rax, %rbx
movq %rbx, %rdi
callq 0x4bfce0