// File: nurseiit[P]cpp-server/./include/asio/impl/read.hpp
// Function: unsigned long asio::read<asio::basic_stream_socket<asio::ip::tcp, asio::executor>, asio::basic_streambuf_ref<std::allocator<char>>, asio::detail::transfer_at_least_t>(asio::basic_stream_socket<asio::ip::tcp, asio::executor>&, asio::basic_streambuf_ref<std::allocator<char>>&&, asio::detail::transfer_at_least_t, std::error_code&, std::enable_if<is_dynamic_buffer_v1<std::decay<asio::basic_streambuf_ref<std::allocator<char>>>::type>::value && !is_dynamic_buffer_v2<std::decay<asio::basic_streambuf_ref<std::allocator<char>>>::type>::value, void>::type*)
std::size_t read(SyncReadStream& s,
    ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
    CompletionCondition completion_condition, asio::error_code& ec,
    typename enable_if<
      is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
        && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
    >::type*)
{
  typename decay<DynamicBuffer_v1>::type b(
      ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers));

  ec = asio::error_code();
  std::size_t total_transferred = 0;
  std::size_t max_size = detail::adapt_completion_condition_result(
        completion_condition(ec, total_transferred));
  std::size_t bytes_available = std::min<std::size_t>(
        std::max<std::size_t>(512, b.capacity() - b.size()),
        std::min<std::size_t>(max_size, b.max_size() - b.size()));
  while (bytes_available > 0)
  {
    std::size_t bytes_transferred = s.read_some(b.prepare(bytes_available), ec);
    b.commit(bytes_transferred);
    total_transferred += bytes_transferred;
    max_size = detail::adapt_completion_condition_result(
          completion_condition(ec, total_transferred));
    bytes_available = std::min<std::size_t>(
          std::max<std::size_t>(512, b.capacity() - b.size()),
          std::min<std::size_t>(max_size, b.max_size() - b.size()));
  }
  return total_transferred;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdx, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x15510
leaq -0x40(%rbp), %rdi
callq 0x6f10
movq -0x20(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, (%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq $0x0, -0x48(%rbp)
movq -0x20(%rbp), %rsi
movq -0x48(%rbp), %rdx
leaq -0x8(%rbp), %rdi
callq 0x179c0
movq %rax, %rdi
callq 0x15760
movq %rax, -0x50(%rbp)
movq $0x200, -0x60(%rbp)     # imm = 0x200
leaq -0x30(%rbp), %rdi
callq 0x168d0
movq %rax, -0xb8(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x16890
movq %rax, %rcx
movq -0xb8(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0xbb90
movq %rax, -0xa8(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x168b0
movq %rax, -0xb0(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x16890
movq %rax, %rcx
movq -0xb0(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x70(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xc110
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
callq 0xc110
movq (%rax), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jbe 0x179a9
movq -0x10(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x58(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x16970
movq -0xd8(%rbp), %rdi
movq %rax, -0x88(%rbp)
movq %rdx, -0x80(%rbp)
movq -0x20(%rbp), %rdx
leaq -0x88(%rbp), %rsi
callq 0x16920
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x168f0
movq -0x78(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rsi
movq -0x48(%rbp), %rdx
leaq -0x8(%rbp), %rdi
callq 0x179c0
movq %rax, %rdi
callq 0x15760
movq %rax, -0x50(%rbp)
movq $0x200, -0x90(%rbp) # imm = 0x200
leaq -0x30(%rbp), %rdi
callq 0x168d0
movq %rax, -0xd0(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x16890
movq %rax, %rcx
movq -0xd0(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x98(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xbb90
movq %rax, -0xc0(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x168b0
movq %rax, -0xc8(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x16890
movq %rax, %rcx
movq -0xc8(%rbp), %rax
subq %rcx, %rax
movq %rax, -0xa0(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0xc110
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0xc110
movq (%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0x17880
movq -0x48(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)