// File: ncbi[P]amr/common.cpp
// Function: Common_sp::ShellApplication::exec2str(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
string ShellApplication::exec2str (const string &cmd,
                                   const string &tmpName,
                                   const string &logFName) const
{
  ASSERT (! tmp. empty ());
  ASSERT (! contains (tmpName, ' '));
  const string out (tmp + "/" + tmpName);
  exec (cmd + " > " + out, logFName);
  const StringVector vec (out, (size_t) 1, false);
  if (vec. size () != 1)
    throw runtime_error (cmd + "\nOne line is expected");
  return vec [0];  
}

// Assembly:
subq $0x378, %rsp            # imm = 0x378
movq %rdi, 0x40(%rsp)
movq %rdi, %rax
movq %rax, 0x48(%rsp)
movq %rdi, 0x370(%rsp)
movq %rsi, 0x368(%rsp)
movq %rdx, 0x360(%rsp)
movq %rcx, 0x358(%rsp)
movq %r8, 0x350(%rsp)
movq 0x368(%rsp), %rax
movq %rax, 0x50(%rsp)
callq 0xc090
movq 0x50(%rsp), %rdi
movl $0x0, (%rax)
addq $0x168, %rdi            # imm = 0x168
callq 0xcc10
testb $0x1, %al
jne 0x7195e
jmp 0x71be5
callq 0xc8c0
cmpl $0x0, %eax
jne 0x71bdb
leaq 0x2af(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0xcd00
movq 0x38(%rsp), %rdx
leaq 0x5c08f(%rip), %rsi     # 0xcda19
leaq 0x2b0(%rsp), %rdi
callq 0x29fd0
jmp 0x71999
leaq 0x278(%rsp), %rdi
movl $0x1128, %esi           # imm = 0x1128
callq 0x2ded0
jmp 0x719ad
leaq 0x2d0(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
leaq 0x278(%rsp), %rdx
callq 0x2dde0
jmp 0x719cc
leaq 0x5a1ce(%rip), %rdx     # 0xcbba1
leaq 0x2f0(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
callq 0x2a2f0
jmp 0x719ea
leaq 0x237(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0xcd00
movq 0x30(%rsp), %rdx
leaq 0x5e3af(%rip), %rsi     # 0xcfdb7
leaq 0x238(%rsp), %rdi
callq 0x29fd0
jmp 0x71a17
leaq 0x5bff8(%rip), %rdx     # 0xcda16
leaq 0x258(%rsp), %rdi
leaq 0x238(%rsp), %rsi
callq 0x2a2f0
jmp 0x71a35
leaq 0x310(%rsp), %rdi
leaq 0x2f0(%rsp), %rsi
leaq 0x258(%rsp), %rdx
callq 0x2dde0
jmp 0x71a54
leaq 0x5e3bf(%rip), %rdx     # 0xcfe1a
leaq 0x330(%rsp), %rdi
leaq 0x310(%rsp), %rsi
callq 0x2a2f0
jmp 0x71a72
leaq 0x330(%rsp), %rdi
callq 0x3e9b0
jmp 0x71a81
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x71bc9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x71bbc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x71baf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x71ba2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x71b88
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x71b7b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x71b6e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x71b61
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
leaq 0x330(%rsp), %rdi
callq 0xce98
leaq 0x310(%rsp), %rdi
callq 0xce98
leaq 0x258(%rsp), %rdi
callq 0xce98
leaq 0x238(%rsp), %rdi
callq 0xce98
leaq 0x237(%rsp), %rdi
callq 0xc7a0
leaq 0x2f0(%rsp), %rdi
callq 0xce98
leaq 0x2d0(%rsp), %rdi
callq 0xce98
leaq 0x278(%rsp), %rdi
callq 0xce98
leaq 0x2b0(%rsp), %rdi
callq 0xce98
leaq 0x2af(%rsp), %rdi
callq 0xc7a0
jmp 0x72134
movl $0x1, %edi
callq 0xc8d0
callq 0xc090
movl $0x0, (%rax)
movq 0x358(%rsp), %rdi
movl $0x20, %esi
callq 0x2dbd0
testb $0x1, %al
jne 0x71c0b
jmp 0x71e92
callq 0xc8c0
cmpl $0x0, %eax
jne 0x71e88
leaq 0x18f(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0xcd00
movq 0x28(%rsp), %rdx
leaq 0x5bde2(%rip), %rsi     # 0xcda19
leaq 0x190(%rsp), %rdi
callq 0x29fd0
jmp 0x71c46
leaq 0x168(%rsp), %rdi
movl $0x1129, %esi           # imm = 0x1129
callq 0x2ded0
jmp 0x71c5a
leaq 0x1b0(%rsp), %rdi
leaq 0x190(%rsp), %rsi
leaq 0x168(%rsp), %rdx
callq 0x2dde0
jmp 0x71c79
leaq 0x59f21(%rip), %rdx     # 0xcbba1
leaq 0x1d0(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
callq 0x2a2f0
jmp 0x71c97
leaq 0x127(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xcd00
movq 0x20(%rsp), %rdx
leaq 0x5e102(%rip), %rsi     # 0xcfdb7
leaq 0x128(%rsp), %rdi
callq 0x29fd0
jmp 0x71cc4
leaq 0x5bd4b(%rip), %rdx     # 0xcda16
leaq 0x148(%rsp), %rdi
leaq 0x128(%rsp), %rsi
callq 0x2a2f0
jmp 0x71ce2
leaq 0x1f0(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
leaq 0x148(%rsp), %rdx
callq 0x2dde0
jmp 0x71d01
leaq 0x5e122(%rip), %rdx     # 0xcfe2a
leaq 0x210(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
callq 0x2a2f0
jmp 0x71d1f
leaq 0x210(%rsp), %rdi
callq 0x3e9b0
jmp 0x71d2e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x71e76
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x71e69
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x71e5c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x71e4f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x71e35
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x71e28
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x71e1b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x71e0e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
leaq 0x210(%rsp), %rdi
callq 0xce98
leaq 0x1f0(%rsp), %rdi
callq 0xce98
leaq 0x148(%rsp), %rdi
callq 0xce98
leaq 0x128(%rsp), %rdi
callq 0xce98
leaq 0x127(%rsp), %rdi
callq 0xc7a0
leaq 0x1d0(%rsp), %rdi
callq 0xce98
leaq 0x1b0(%rsp), %rdi
callq 0xce98
leaq 0x168(%rsp), %rdi
callq 0xce98
leaq 0x190(%rsp), %rdi
callq 0xce98
leaq 0x18f(%rsp), %rdi
callq 0xc7a0
jmp 0x72134
movl $0x1, %edi
callq 0xc8d0
movq 0x50(%rsp), %rsi
addq $0x168, %rsi            # imm = 0x168
leaq 0x5c559(%rip), %rdx     # 0xce3fe
leaq 0xe0(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x2d9a0
movq 0x18(%rsp), %rsi
movq 0x358(%rsp), %rdx
leaq 0x100(%rsp), %rdi
callq 0x2e220
jmp 0x71ed3
leaq 0xe0(%rsp), %rdi
callq 0xce98
movq 0x360(%rsp), %rsi
leaq 0x5ad03(%rip), %rdx     # 0xccbf2
leaq 0xa0(%rsp), %rdi
callq 0x2d9a0
jmp 0x71efe
leaq 0xc0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
leaq 0x100(%rsp), %rdx
callq 0x2e220
jmp 0x71f1d
movq 0x350(%rsp), %rsi
leaq 0xc0(%rsp), %rdi
callq 0x4a960
jmp 0x71f34
leaq 0xc0(%rsp), %rdi
callq 0xce98
leaq 0xa0(%rsp), %rdi
callq 0xce98
leaq 0x80(%rsp), %rdi
leaq 0x100(%rsp), %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x4d940
jmp 0x71f6c
leaq 0x80(%rsp), %rdi
callq 0x2f390
cmpq $0x1, %rax
je 0x720b6
movb $0x1, 0x5f(%rsp)
movl $0x10, %edi
callq 0xc3b0
movq %rax, 0x10(%rsp)
movq 0x360(%rsp), %rsi
leaq 0x5de9e(%rip), %rdx     # 0xcfe44
leaq 0x60(%rsp), %rdi
callq 0x2d9a0
jmp 0x71fb2
movq 0x10(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xcbb0
jmp 0x71fc3
movq 0x10(%rsp), %rdi
movb $0x0, 0x5f(%rsp)
movq 0x9401c(%rip), %rsi     # 0x105ff0
movq 0x93f95(%rip), %rdx     # 0x105f70
callq 0xcc80
jmp 0x72141
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0xce98
jmp 0x72134
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x72127
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x7205b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0xce98
leaq 0xa0(%rsp), %rdi
callq 0xce98
jmp 0x72127
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x720a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
leaq 0x60(%rsp), %rdi
callq 0xce98
testb $0x1, 0x5f(%rsp)
jne 0x720aa
jmp 0x720b4
movq 0x10(%rsp), %rdi
callq 0xc580
jmp 0x7211a
xorl %eax, %eax
movl %eax, %esi
leaq 0x80(%rsp), %rdi
callq 0x2f4e0
movq %rax, 0x8(%rsp)
jmp 0x720ce
movq 0x8(%rsp), %rsi
movq 0x40(%rsp), %rdi
callq 0xc320
jmp 0x720df
leaq 0x80(%rsp), %rdi
callq 0x2eef0
leaq 0x100(%rsp), %rdi
callq 0xce98
movq 0x48(%rsp), %rax
addq $0x378, %rsp            # imm = 0x378
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x2eef0
leaq 0x100(%rsp), %rdi
callq 0xce98
movq 0x2a0(%rsp), %rdi
callq 0xccf0
nopw %cs:(%rax,%rax)