// File: /workspace/github_cpp_makefile_star2_O2/nurseiit[P]cpp-server/./include/asio/impl/read_until.hpp
// Function: asio::detail::read_until_delim_op_v1<asio::basic_stream_socket<asio::ip::tcp, asio::executor>, asio::basic_streambuf_ref<std::allocator<char>>, Session::read_first_line(std::shared_ptr<Session>)::'lambda'(std::error_code const&, unsigned long)>::operator()(std::error_code const&, unsigned long, int)
void operator()(const asio::error_code& ec,
        std::size_t bytes_transferred, int start = 0)
    {
      const std::size_t not_found = (std::numeric_limits<std::size_t>::max)();
      std::size_t bytes_to_read;
      switch (start_ = start)
      {
      case 1:
        for (;;)
        {
          {
            // Determine the range of the data to be searched.
            typedef typename DynamicBuffer_v1::const_buffers_type
              buffers_type;
            typedef buffers_iterator<buffers_type> iterator;
            buffers_type data_buffers = buffers_.data();
            iterator begin = iterator::begin(data_buffers);
            iterator start_pos = begin + search_position_;
            iterator end = iterator::end(data_buffers);

            // Look for a match.
            iterator iter = std::find(start_pos, end, delim_);
            if (iter != end)
            {
              // Found a match. We're done.
              search_position_ = iter - begin + 1;
              bytes_to_read = 0;
            }

            // No match yet. Check if buffer is full.
            else if (buffers_.size() == buffers_.max_size())
            {
              search_position_ = not_found;
              bytes_to_read = 0;
            }

            // Need to read some more data.
            else
            {
              // Next search can start with the new data.
              search_position_ = end - begin;
              bytes_to_read = std::min<std::size_t>(
                    std::max<std::size_t>(512,
                      buffers_.capacity() - buffers_.size()),
                    std::min<std::size_t>(65536,
                      buffers_.max_size() - buffers_.size()));
            }
          }

          // Check if we're done.
          if (!start && bytes_to_read == 0)
            break;

          // Start a new asynchronous read op_v1eration to obtain more data.
          stream_.async_read_some(buffers_.prepare(bytes_to_read),
              ASIO_MOVE_CAST(read_until_delim_op_v1)(*this));
          return; default:
          buffers_.commit(bytes_transferred);
          if (ec || bytes_transferred == 0)
            break;
        }

        const asio::error_code result_ec =
          (search_position_ == not_found)
          ? error::not_found : ec;

        const std::size_t result_n =
          (ec || search_position_ == not_found)
          ? 0 : search_position_;

        handler_(result_ec, result_n);
      }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movl %ecx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl %ecx, 0x14(%rdi)
cmpl $0x1, %ecx
je 0xa1a5
movq %rdx, %r15
leaq 0x8(%rbx), %rdi
movq %rdx, %rsi
callq 0xa3f4
testq %r15, %r15
je 0xa2fa
cmpl $0x0, (%r14)
jne 0xa2fa
movq %r14, 0x70(%rsp)
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rcx
movq 0x28(%rax), %rax
leaq 0xc8(%rsp), %r12
movq %rcx, -0x10(%r12)
subq %rcx, %rax
leaq 0xb8(%rsp), %r14
movq %r14, %rdx
cmoveq %r12, %rdx
movq %rax, -0x8(%r12)
movq 0x18(%rbx), %rsi
leaq 0x100(%rsp), %r13
movq %rcx, (%r13)
movq %rax, 0x8(%r13)
andq $0x0, 0x10(%r13)
leaq 0x8(%rbx), %rax
movq %rax, 0x78(%rsp)
movq %r14, 0x18(%r13)
movq %rdx, 0x20(%r13)
movq %r12, 0x28(%r13)
andq $0x0, 0x30(%r13)
movq %r13, %rdi
callq 0xa53a
andq $0x0, 0x90(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movq 0x8(%r14), %r15
leaq 0x10(%rbx), %rsi
movq %r14, 0x98(%rsp)
movq %r12, 0xa0(%rsp)
movq %r12, 0xa8(%rsp)
movq %r15, 0xb0(%rsp)
movq %r15, 0x68(%rsp)
movaps 0x80(%rsp), %xmm0
movaps 0x90(%rsp), %xmm1
movaps 0xa0(%rsp), %xmm2
movups %xmm2, 0x58(%rsp)
movups %xmm1, 0x48(%rsp)
movups %xmm0, 0x38(%rsp)
movq 0x30(%r13), %rax
movq %rax, 0x30(%rsp)
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movups 0x20(%r13), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0xc8(%rsp), %r13
movq %r13, %rdi
callq 0xa6b4
movq 0x30(%r13), %rax
cmpq %r15, %rax
jne 0xa2e2
movq 0x78(%rsp), %rdi
movq (%rdi), %rdx
movq 0x28(%rdx), %rcx
movq 0x40(%rdx), %rax
subq 0x10(%rdx), %rcx
subq %rcx, %rax
jne 0xa300
orq $-0x1, 0x18(%rbx)
pushq $-0x1
popq %r15
xorl %esi, %esi
jmp 0xa332
incq %rax
movq %rax, 0x18(%rbx)
xorl %esi, %esi
movq %rax, %r15
movq 0x70(%rsp), %r14
movq 0x78(%rsp), %rdi
jmp 0xa337
movq 0x18(%rbx), %r15
jmp 0xa340
movq %r15, 0x18(%rbx)
movq 0x58(%rdx), %r8
addq 0x48(%rdx), %rcx
subq %rcx, %r8
cmpq $0x201, %r8             # imm = 0x201
movl $0x200, %esi            # imm = 0x200
cmovaeq %r8, %rsi
cmpq %rsi, %rax
cmovbq %rax, %rsi
movl $0x10000, %eax          # imm = 0x10000
cmpq %rax, %rsi
cmovaeq %rax, %rsi
movq 0x70(%rsp), %r14
testl %ebp, %ebp
jne 0xa354
testq %rsi, %rsi
jne 0xa354
cmpq $-0x1, %r15
je 0xa378
movups (%r14), %xmm0
movaps %xmm0, 0x80(%rsp)
jmp 0xa394
movq (%rbx), %r14
callq 0xa3ec
leaq 0x80(%rsp), %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
movq %r14, %rdi
movq %rbx, %rdx
callq 0xa3d0
jmp 0xa3bd
callq 0x607b
movl $0x3, 0x80(%rsp)
movq %rax, 0x88(%rsp)
movq 0x18(%rbx), %r15
xorl %eax, %eax
cmpq $-0x1, %r15
cmoveq %rax, %r15
cmpl $0x0, (%r14)
cmovneq %rax, %r15
addq $0x20, %rbx
leaq 0x80(%rsp), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0xa418
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop