// File: /workspace/github_cpp_makefile_star2_O3/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 $0x28, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
xorl %r13d, %r13d
testq %rdx, %rdx
setne %r13b
movq (%rsi), %r12
callq 0x51d0
movl $0x0, (%rbx)
movq %rax, 0x8(%rbx)
shll $0x10, %r13d
movq 0x28(%r12), %rcx
movq 0x40(%r12), %rax
subq 0x10(%r12), %rcx
subq %rcx, %rax
cmpq %r13, %rax
cmovaeq %r13, %rax
testq %rax, %rax
je 0xd68f
movq 0x58(%r12), %rbp
addq 0x48(%r12), %rcx
subq %rcx, %rbp
cmpq $0x201, %rbp            # imm = 0x201
movl $0x200, %ecx            # imm = 0x200
cmovbq %rcx, %rbp
cmpq %rbp, %rax
cmovbq %rax, %rbp
xorl %r13d, %r13d
movq %r12, %rdi
movq %rbp, %rsi
callq 0x8a40
movq 0x28(%r12), %rax
movq %rax, 0x10(%rsp)
movq %rbp, 0x18(%rsp)
movq %rbp, 0x20(%rsp)
movl 0x8(%r15), %edi
movzbl 0xc(%r15), %esi
movq %rbx, (%rsp)
movl $0x1, %ecx
leaq 0x10(%rsp), %rdx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xd2a6
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), %rbp
subq 0x10(%r12), %rdx
movq 0x48(%r12), %rcx
addq %rdx, %rcx
subq %rcx, %rbp
movq 0x40(%r12), %rcx
subq %rdx, %rcx
cmpq %rax, %rcx
cmovaeq %rax, %rcx
cmpq $0x201, %rbp            # imm = 0x201
movl $0x200, %eax            # imm = 0x200
cmovbq %rax, %rbp
cmpq %rbp, %rcx
cmovbq %rcx, %rbp
testq %rcx, %rcx
jne 0xd5cd
jmp 0xd692
xorl %r13d, %r13d
movq %r13, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq