// File: ncbi[P]amr/amrfinder_update.cpp
// Function: (anonymous namespace)::getLatestDataVersion(CURL_sp::Curl&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string getLatestDataVersion (Curl &curl,
                             const string &minor)
// Return: empty() <=> failure
{
  StringVector dir (curl. read (URL + minor + "/"), '\n', true);
  if (verbose ())
  {
    save (cout, dir, '\n');
    cout << endl;
  }
    
  Vector<DataVersion> dataVersions;  
  for (string& line : dir)
  #if HTTPS
    if (isLeft (line, "<a href="))
      try
      {
        const size_t pos1 = line. find ('>');
        QC_ASSERT (pos1 != string::npos);
        line. erase (0, pos1 + 1);

        const size_t pos2 = line. find ("/<");
        QC_ASSERT (pos2 != string::npos);
        line. erase (pos2);
        
    	  istringstream iss (line);
  		  DataVersion dv (iss);
  		  dataVersions << std::move (dv);
    	}
  		catch (...) {}
  #else
    if (! contains (line, " -> "))
    {
      trimTrailing (line);
      const size_t pos = line. rfind (' ');
      if (pos != string::npos)
      {
    	  istringstream iss (line. substr (pos + 1));
    	  try 
    	  {
    		  DataVersion dv (iss);
    		  dataVersions << std::move (dv);
    		}
  		  catch (...) {}    		
      }
    }
  #endif
  if (dataVersions. empty ())
    return noString;
    
  dataVersions. sort ();
  return dataVersions. back (). str ();
}

// Assembly:
subq $0x548, %rsp            # imm = 0x548
movq %rdi, 0x48(%rsp)
movq %rdi, %rax
movq %rax, 0x50(%rsp)
movq %rdi, 0x540(%rsp)
movq %rsi, 0x538(%rsp)
movq %rdx, 0x530(%rsp)
movq 0x538(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x530(%rsp), %rdx
leaq 0x83622(%rip), %rsi     # 0x942da
leaq 0x4b0(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0x14bb0
movq 0x60(%rsp), %rsi
leaq 0x87bb7(%rip), %rdx     # 0x9888d
leaq 0x4d0(%rsp), %rdi
callq 0x14610
jmp 0x10ce5
movq 0x58(%rsp), %rsi
leaq 0x4f0(%rsp), %rdi
leaq 0x4d0(%rsp), %rdx
callq 0x92910
jmp 0x10d01
leaq 0x510(%rsp), %rdi
leaq 0x4f0(%rsp), %rsi
movl $0xa, %edx
movl $0x1, %ecx
callq 0x2eb20
jmp 0x10d22
leaq 0x4f0(%rsp), %rdi
callq 0xbe38
leaq 0x4d0(%rsp), %rdi
callq 0xbe38
leaq 0x4b0(%rsp), %rdi
callq 0xbe38
xorl %edi, %edi
callq 0x2b640
movb %al, 0x47(%rsp)
jmp 0x10d56
movb 0x47(%rsp), %al
testb $0x1, %al
jne 0x10d63
jmp 0x10e1d
movq 0xb01e6(%rip), %rdi     # 0xc0f50
leaq 0x510(%rsp), %rsi
movl $0xa, %edx
callq 0x164a0
jmp 0x10d7e
movq 0xb01cb(%rip), %rdi     # 0xc0f50
movq 0xb0224(%rip), %rsi     # 0xc0fb0
callq 0xbbf0
jmp 0x10d93
jmp 0x10e1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x10df2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x10de5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
leaq 0x4f0(%rsp), %rdi
callq 0xbe38
leaq 0x4d0(%rsp), %rdi
callq 0xbe38
leaq 0x4b0(%rsp), %rdi
callq 0xbe38
jmp 0x116b5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x116a8
leaq 0x480(%rsp), %rdi
callq 0x18e10
leaq 0x510(%rsp), %rax
movq %rax, 0x478(%rsp)
movq 0x478(%rsp), %rdi
callq 0x15a20
movq %rax, 0x470(%rsp)
movq 0x478(%rsp), %rdi
callq 0x15a50
movq %rax, 0x468(%rsp)
leaq 0x470(%rsp), %rdi
leaq 0x468(%rsp), %rsi
callq 0x15a80
testb $0x1, %al
jne 0x10e82
jmp 0x11611
leaq 0x470(%rsp), %rdi
callq 0x15ac0
movq %rax, 0x460(%rsp)
movq 0x460(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x43f(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0xbb30
movq 0x38(%rsp), %rdx
leaq 0x8392e(%rip), %rsi     # 0x947f0
leaq 0x440(%rsp), %rdi
callq 0x125d0
jmp 0x10ed1
movq 0x30(%rsp), %rdi
leaq 0x440(%rsp), %rsi
callq 0x15930
movb %al, 0x2f(%rsp)
jmp 0x10ee9
leaq 0x440(%rsp), %rdi
callq 0xbe38
leaq 0x43f(%rsp), %rdi
callq 0xbe10
movb 0x2f(%rsp), %al
testb $0x1, %al
jne 0x10f10
jmp 0x115fd
movq 0x460(%rsp), %rdi
movl $0x3e, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0xbca0
movq %rax, 0x430(%rsp)
callq 0xbbd0
movl $0x0, (%rax)
cmpq $-0x1, 0x430(%rsp)
jne 0x11218
callq 0xb920
cmpl $0x0, %eax
jne 0x1120e
leaq 0x38f(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xbb30
movq 0x20(%rsp), %rdx
leaq 0x83525(%rip), %rsi     # 0x94499
leaq 0x390(%rsp), %rdi
callq 0x125d0
jmp 0x10f83
leaq 0x368(%rsp), %rdi
movl $0x92, %esi
callq 0x14f00
jmp 0x10f97
leaq 0x3b0(%rsp), %rdi
leaq 0x390(%rsp), %rsi
leaq 0x368(%rsp), %rdx
callq 0x14520
jmp 0x10fb6
leaq 0x834fa(%rip), %rdx     # 0x944b7
leaq 0x3d0(%rsp), %rdi
leaq 0x3b0(%rsp), %rsi
callq 0x14610
jmp 0x10fd4
leaq 0x327(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xbb30
movq 0x18(%rsp), %rdx
leaq 0x83883(%rip), %rsi     # 0x94875
leaq 0x328(%rsp), %rdi
callq 0x125d0
jmp 0x11001
leaq 0x8403c(%rip), %rdx     # 0x95044
leaq 0x348(%rsp), %rdi
leaq 0x328(%rsp), %rsi
callq 0x14610
jmp 0x1101f
leaq 0x3f0(%rsp), %rdi
leaq 0x3d0(%rsp), %rsi
leaq 0x348(%rsp), %rdx
callq 0x14520
jmp 0x1103e
leaq 0x837e9(%rip), %rdx     # 0x9482e
leaq 0x410(%rsp), %rdi
leaq 0x3f0(%rsp), %rsi
callq 0x14610
jmp 0x1105c
leaq 0x410(%rsp), %rdi
callq 0x1f7f0
jmp 0x1106b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x110a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
leaq 0x440(%rsp), %rdi
callq 0xbe38
leaq 0x43f(%rsp), %rdi
callq 0xbe10
jmp 0x1169b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x111fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x111ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x111e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x111d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x111bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x111ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x111a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x11194
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
leaq 0x410(%rsp), %rdi
callq 0xbe38
leaq 0x3f0(%rsp), %rdi
callq 0xbe38
leaq 0x348(%rsp), %rdi
callq 0xbe38
leaq 0x328(%rsp), %rdi
callq 0xbe38
leaq 0x327(%rsp), %rdi
callq 0xbe10
leaq 0x3d0(%rsp), %rdi
callq 0xbe38
leaq 0x3b0(%rsp), %rdi
callq 0xbe38
leaq 0x368(%rsp), %rdi
callq 0xbe38
leaq 0x390(%rsp), %rdi
callq 0xbe38
leaq 0x38f(%rsp), %rdi
callq 0xbe10
jmp 0x115cc
movl $0x1, %edi
callq 0xb800
movq 0x460(%rsp), %rdi
movq 0x430(%rsp), %rdx
incq %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0xb850
jmp 0x11236
movq 0x460(%rsp), %rdi
leaq 0x835fe(%rip), %rsi     # 0x94843
xorl %eax, %eax
movl %eax, %edx
callq 0xb050
movq %rax, 0x318(%rsp)
callq 0xbbd0
movl $0x0, (%rax)
cmpq $-0x1, 0x318(%rsp)
jne 0x11510
callq 0xb920
cmpl $0x0, %eax
jne 0x11506
leaq 0x277(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xbb30
movq 0x10(%rsp), %rdx
leaq 0x831fd(%rip), %rsi     # 0x94499
leaq 0x278(%rsp), %rdi
callq 0x125d0
jmp 0x112ab
leaq 0x250(%rsp), %rdi
movl $0x96, %esi
callq 0x14f00
jmp 0x112bf
leaq 0x298(%rsp), %rdi
leaq 0x278(%rsp), %rsi
leaq 0x250(%rsp), %rdx
callq 0x14520
jmp 0x112de
leaq 0x831d2(%rip), %rdx     # 0x944b7
leaq 0x2b8(%rsp), %rdi
leaq 0x298(%rsp), %rsi
callq 0x14610
jmp 0x112fc
leaq 0x20f(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xbb30
movq 0x8(%rsp), %rdx
leaq 0x8355b(%rip), %rsi     # 0x94875
leaq 0x210(%rsp), %rdi
callq 0x125d0
jmp 0x11329
leaq 0x83d14(%rip), %rdx     # 0x95044
leaq 0x230(%rsp), %rdi
leaq 0x210(%rsp), %rsi
callq 0x14610
jmp 0x11347
leaq 0x2d8(%rsp), %rdi
leaq 0x2b8(%rsp), %rsi
leaq 0x230(%rsp), %rdx
callq 0x14520
jmp 0x11366
leaq 0x834d9(%rip), %rdx     # 0x94846
leaq 0x2f8(%rsp), %rdi
leaq 0x2d8(%rsp), %rsi
callq 0x14610
jmp 0x11384
leaq 0x2f8(%rsp), %rdi
callq 0x1f7f0
jmp 0x11393
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x115cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x114f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x114e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x114da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x114cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x114b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x114a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x11499
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x1148c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
leaq 0x2f8(%rsp), %rdi
callq 0xbe38
leaq 0x2d8(%rsp), %rdi
callq 0xbe38
leaq 0x230(%rsp), %rdi
callq 0xbe38
leaq 0x210(%rsp), %rdi
callq 0xbe38
leaq 0x20f(%rsp), %rdi
callq 0xbe10
leaq 0x2b8(%rsp), %rdi
callq 0xbe38
leaq 0x298(%rsp), %rdi
callq 0xbe38
leaq 0x250(%rsp), %rdi
callq 0xbe38
leaq 0x278(%rsp), %rdi
callq 0xbe38
leaq 0x277(%rsp), %rdi
callq 0xbe10
jmp 0x115cc
movl $0x1, %edi
callq 0xb800
movq 0x460(%rsp), %rdi
movq 0x318(%rsp), %rsi
movq $-0x1, %rdx
callq 0xb850
jmp 0x1152e
movq 0x460(%rsp), %rsi
leaq 0x88(%rsp), %rdi
movl $0x8, %edx
callq 0xb560
jmp 0x1154a
leaq 0x70(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x41040
jmp 0x1155e
leaq 0x480(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x18e40
jmp 0x11572
leaq 0x70(%rsp), %rdi
callq 0x18e80
leaq 0x88(%rsp), %rdi
callq 0xb680
jmp 0x115e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x115bf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x18e80
leaq 0x88(%rsp), %rdi
callq 0xb680
movq 0x4a8(%rsp), %rdi
callq 0xb0d0
callq 0xb8e0
jmp 0x115e0
jmp 0x115e2
jmp 0x115fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a8(%rsp)
movl %eax, 0x4a4(%rsp)
jmp 0x1169b
jmp 0x115ff
leaq 0x470(%rsp), %rdi
callq 0x15ad0
jmp 0x10e64
leaq 0x480(%rsp), %rdi
callq 0x18e90
testb $0x1, %al
jne 0x11624
jmp 0x11641
movq 0x48(%rsp), %rdi
leaq 0xb05b8(%rip), %rsi     # 0xc1be8
callq 0xb1c0
jmp 0x11637
movl $0x1, 0x6c(%rsp)
jmp 0x11674
leaq 0x480(%rsp), %rdi
callq 0x18ee0
jmp 0x11650
leaq 0x480(%rsp), %rdi
callq 0x18f20
movq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0x18f60
jmp 0x1166c
movl $0x1, 0x6c(%rsp)
leaq 0x480(%rsp), %rdi
callq 0x19000
leaq 0x510(%rsp), %rdi
callq 0x15800
movq 0x50(%rsp), %rax
addq $0x548, %rsp            # imm = 0x548
retq
leaq 0x480(%rsp), %rdi
callq 0x19000
leaq 0x510(%rsp), %rdi
callq 0x15800
movq 0x4a8(%rsp), %rdi
callq 0xb7b0
nopw %cs:(%rax,%rax)