// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/filemanage.cc
// Function: FileManage::matchListDir(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>>>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool)
void FileManage::matchListDir(vector<string> &res,const string &match,bool isSuffix,const string &dirname,bool allowdot)

{				// Look through files in a directory for those matching -match-
  DIR *dir;
  struct dirent *entry;
  string dirfinal = dirname;
  if (dirfinal[dirfinal.size()-1] != separator)
    dirfinal += separator;

  dir = opendir(dirfinal.c_str());
  if (dir == (DIR *)0) return;
  entry = readdir(dir);
  while(entry != (struct dirent *)0) {
    string fullname(entry->d_name);
    if (match.size() <= fullname.size()) {
      if (allowdot||(fullname[0] != '.')) {
	if (isSuffix) {
	  if (0==fullname.compare( fullname.size()-match.size(),match.size(),match))
	    res.push_back( dirfinal + fullname );
	}
	else {
	  if (0==fullname.compare(0,match.size(),match))
	    res.push_back(dirfinal + fullname);
	}
      }
    }
    entry = readdir(dir);
  }
  closedir(dir);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %r8d, 0xc(%rsp)
movl %edx, 0x8(%rsp)
movq %rsi, %r14
movq %rdi, 0x30(%rsp)
leaq 0x48(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rcx), %rsi
movq 0x8(%rcx), %rdx
addq %rsi, %rdx
leaq 0x38(%rsp), %r15
movq %r15, %rdi
callq 0x3f8e0
movq (%r15), %rcx
movq 0x8(%r15), %rdx
movq 0x5265f(%rip), %rax     # 0xa2fd0
movb (%rax), %al
cmpb %al, -0x1(%rcx,%rdx)
je 0x50986
movsbl %al, %esi
leaq 0x38(%rsp), %rdi
callq 0x40480
movq 0x38(%rsp), %rdi
callq 0x41610
testq %rax, %rax
je 0x50acc
movq %rax, %r12
movq %rax, %rdi
callq 0x41750
movq %rax, %r15
testq %rax, %rax
je 0x50abf
leaq 0x58(%rsp), %r13
leaq 0x10(%rsp), %rbx
leaq 0x13(%r15), %rbp
leaq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
movq %rbp, %rdi
callq 0x3f9e0
leaq (%r15,%rax), %rdx
addq $0x13, %rdx
movq %r13, %rdi
movq %rbp, %rsi
callq 0x3f8a0
movq 0x8(%r14), %rdx
movq 0x60(%rsp), %rsi
subq %rdx, %rsi
jae 0x50a22
movq %r12, %rdi
callq 0x41750
movq %rax, %r15
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x50a18
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x40870
testq %r15, %r15
jne 0x509ba
jmp 0x50abf
cmpb $0x0, 0xc(%rsp)
jne 0x50a33
movq 0x58(%rsp), %rax
cmpb $0x2e, (%rax)
je 0x509f1
cmpb $0x0, 0x8(%rsp)
je 0x50a68
movq %r13, %rdi
movq %r14, %rcx
callq 0x40f40
testl %eax, %eax
jne 0x509f1
movq %rbx, %rdi
leaq 0x38(%rsp), %rsi
movq %r13, %rdx
callq 0x42380
movq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x3f7b0
jmp 0x50a9a
movq %r13, %rdi
xorl %esi, %esi
movq %r14, %rcx
callq 0x40f40
testl %eax, %eax
jne 0x509f1
movq %rbx, %rdi
leaq 0x38(%rsp), %rsi
movq %r13, %rdx
callq 0x42380
movq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x3f7b0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x509f1
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x40870
jmp 0x509f1
movq %r12, %rdi
callq 0x41950
leaq 0x48(%rsp), %rbx
movq 0x38(%rsp), %rdi
cmpq %rbx, %rdi
je 0x50ae3
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x40870
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x50af6
jmp 0x50b20
movq %rax, %r14
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x50b23
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x40870
jmp 0x50b23
jmp 0x50b20
jmp 0x50b1b
movq %rax, %r14
jmp 0x50b3f
movq %rax, %r14
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x50b3f
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x40870
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x50b5b
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x40870
movq %r14, %rdi
callq 0x41f00
nop