// File: /workspace/github_cpp_makefile_star2_O2/kztomita[P]http-dump/httpv1.cc
// Function: httpv1::get(boost::asio::ip::address const&, unsigned short, http_scheme, 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::list<std::unique_ptr<http_header, std::default_delete<http_header>>, std::allocator<std::unique_ptr<http_header, std::default_delete<http_header>>>> const&)
http_response httpv1::get(const boost::asio::ip::address& ip, uint16_t port, http_scheme scheme, const std::string& host, const std::string& path, const http_header_list& headers) {
  std::unique_ptr<sync_stream_wrapper> socket = create_socket(scheme);

  socket->set_host(host);
  socket->connect(ip, port);

  std::ostringstream request_stream;
  request_stream << "GET " << path << " HTTP/1.1\r\n"
                 << "Host: " << host << "\r\n";
                 //<< "Connection: Close\r\n"
  for (const auto& h : headers) {
    request_stream << h->key << ": " << h->value << "\r\n";
  }
  request_stream << "\r\n";

  debug_message("Sending Request");
  debug_message(request_stream.str());
  asio::write(*socket, asio::buffer(request_stream.str()));

  return read_response(*socket);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movq %r9, %r14
movl %r8d, %esi
movl %ecx, %ebp
movq %rdx, %r15
movq %rdi, %rbx
leaq 0x8(%rsp), %r12
movq %r12, %rdi
xorl %edx, %edx
callq 0x1e63c
movq (%r12), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *(%rax)
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
movzwl %bp, %edx
movq %r15, %rsi
callq *0x8(%rax)
leaq 0x40(%rsp), %rdi
callq 0xb8f0
leaq 0xe9e0(%rip), %rsi      # 0x2ce64
leaq 0x40(%rsp), %rdi
callq 0xb5e0
movq 0x1f0(%rsp), %rsi
movq %rax, %rdi
callq 0xb570
leaq 0xe9c4(%rip), %rsi      # 0x2ce69
movq %rax, %rdi
callq 0xb5e0
leaq 0xe9c1(%rip), %rsi      # 0x2ce75
movq %rax, %rdi
callq 0xb5e0
movq %rax, %rdi
movq %r14, %rsi
callq 0xb570
leaq 0xede0(%rip), %rsi      # 0x2d2ae
movq %rax, %rdi
callq 0xb5e0
movq 0x1f8(%rsp), %r13
leaq 0x40(%rsp), %r14
leaq 0xf2a7(%rip), %r15      # 0x2d791
leaq 0xedbd(%rip), %r12      # 0x2d2ae
movq %r13, %rbp
movq (%rbp), %rbp
cmpq %r13, %rbp
je 0x1e531
movq 0x10(%rbp), %rsi
movq %r14, %rdi
callq 0xb570
movq %rax, %rdi
movq %r15, %rsi
callq 0xb5e0
movq 0x10(%rbp), %rsi
addq $0x20, %rsi
movq %rax, %rdi
callq 0xb570
movq %rax, %rdi
movq %r12, %rsi
callq 0xb5e0
jmp 0x1e4f4
leaq 0xed76(%rip), %rsi      # 0x2d2ae
leaq 0x40(%rsp), %rdi
callq 0xb5e0
leaq 0xe933(%rip), %rsi      # 0x2ce7c
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0xd416
leaq 0x10(%rsp), %rdi
callq 0x1e6a7
leaq 0x10(%rsp), %rdi
callq 0xb2f0
leaq 0x48(%rsp), %r14
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0xbaa0
leaq 0x10(%rsp), %rdi
callq 0x1e6a7
leaq 0x10(%rsp), %rdi
callq 0xb2f0
movq 0x8(%rsp), %r15
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0xbaa0
movups 0x10(%rsp), %xmm0
leaq 0x30(%rsp), %rsi
movups %xmm0, (%rsi)
movq %r15, %rdi
xorl %edx, %edx
callq 0x1e6ca
leaq 0x10(%rsp), %rdi
callq 0xb2f0
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1e70f
leaq 0x40(%rsp), %rdi
callq 0xb120
leaq 0x8(%rsp), %rdi
callq 0x1ede6
movq %rbx, %rax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1e603
jmp 0x1e61d
jmp 0x1e603
jmp 0x1e61d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xb2f0
jmp 0x1e620
jmp 0x1e61d
jmp 0x1e616
movq %rax, %rbx
jmp 0x1e62a
jmp 0x1e61d
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0xb120
leaq 0x8(%rsp), %rdi
callq 0x1ede6
movq %rbx, %rdi
callq 0xbba0