// File: /workspace/github_cpp_makefile_star2_O1/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 0x510b3
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 0x510ba
xorl %ebx, %ebx
jmp 0x51163
xorl %ebx, %ebx
jmp 0x51180
leaq 0x60(%rsp), %rdi
leaq 0x80(%rsp), %rsi
movl $0x7, %ecx
xorl %edx, %edx
callq 0x408c0
leaq 0x2ecd8(%rip), %rsi     # 0x7fdb2
leaq 0x60(%rsp), %rdi
callq 0x3f590
testl %eax, %eax
jne 0x51146
leaq 0x80(%rsp), %rsi
movq 0x8(%rsi), %rdx
addq $-0x4, %rdx
movq %rsp, %rdi
movq $-0x1, %rcx
callq 0x408c0
leaq 0x60(%rsp), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0x40da0
movq (%r15), %rdi
leaq 0x10(%rsp), %r15
cmpq %r15, %rdi
je 0x51131
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x40870
leaq 0x2ec88(%rip), %rsi     # 0x7fdc0
leaq 0x60(%rsp), %rdi
callq 0x3f590
testl %eax, %eax
je 0x51192
xorl %ebx, %ebx
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x51163
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x40870
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x51180
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x40870
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 0x41e30
movq %rsp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x40da0
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x511c2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x40870
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 0x2ebd2(%rip), %rsi     # 0x7fdba
leaq 0x2ebd5(%rip), %rdx     # 0x7fdc4
callq 0x3f8a0
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
movq %rbx, %rdx
movl $0x1, %ecx
callq 0x422c0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x5121f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x40870
movq 0x28(%rsp), %rax
subq 0x20(%rsp), %rax
cmpq $0x20, %rax
jne 0x51288
movq %rsp, %rdi
movq %r15, (%rdi)
leaq 0x2eb89(%rip), %rsi     # 0x7fdc5
leaq 0x2eb88(%rip), %rdx     # 0x7fdcb
callq 0x3f8a0
movq 0x20(%rsp), %rdx
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
movl $0x1, %ecx
callq 0x422c0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x51275
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x40870
movq 0x48(%rsp), %rax
subq 0x40(%rsp), %rax
cmpq $0x20, %rax
sete %bl
jmp 0x5128a
xorl %ebx, %ebx
leaq 0x40(%rsp), %rdi
callq 0x40090
leaq 0x20(%rsp), %rdi
callq 0x40090
jmp 0x51148
jmp 0x512a7
jmp 0x512c2
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x512c5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x40870
jmp 0x512c5
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x40090
leaq 0x20(%rsp), %rdi
callq 0x40090
jmp 0x512e0
jmp 0x512dd
movq %rax, %rbx
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x51300
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x40870
jmp 0x51300
movq %rax, %rbx
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x5131d
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x40870
movq %rbx, %rdi
callq 0x41f00
nop