// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa0, %rsp
movq %rdx, %rbx
leal 0x2(%rsi), %ebp
movslq %ebp, %rcx
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %rcx, %rdx
jbe 0x50f87
movq %rdi, %r14
movslq %esi, %rcx
shlq $0x5, %rcx
leaq 0x90(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x20(%rax,%rcx), %rsi
movq 0x28(%rax,%rcx), %rdx
addq %rsi, %rdx
leaq 0x80(%rsp), %r15
movq %r15, %rdi
callq 0x3f8e0
cmpq $0xb, 0x8(%r15)
jae 0x50f8e
xorl %ebx, %ebx
jmp 0x51037
xorl %ebx, %ebx
jmp 0x51054
leaq 0x60(%rsp), %rdi
leaq 0x80(%rsp), %rsi
movl $0x7, %ecx
xorl %edx, %edx
callq 0x408d0
leaq 0x2ee04(%rip), %rsi     # 0x7fdb2
leaq 0x60(%rsp), %rdi
callq 0x3f590
testl %eax, %eax
jne 0x5101a
leaq 0x80(%rsp), %rsi
movq 0x8(%rsi), %rdx
addq $-0x4, %rdx
movq %rsp, %rdi
movq $-0x1, %rcx
callq 0x408d0
leaq 0x60(%rsp), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0x40db0
movq (%r15), %rdi
leaq 0x10(%rsp), %r15
cmpq %r15, %rdi
je 0x51005
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x40880
leaq 0x2edb4(%rip), %rsi     # 0x7fdc0
leaq 0x60(%rsp), %rdi
callq 0x3f590
testl %eax, %eax
je 0x51066
xorl %ebx, %ebx
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x51037
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x40880
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x51054
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x40880
movl %ebx, %eax
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rsp, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x41e40
movq %rsp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x40db0
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x51096
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x40880
xorl %eax, %eax
movq %rax, 0x30(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq %rax, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movq %rsp, %rdi
movq %r15, (%rdi)
leaq 0x2ecfe(%rip), %rsi     # 0x7fdba
leaq 0x2ed01(%rip), %rdx     # 0x7fdc4
callq 0x3f8a0
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
movq %rbx, %rdx
movl $0x1, %ecx
callq 0x422d0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x510f3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x40880
movq 0x28(%rsp), %rax
subq 0x20(%rsp), %rax
cmpq $0x20, %rax
jne 0x5115c
movq %rsp, %rdi
movq %r15, (%rdi)
leaq 0x2ecb5(%rip), %rsi     # 0x7fdc5
leaq 0x2ecb4(%rip), %rdx     # 0x7fdcb
callq 0x3f8a0
movq 0x20(%rsp), %rdx
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
movl $0x1, %ecx
callq 0x422d0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x51149
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x40880
movq 0x48(%rsp), %rax
subq 0x40(%rsp), %rax
cmpq $0x20, %rax
sete %bl
jmp 0x5115e
xorl %ebx, %ebx
leaq 0x40(%rsp), %rdi
callq 0x400a0
leaq 0x20(%rsp), %rdi
callq 0x400a0
jmp 0x5101c
jmp 0x5117b
jmp 0x51196
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x51199
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x40880
jmp 0x51199
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x400a0
leaq 0x20(%rsp), %rdi
callq 0x400a0
jmp 0x511b4
jmp 0x511b1
movq %rax, %rbx
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x511d4
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x40880
jmp 0x511d4
movq %rax, %rbx
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x511f1
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x40880
movq %rbx, %rdi
callq 0x41f10
nop