// File: 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:
subq $0x228, %rsp            # imm = 0x228
movq %rdi, 0x20(%rsp)
movq %rdi, %rax
movq %rax, 0x28(%rsp)
movq %rdi, 0x220(%rsp)
movq %rsi, 0x218(%rsp)
callq 0xc090
movl $0x0, (%rax)
movq 0x218(%rsp), %rdi
callq 0xcc10
testb $0x1, %al
jne 0x4b195
jmp 0x4b41c
callq 0xc8c0
cmpl $0x0, %eax
jne 0x4b412
leaq 0x177(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xcd00
movq 0x18(%rsp), %rdx
leaq 0x82858(%rip), %rsi     # 0xcda19
leaq 0x178(%rsp), %rdi
callq 0x29fd0
jmp 0x4b1d0
leaq 0x140(%rsp), %rdi
movl $0x6cb, %esi            # imm = 0x6CB
callq 0x2ded0
jmp 0x4b1e4
leaq 0x198(%rsp), %rdi
leaq 0x178(%rsp), %rsi
leaq 0x140(%rsp), %rdx
callq 0x2dde0
jmp 0x4b203
leaq 0x80997(%rip), %rdx     # 0xcbba1
leaq 0x1b8(%rsp), %rdi
leaq 0x198(%rsp), %rsi
callq 0x2a2f0
jmp 0x4b221
leaq 0xff(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xcd00
movq 0x10(%rsp), %rdx
leaq 0x83070(%rip), %rsi     # 0xce2af
leaq 0x100(%rsp), %rdi
callq 0x29fd0
jmp 0x4b24e
leaq 0x827c1(%rip), %rdx     # 0xcda16
leaq 0x120(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x2a2f0
jmp 0x4b26c
leaq 0x1d8(%rsp), %rdi
leaq 0x1b8(%rsp), %rsi
leaq 0x120(%rsp), %rdx
callq 0x2dde0
jmp 0x4b28b
leaq 0x83045(%rip), %rdx     # 0xce2d7
leaq 0x1f8(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
callq 0x2a2f0
jmp 0x4b2a9
leaq 0x1f8(%rsp), %rdi
callq 0x3e9b0
jmp 0x4b2b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x168(%rsp)
movl %eax, 0x164(%rsp)
jmp 0x4b400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x168(%rsp)
movl %eax, 0x164(%rsp)
jmp 0x4b3f3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x168(%rsp)
movl %eax, 0x164(%rsp)
jmp 0x4b3e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x168(%rsp)
movl %eax, 0x164(%rsp)
jmp 0x4b3d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x168(%rsp)
movl %eax, 0x164(%rsp)
jmp 0x4b3bf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x168(%rsp)
movl %eax, 0x164(%rsp)
jmp 0x4b3b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x168(%rsp)
movl %eax, 0x164(%rsp)
jmp 0x4b3a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x168(%rsp)
movl %eax, 0x164(%rsp)
jmp 0x4b398
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x168(%rsp)
movl %eax, 0x164(%rsp)
leaq 0x1f8(%rsp), %rdi
callq 0xce98
leaq 0x1d8(%rsp), %rdi
callq 0xce98
leaq 0x120(%rsp), %rdi
callq 0xce98
leaq 0x100(%rsp), %rdi
callq 0xce98
leaq 0xff(%rsp), %rdi
callq 0xc7a0
leaq 0x1b8(%rsp), %rdi
callq 0xce98
leaq 0x198(%rsp), %rdi
callq 0xce98
leaq 0x140(%rsp), %rdi
callq 0xce98
leaq 0x178(%rsp), %rdi
callq 0xce98
leaq 0x177(%rsp), %rdi
callq 0xc7a0
jmp 0x4b712
movl $0x1, %edi
callq 0xc8d0
leaq 0x9f(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xcd00
movq 0x8(%rsp), %rdx
leaq 0x82591(%rip), %rsi     # 0xcd9cb
leaq 0xa0(%rsp), %rdi
callq 0x29fd0
jmp 0x4b449
leaq 0xc0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x73260
jmp 0x4b460
leaq 0xe0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
movl $0x3a, %edx
callq 0x43d10
jmp 0x4b47c
leaq 0xc0(%rsp), %rdi
callq 0xce98
leaq 0xa0(%rsp), %rdi
callq 0xce98
leaq 0x9f(%rsp), %rdi
callq 0xc7a0
leaq 0xe0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
callq 0x32380
movq %rax, 0x88(%rsp)
movq 0x90(%rsp), %rdi
callq 0x32210
movq %rax, 0x80(%rsp)
leaq 0x88(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x73ca0
testb $0x1, %al
jne 0x4b4fb
jmp 0x4b6d0
leaq 0x88(%rsp), %rdi
callq 0x32260
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rdi
callq 0xcc10
movb %al, %cl
movb $0x0, 0x37(%rsp)
movb $0x0, 0x36(%rsp)
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x7(%rsp)
jne 0x4b583
movq 0x78(%rsp), %rsi
leaq 0x82ec4(%rip), %rdx     # 0xce3fe
leaq 0x38(%rsp), %rdi
callq 0x2d9a0
jmp 0x4b546
movb $0x1, 0x37(%rsp)
movq 0x218(%rsp), %rdx
leaq 0x58(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x2e220
jmp 0x4b564
movb $0x1, 0x36(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x43f20
movb %al, 0x6(%rsp)
jmp 0x4b579
movb 0x6(%rsp), %al
movb %al, 0x7(%rsp)
jmp 0x4b583
movb 0x7(%rsp), %al
movb %al, 0x5(%rsp)
testb $0x1, 0x36(%rsp)
jne 0x4b594
jmp 0x4b59e
leaq 0x58(%rsp), %rdi
callq 0xce98
testb $0x1, 0x37(%rsp)
jne 0x4b5a7
jmp 0x4b5b1
leaq 0x38(%rsp), %rdi
callq 0xce98
movb 0x5(%rsp), %al
testb $0x1, %al
jne 0x4b5be
jmp 0x4b6bc
movq 0x20(%rsp), %rdi
movq 0x78(%rsp), %rsi
leaq 0x82e2f(%rip), %rdx     # 0xce3fe
callq 0x2d9a0
jmp 0x4b5d6
movl $0x1, 0x30(%rsp)
jmp 0x4b6eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x168(%rsp)
movl %eax, 0x164(%rsp)
jmp 0x4b63d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x168(%rsp)
movl %eax, 0x164(%rsp)
jmp 0x4b630
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x168(%rsp)
movl %eax, 0x164(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0xce98
leaq 0xa0(%rsp), %rdi
callq 0xce98
leaq 0x9f(%rsp), %rdi
callq 0xc7a0
jmp 0x4b712
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x168(%rsp)
movl %eax, 0x164(%rsp)
jmp 0x4b705
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x168(%rsp)
movl %eax, 0x164(%rsp)
jmp 0x4b6a7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x168(%rsp)
movl %eax, 0x164(%rsp)
testb $0x1, 0x36(%rsp)
jne 0x4b69b
jmp 0x4b6a5
leaq 0x58(%rsp), %rdi
callq 0xce98
jmp 0x4b6a7
testb $0x1, 0x37(%rsp)
jne 0x4b6b0
jmp 0x4b6ba
leaq 0x38(%rsp), %rdi
callq 0xce98
jmp 0x4b705
jmp 0x4b6be
leaq 0x88(%rsp), %rdi
callq 0x73cc0
jmp 0x4b4dd
movq 0x20(%rsp), %rdi
leaq 0xbb5bc(%rip), %rsi     # 0x106c98
callq 0xc320
jmp 0x4b6e3
movl $0x1, 0x30(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0x32410
movq 0x28(%rsp), %rax
addq $0x228, %rsp            # imm = 0x228
retq
leaq 0xe0(%rsp), %rdi
callq 0x32410
movq 0x168(%rsp), %rdi
callq 0xccf0
nop