// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
xorl %r13d, %r13d
testq %rdx, %rdx
setne %r13b
movq (%rsi), %r12
callq 0x5210
andl $0x0, (%rbx)
movq %rax, 0x8(%rbx)
shll $0x10, %r13d
movq 0x58(%r12), %rsi
movq 0x28(%r12), %rax
movq 0x40(%r12), %rcx
subq 0x10(%r12), %rax
movq 0x48(%r12), %rdx
addq %rax, %rdx
subq %rdx, %rsi
subq %rax, %rcx
cmpq %r13, %rcx
cmovaeq %r13, %rcx
cmpq $0x201, %rsi            # imm = 0x201
movl $0x200, %eax            # imm = 0x200
cmovbq %rax, %rsi
cmpq %rsi, %rcx
cmovbq %rcx, %rsi
xorl %r13d, %r13d
leaq 0x8(%rsp), %rbp
testq %rsi, %rsi
je 0xbf71
movq %r12, %rdi
callq 0xbe26
movq %rax, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0xb9a2
movq 0x28(%r12), %rcx
movq 0x30(%r12), %rdx
subq %rcx, %rdx
cmpq %rax, %rdx
cmovaeq %rax, %rdx
movslq %edx, %rdx
addq %rcx, %rdx
movq %rdx, 0x28(%r12)
movq %rdx, 0x18(%r12)
addq %rax, %r13
cmpl $0x0, (%rbx)
sete %al
cmpq %r14, %r13
setb %cl
andb %al, %cl
movzbl %cl, %eax
shll $0x10, %eax
movq 0x58(%r12), %rsi
subq 0x10(%r12), %rdx
movq 0x48(%r12), %rcx
addq %rdx, %rcx
subq %rcx, %rsi
movq 0x40(%r12), %rcx
subq %rdx, %rcx
cmpq %rax, %rcx
cmovaeq %rax, %rcx
cmpq $0x201, %rsi            # imm = 0x201
movl $0x200, %eax            # imm = 0x200
cmovbq %rax, %rsi
cmpq %rsi, %rcx
cmovbq %rcx, %rsi
jmp 0xbecd
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq