// File: ncbi[P]amr/curl_easy.cpp
// Function: CURL_sp::Curl::download(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&)
void Curl::download (const string &url,
                     const string &fName) 
{
  ASSERT (! fName. empty ());  
  
  {
    OFStream f (fName);
    curl_easy_setopt (eh, CURLOPT_WRITEFUNCTION, write_stream_cb);
    curl_easy_setopt (eh, CURLOPT_WRITEDATA, & f);
    process (url, "download");
  }
  
  IFStream f (fName);
  string s;
  f >> s;
  if (s == "<?xml")
    throw runtime_error ("Cannot download " + strQuote (fName));
}

// Assembly:
subq $0x618, %rsp            # imm = 0x618
movq %rdi, 0x610(%rsp)
movq %rsi, 0x608(%rsp)
movq %rdx, 0x600(%rsp)
movq 0x610(%rsp), %rax
movq %rax, 0x40(%rsp)
callq 0xbbd0
movl $0x0, (%rax)
movq 0x600(%rsp), %rdi
callq 0xb370
testb $0x1, %al
jne 0x9139d
jmp 0x91624
callq 0xb920
cmpl $0x0, %eax
jne 0x9161a
leaq 0x55f(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0xbb30
movq 0x38(%rsp), %rdx
leaq 0x73ff(%rip), %rsi      # 0x987c8
leaq 0x560(%rsp), %rdi
callq 0x125d0
jmp 0x913d8
leaq 0x528(%rsp), %rdi
movl $0x6c, %esi
callq 0x14f00
jmp 0x913ec
leaq 0x580(%rsp), %rdi
leaq 0x560(%rsp), %rsi
leaq 0x528(%rsp), %rdx
callq 0x14520
jmp 0x9140b
leaq 0x30a5(%rip), %rdx      # 0x944b7
leaq 0x5a0(%rsp), %rdi
leaq 0x580(%rsp), %rsi
callq 0x14610
jmp 0x91429
leaq 0x4e7(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0xbb30
movq 0x30(%rsp), %rdx
leaq 0x7398(%rip), %rsi      # 0x987df
leaq 0x4e8(%rsp), %rdi
callq 0x125d0
jmp 0x91456
leaq 0x3be7(%rip), %rdx      # 0x95044
leaq 0x508(%rsp), %rdi
leaq 0x4e8(%rsp), %rsi
callq 0x14610
jmp 0x91474
leaq 0x5c0(%rsp), %rdi
leaq 0x5a0(%rsp), %rsi
leaq 0x508(%rsp), %rdx
callq 0x14520
jmp 0x91493
leaq 0x354f(%rip), %rdx      # 0x949e9
leaq 0x5e0(%rsp), %rdi
leaq 0x5c0(%rsp), %rsi
callq 0x14610
jmp 0x914b1
leaq 0x5e0(%rsp), %rdi
callq 0x1f7f0
jmp 0x914c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x550(%rsp)
movl %eax, 0x54c(%rsp)
jmp 0x91608
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x550(%rsp)
movl %eax, 0x54c(%rsp)
jmp 0x915fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x550(%rsp)
movl %eax, 0x54c(%rsp)
jmp 0x915ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x550(%rsp)
movl %eax, 0x54c(%rsp)
jmp 0x915e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x550(%rsp)
movl %eax, 0x54c(%rsp)
jmp 0x915c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x550(%rsp)
movl %eax, 0x54c(%rsp)
jmp 0x915ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x550(%rsp)
movl %eax, 0x54c(%rsp)
jmp 0x915ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x550(%rsp)
movl %eax, 0x54c(%rsp)
jmp 0x915a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x550(%rsp)
movl %eax, 0x54c(%rsp)
leaq 0x5e0(%rsp), %rdi
callq 0xbe38
leaq 0x5c0(%rsp), %rdi
callq 0xbe38
leaq 0x508(%rsp), %rdi
callq 0xbe38
leaq 0x4e8(%rsp), %rdi
callq 0xbe38
leaq 0x4e7(%rsp), %rdi
callq 0xbe10
leaq 0x5a0(%rsp), %rdi
callq 0xbe38
leaq 0x580(%rsp), %rdi
callq 0xbe38
leaq 0x528(%rsp), %rdi
callq 0xbe38
leaq 0x560(%rsp), %rdi
callq 0xbe38
leaq 0x55f(%rsp), %rdi
callq 0xbe10
jmp 0x918f0
movl $0x1, %edi
callq 0xb800
movq 0x600(%rsp), %rsi
leaq 0x2e0(%rsp), %rdi
callq 0x54ef0
movq 0x40(%rsp), %rax
movq (%rax), %rdi
leaq 0x2b8(%rip), %rdx       # 0x91900
xorl %eax, %eax
movl $0x4e2b, %esi           # imm = 0x4E2B
callq 0xba20
jmp 0x91656
movq 0x40(%rsp), %rax
movq (%rax), %rdi
xorl %eax, %eax
movl $0x2711, %esi           # imm = 0x2711
leaq 0x2e0(%rsp), %rdx
callq 0xba20
jmp 0x91674
movq 0x608(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x2bf(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0xbb30
movq 0x28(%rsp), %rdx
leaq 0x717d(%rip), %rsi      # 0x9881c
leaq 0x2c0(%rsp), %rdi
callq 0x125d0
jmp 0x916ae
movq 0x20(%rsp), %rsi
movq 0x40(%rsp), %rdi
leaq 0x2c0(%rsp), %rdx
callq 0x92160
jmp 0x916c7
leaq 0x2c0(%rsp), %rdi
callq 0xbe38
leaq 0x2bf(%rsp), %rdi
callq 0xbe10
leaq 0x2e0(%rsp), %rdi
callq 0x54fb0
movq 0x600(%rsp), %rsi
leaq 0xb0(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x3a020
leaq 0x90(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xb440
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0xb530
jmp 0x9172b
leaq 0x70f3(%rip), %rsi      # 0x98825
leaq 0x90(%rsp), %rdi
callq 0x55160
movb %al, 0xf(%rsp)
jmp 0x91745
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x91752
jmp 0x918b4
movb $0x1, 0x4f(%rsp)
movl $0x10, %edi
callq 0xb490
movq %rax, (%rsp)
movq 0x600(%rsp), %rsi
leaq 0x50(%rsp), %rdi
movl $0x22, %edx
callq 0x23330
jmp 0x9177e
leaq 0x70a6(%rip), %rsi      # 0x9882b
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x150e0
jmp 0x91796
movq (%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0xb360
jmp 0x917a6
movq (%rsp), %rdi
movb $0x0, 0x4f(%rsp)
movq 0x2f7f2(%rip), %rsi     # 0xc0fa8
movq 0x2f7cb(%rip), %rdx     # 0xc0f88
callq 0xb770
jmp 0x918fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x550(%rsp)
movl %eax, 0x54c(%rsp)
jmp 0x91821
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x550(%rsp)
movl %eax, 0x54c(%rsp)
jmp 0x91814
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x550(%rsp)
movl %eax, 0x54c(%rsp)
leaq 0x2c0(%rsp), %rdi
callq 0xbe38
leaq 0x2bf(%rsp), %rdi
callq 0xbe10
leaq 0x2e0(%rsp), %rdi
callq 0x54fb0
jmp 0x918f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x550(%rsp)
movl %eax, 0x54c(%rsp)
jmp 0x918d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x550(%rsp)
movl %eax, 0x54c(%rsp)
jmp 0x918a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x550(%rsp)
movl %eax, 0x54c(%rsp)
jmp 0x91896
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x550(%rsp)
movl %eax, 0x54c(%rsp)
leaq 0x70(%rsp), %rdi
callq 0xbe38
leaq 0x50(%rsp), %rdi
callq 0xbe38
testb $0x1, 0x4f(%rsp)
jne 0x918a9
jmp 0x918b2
movq (%rsp), %rdi
callq 0xba50
jmp 0x918d6
leaq 0x90(%rsp), %rdi
callq 0xbe38
leaq 0xb0(%rsp), %rdi
callq 0x1c0a0
addq $0x618, %rsp            # imm = 0x618
retq
leaq 0x90(%rsp), %rdi
callq 0xbe38
leaq 0xb0(%rsp), %rdi
callq 0x1c0a0
movq 0x550(%rsp), %rdi
callq 0xb7b0
nopl (%rax)