// File: /workspace/github_cpp_makefile_star2_O2/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, %ebx
movl %edx, 0xc(%rsp)
movq %rsi, %r14
movq %rdi, 0x10(%rsp)
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %rcx, %rsi
callq 0x50630
movq (%r15), %rdi
movq 0x8(%r15), %rcx
movq 0x516c3(%rip), %rax     # 0xaefc8
movb (%rax), %al
cmpb %al, -0x1(%rdi,%rcx)
je 0x5d91f
movsbl %al, %esi
leaq 0x18(%rsp), %rdi
callq 0x4f090
movq 0x18(%rsp), %rdi
callq 0x50ba0
testq %rax, %rax
je 0x5da07
movq %rax, %r12
movq %rax, %rdi
callq 0x50d70
movq %rax, %rbp
leaq 0x38(%rsp), %r13
leaq 0x58(%rsp), %r15
testq %rbp, %rbp
je 0x5d9ff
addq $0x13, %rbp
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x515e0
movq 0x8(%r14), %rdx
movq 0x40(%rsp), %rsi
subq %rdx, %rsi
jb 0x5d9e7
testb %bl, %bl
jne 0x5d97c
movq 0x38(%rsp), %rax
cmpb $0x2e, (%rax)
je 0x5d9e7
cmpb $0x0, 0xc(%rsp)
je 0x5d9b1
movq %r13, %rdi
movq %r14, %rcx
callq 0x501e0
testl %eax, %eax
jne 0x5d9e7
movq %r15, %rdi
leaq 0x18(%rsp), %rsi
movq %r13, %rdx
callq 0x51f80
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x4dc80
jmp 0x5d9df
movq %r13, %rdi
xorl %esi, %esi
movq %r14, %rcx
callq 0x501e0
testl %eax, %eax
jne 0x5d9e7
movq %r15, %rdi
leaq 0x18(%rsp), %rsi
movq %r13, %rdx
callq 0x51f80
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x4dc80
movq %r15, %rdi
callq 0x4e020
movq %r12, %rdi
callq 0x50d70
movq %rax, %rbp
movq %r13, %rdi
callq 0x4e020
jmp 0x5d945
movq %r12, %rdi
callq 0x510c0
leaq 0x18(%rsp), %rdi
callq 0x4e020
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5da37
jmp 0x5da26
jmp 0x5da3c
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x4e020
jmp 0x5da3f
jmp 0x5da3c
movq %rax, %rbx
jmp 0x5da49
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x4e020
leaq 0x18(%rsp), %rdi
callq 0x4e020
movq %rbx, %rdi
callq 0x518c0
nop