// File: /workspace/github_cpp_makefile_star2_O2/ncbi[P]amr/common.cpp
// Function: Common_sp::which(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string which (const string &progName)
{
  ASSERT (! progName. empty ());

  const List<string> paths (str2list (getEnv ("PATH"), ':'));
  for (const string& path : paths)
    if (   ! path. empty () 
        && fileExists (path + "/" + progName)
       )
      return path + "/";

  return noString;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rsi, %r14
movq %rdi, %rbx
callq 0xb060
andl $0x0, (%rax)
movq %r14, 0x10(%rsp)
cmpq $0x0, 0x8(%r14)
je 0x286a8
leaq 0x33340(%rip), %rsi     # 0x5b8f3
leaq 0x18(%rsp), %rdi
leaq 0x78(%rsp), %rdx
callq 0x1b7b6
leaq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x3c19a
movq %rbx, 0x8(%rsp)
leaq 0x58(%rsp), %r14
leaq 0x38(%rsp), %rsi
pushq $0x3a
popq %rdx
movq %r14, %rdi
callq 0x24e10
leaq 0x38(%rsp), %r12
movq %r12, %rdi
callq 0xbb68
leaq 0x18(%rsp), %r13
movq %r13, %rdi
callq 0xbb68
movq %r14, %r15
movq (%r15), %r15
cmpq %r14, %r15
je 0x28675
cmpq $0x0, 0x18(%r15)
je 0x28608
leaq 0x10(%r15), %rbx
movq %r13, %rdi
movq %rbx, %rsi
leaq 0x33cb3(%rip), %rdx     # 0x5c2db
callq 0x1c88d
movq %r12, %rdi
movq %r13, %rsi
movq 0x10(%rsp), %rdx
callq 0x1cbaf
movq %r12, %rdi
callq 0x24f27
movl %eax, %ebp
movq %r12, %rdi
callq 0xbb68
movq %r13, %rdi
callq 0xbb68
testb %bpl, %bpl
je 0x28608
leaq 0x33c78(%rip), %rdx     # 0x5c2db
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %rdi, %rbx
callq 0x1c88d
jmp 0x28689
leaq 0x5c47c(%rip), %rsi     # 0x84af8
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xb7b0
leaq 0x58(%rsp), %rdi
callq 0x1e654
movq %rbx, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xb6c0
testl %eax, %eax
jne 0x2877c
leaq 0x33285(%rip), %rsi     # 0x5b941
leaq 0xf8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x1b7b6
leaq 0xd8(%rsp), %rdi
movl $0x6cb, %esi            # imm = 0x6CB
callq 0x1caa3
leaq 0x78(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
leaq 0xd8(%rsp), %rdx
callq 0x1ca3c
leaq 0x314e2(%rip), %rdx     # 0x59be3
leaq 0x58(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x1b92d
leaq 0x33a75(%rip), %rsi     # 0x5c18c
leaq 0x98(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x1b7b6
leaq 0x3320e(%rip), %rdx     # 0x5b93e
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x1b92d
leaq 0x18(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
callq 0x1ca3c
leaq 0x33a51(%rip), %rdx     # 0x5c1b4
leaq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x1b92d
leaq 0x38(%rsp), %rdi
callq 0x224fc
pushq $0x1
popq %rdi
callq 0xb6d0
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0xbb68
jmp 0x28796
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0xbb68
jmp 0x287a5
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0xbb68
jmp 0x287b7
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0xbb68
jmp 0x287c9
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0xbb68
jmp 0x287d8
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0xbb68
jmp 0x287e7
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0xbb68
jmp 0x287f9
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
jmp 0x28820
jmp 0x28827
jmp 0x2884a
jmp 0x2884a
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0xbb68
jmp 0x2881b
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0xbb68
jmp 0x28857
movq %rax, %rbx
jmp 0x28857
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0xbb68
jmp 0x2883e
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0xbb68
jmp 0x2884d
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x1e654
movq %rbx, %rdi
callq 0xba30
nop