// File: /workspace/github_cpp_makefile_star2_O1/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 0xb33c
movq 0x8(%rbx), %rax
movq 0x28(%rax), %rcx
movq 0x30(%rax), %rsi
subq %rcx, %rsi
cmpq %rdx, %rsi
cmovaeq %rdx, %rsi
movslq %esi, %rsi
addq %rcx, %rsi
movq %rsi, 0x28(%rax)
movq %rsi, 0x18(%rax)
testq %rdx, %rdx
je 0xb4b2
cmpl $0x0, (%r14)
jne 0xb4b2
movq %r14, 0x78(%rsp)
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rcx
movq 0x28(%rax), %rax
leaq 0xc8(%rsp), %r13
movq %rcx, -0x10(%r13)
subq %rcx, %rax
movq %rax, -0x8(%r13)
leaq 0xb8(%rsp), %r14
movq %r14, %rdx
cmoveq %r13, %rdx
movq 0x18(%rbx), %rsi
leaq 0x100(%rsp), %r15
movq %rcx, (%r15)
movq %rax, 0x8(%r15)
xorl %r12d, %r12d
movq %r12, 0x10(%r15)
movq %r14, 0x18(%r15)
movq %rdx, 0x20(%r15)
movq %r13, 0x28(%r15)
movq %r12, 0x30(%r15)
movq %r15, %rdi
callq 0xb762
movq %r12, 0x90(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movq 0x8(%r14), %r12
leaq 0x10(%rbx), %rsi
movq %r14, 0x98(%rsp)
movq %r13, 0xa0(%rsp)
movq %r13, 0xa8(%rsp)
movq %r12, 0xb0(%rsp)
movq %r12, 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(%r15), %rax
movq %rax, 0x30(%rsp)
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0xc8(%rsp), %r15
movq %r15, %rdi
callq 0xb8f4
movq 0x30(%r15), %rax
cmpq %r12, %rax
jne 0xb465
movq 0x8(%rbx), %rdx
movq 0x28(%rdx), %rcx
movq 0x40(%rdx), %rax
subq 0x10(%rdx), %rcx
subq %rcx, %rax
jne 0xb471
movq $-0x1, 0x18(%rbx)
jmp 0xb46c
incq %rax
movq %rax, 0x18(%rbx)
xorl %r15d, %r15d
jmp 0xb4a4
movq %r12, 0x18(%rbx)
movq 0x58(%rdx), %rsi
addq 0x48(%rdx), %rcx
subq %rcx, %rsi
cmpq $0x201, %rsi            # imm = 0x201
movl $0x200, %r15d           # imm = 0x200
cmovaeq %rsi, %r15
cmpq %r15, %rax
cmovbq %rax, %r15
movl $0x10000, %eax          # imm = 0x10000
cmpq %rax, %r15
cmovaeq %rax, %r15
movq 0x78(%rsp), %r14
testl %ebp, %ebp
jne 0xb4c7
testq %r15, %r15
jne 0xb4c7
cmpq $-0x1, 0x18(%rbx)
je 0xb50b
movups (%r14), %xmm0
movaps %xmm0, 0x80(%rsp)
jmp 0xb51d
movq (%rbx), %r14
movq 0x8(%rbx), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x8e38
movq 0x28(%r12), %rax
leaq 0x80(%rsp), %rdx
movq %rax, (%rdx)
movq %r15, 0x8(%rdx)
movq (%r14), %rdi
addq $0x28, %rdi
leaq 0x8(%r14), %rsi
addq $0x20, %r14
xorl %ecx, %ecx
movq %rbx, %r8
movq %r14, %r9
callq 0xba98
jmp 0xb547
leaq 0x80(%rsp), %rdi
movl $0x3, %esi
callq 0xb55a
movq 0x18(%rbx), %rdx
xorl %eax, %eax
cmpq $-0x1, %rdx
cmoveq %rax, %rdx
cmpl $0x0, (%r14)
cmovneq %rax, %rdx
addq $0x20, %rbx
leaq 0x80(%rsp), %rsi
movq %rbx, %rdi
callq 0xb588
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop