// File: jstaursky[P]hutch/src/Sleigh/filemanage.cc
// Function: FileManage::testDevelopmentPath(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>>>> const&, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool FileManage::testDevelopmentPath(const vector<string> &pathels,int level,string &root)

{ // Given pathels[level] is "Ghidra", determine if this is a Ghidra development layout
  if (level + 2 >= pathels.size()) return false;
  string parent = pathels[level + 1];
  if (parent.size() < 11) return false;
  string piecestr = parent.substr(0,7);
  if (piecestr != "ghidra.") return false;
  piecestr = parent.substr(parent.size() - 4);
  if (piecestr != ".git") return false;
  root = buildPath(pathels,level+2);
  vector<string> testpaths1;
  vector<string> testpaths2;
  scanDirectoryRecursive(testpaths1,"ghidra.git",root,1);
  if (testpaths1.size() != 1) return false;
  scanDirectoryRecursive(testpaths2,"Ghidra",testpaths1[0],1);
  return (testpaths2.size() == 1);
}

// Assembly:
subq $0x188, %rsp            # imm = 0x188
movq %rdi, 0x178(%rsp)
movl %esi, 0x174(%rsp)
movq %rdx, 0x168(%rsp)
movl 0x174(%rsp), %eax
addl $0x2, %eax
cltq
movq %rax, 0x48(%rsp)
movq 0x178(%rsp), %rdi
callq 0xe1670
movq %rax, %rcx
movq 0x48(%rsp), %rax
cmpq %rcx, %rax
jb 0x10acb6
movb $0x0, 0x187(%rsp)
jmp 0x10b0aa
movq 0x178(%rsp), %rdi
movl 0x174(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0xda3d0
movq %rax, %rsi
leaq 0x148(%rsp), %rdi
callq 0xd2230
leaq 0x148(%rsp), %rdi
callq 0xd5290
cmpq $0xb, %rax
jae 0x10ad0b
movb $0x0, 0x187(%rsp)
movl $0x1, 0x144(%rsp)
jmp 0x10b08c
xorl %eax, %eax
movl %eax, %edx
leaq 0x120(%rsp), %rdi
leaq 0x148(%rsp), %rsi
movl $0x7, %ecx
callq 0xd8920
jmp 0x10ad2b
leaq 0x7d07c(%rip), %rsi     # 0x187dae
leaq 0x120(%rsp), %rdi
callq 0xd6530
movb %al, 0x47(%rsp)
jmp 0x10ad45
movb 0x47(%rsp), %al
testb $0x1, %al
jne 0x10ad4f
jmp 0x10ad99
movb $0x0, 0x187(%rsp)
movl $0x1, 0x144(%rsp)
jmp 0x10b06e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
jmp 0x10b09b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
jmp 0x10b07d
leaq 0x148(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0xd5290
movq 0x38(%rsp), %rsi
movq %rax, %rdx
addq $-0x4, %rdx
leaq 0xf0(%rsp), %rdi
movq $-0x1, %rcx
callq 0xd8920
jmp 0x10adcd
leaq 0x120(%rsp), %rdi
movq %rdi, 0x28(%rsp)
leaq 0xf0(%rsp), %rsi
movq %rsi, 0x20(%rsp)
callq 0xda960
movq 0x20(%rsp), %rdi
callq 0xd4550
movq 0x28(%rsp), %rdi
leaq 0x7cfba(%rip), %rsi     # 0x187dbc
callq 0xd6530
movb %al, 0x37(%rsp)
jmp 0x10ae0d
movb 0x37(%rsp), %al
testb $0x1, %al
jne 0x10ae17
jmp 0x10ae2f
movb $0x0, 0x187(%rsp)
movl $0x1, 0x144(%rsp)
jmp 0x10b06e
movq 0x178(%rsp), %rsi
movl 0x174(%rsp), %edx
addl $0x2, %edx
leaq 0xd0(%rsp), %rdi
callq 0xe06b0
jmp 0x10ae50
movq 0x168(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
movq %rsi, 0x10(%rsp)
callq 0xda960
movq 0x10(%rsp), %rdi
callq 0xd4550
leaq 0xb8(%rsp), %rdi
callq 0xe0e60
leaq 0xa0(%rsp), %rdi
callq 0xe0e60
leaq 0x7f(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xe0c80
movq 0x18(%rsp), %rdx
leaq 0x7cf0d(%rip), %rsi     # 0x187db6
leaq 0x80(%rsp), %rdi
callq 0xe00a0
jmp 0x10aeb8
movq 0x168(%rsp), %rdx
leaq 0xb8(%rsp), %rdi
leaq 0x80(%rsp), %rsi
movl $0x1, %ecx
callq 0xe23f0
jmp 0x10aedc
leaq 0x80(%rsp), %rdi
callq 0xd4550
leaq 0x7f(%rsp), %rdi
callq 0xd8ec0
leaq 0xb8(%rsp), %rdi
callq 0xe1670
cmpq $0x1, %rax
je 0x10af64
movb $0x0, 0x187(%rsp)
movl $0x1, 0x144(%rsp)
jmp 0x10b036
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
jmp 0x10af55
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
leaq 0x80(%rsp), %rdi
callq 0xd4550
leaq 0x7f(%rsp), %rdi
callq 0xd8ec0
jmp 0x10b052
leaq 0x57(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xe0c80
movq 0x8(%rsp), %rdx
leaq 0x7ce42(%rip), %rsi     # 0x187dc1
leaq 0x58(%rsp), %rdi
callq 0xe00a0
jmp 0x10af8b
xorl %eax, %eax
movl %eax, %esi
leaq 0xb8(%rsp), %rdi
callq 0xe1770
movq %rax, %rdx
leaq 0xa0(%rsp), %rdi
leaq 0x58(%rsp), %rsi
movl $0x1, %ecx
callq 0xe23f0
jmp 0x10afb8
leaq 0x58(%rsp), %rdi
callq 0xd4550
leaq 0x57(%rsp), %rdi
callq 0xd8ec0
leaq 0xa0(%rsp), %rdi
callq 0xe1670
cmpq $0x1, %rax
sete %al
andb $0x1, %al
movb %al, 0x187(%rsp)
movl $0x1, 0x144(%rsp)
jmp 0x10b036
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
jmp 0x10b02a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
leaq 0x58(%rsp), %rdi
callq 0xd4550
leaq 0x57(%rsp), %rdi
callq 0xd8ec0
jmp 0x10b052
leaq 0xa0(%rsp), %rdi
callq 0xd5480
leaq 0xb8(%rsp), %rdi
callq 0xd5480
jmp 0x10b06e
leaq 0xa0(%rsp), %rdi
callq 0xd5480
leaq 0xb8(%rsp), %rdi
callq 0xd5480
jmp 0x10b07d
leaq 0x120(%rsp), %rdi
callq 0xd4550
jmp 0x10b08c
leaq 0x120(%rsp), %rdi
callq 0xd4550
jmp 0x10b09b
leaq 0x148(%rsp), %rdi
callq 0xd4550
jmp 0x10b0aa
leaq 0x148(%rsp), %rdi
callq 0xd4550
jmp 0x10b0bb
movb 0x187(%rsp), %al
andb $0x1, %al
addq $0x188, %rsp            # imm = 0x188
retq
movq 0x118(%rsp), %rdi
callq 0xe0be0
nopl (%rax,%rax)