// File: /workspace/github_cpp_makefile_star2_O3/kztomita[P]http-dump/./http2_socket.h
// Function: http2_frame read_http2_frame<boost::asio::ssl::stream<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::execution::any_executor<boost::asio::execution::context_as_t<boost::asio::execution_context&>, boost::asio::execution::detail::blocking::never_t<0>, boost::asio::execution::prefer_only<boost::asio::execution::detail::blocking::possibly_t<0>>, boost::asio::execution::prefer_only<boost::asio::execution::detail::outstanding_work::tracked_t<0>>, boost::asio::execution::prefer_only<boost::asio::execution::detail::outstanding_work::untracked_t<0>>, boost::asio::execution::prefer_only<boost::asio::execution::detail::relationship::fork_t<0>>, boost::asio::execution::prefer_only<boost::asio::execution::detail::relationship::continuation_t<0>>>>>>(boost::asio::ssl::stream<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::execution::any_executor<boost::asio::execution::context_as_t<boost::asio::execution_context&>, boost::asio::execution::detail::blocking::never_t<0>, boost::asio::execution::prefer_only<boost::asio::execution::detail::blocking::possibly_t<0>>, boost::asio::execution::prefer_only<boost::asio::execution::detail::outstanding_work::tracked_t<0>>, boost::asio::execution::prefer_only<boost::asio::execution::detail::outstanding_work::untracked_t<0>>, boost::asio::execution::prefer_only<boost::asio::execution::detail::relationship::fork_t<0>>, boost::asio::execution::prefer_only<boost::asio::execution::detail::relationship::continuation_t<0>>>>>&)
http2_frame read_http2_frame(SyncReadStream& socket) {
  namespace asio = boost::asio;

  asio::streambuf receive_buffer;

  asio::read(socket, receive_buffer, boost::asio::transfer_exactly(9));

  const char* headerp = asio::buffer_cast<const char*>(receive_buffer.data());

  http2_frame frame;

  std::memcpy(&frame.header(), headerp, 9);
  receive_buffer.consume(9);

  uint payload_size = frame.header().length();

  if (payload_size) {
    frame.payload().resize(payload_size);

    asio::read(socket, receive_buffer, boost::asio::transfer_exactly(payload_size));

    const char* payloadp = asio::buffer_cast<const char*>(receive_buffer.data());
    std::memcpy(frame.payload_buffer(), payloadp, payload_size);
  }

  debug_message("RECV");
  debug_dump(frame);

  return frame;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x58(%rsp), %r12
leaq 0x10(%rsp), %rdx
movq %r12, %rdi
movq $-0x1, %rsi
callq 0x231b2
leaq 0x50(%rsp), %rsi
movq %r12, (%rsi)
movq %rsp, %rcx
movl $0x0, (%rcx)
movb $0x0, 0x4(%rcx)
leaq 0x1f952(%rip), %rbp     # 0x45310
movq %rbp, 0x8(%rcx)
movl $0x9, %edx
movq %r15, %rdi
xorl %r8d, %r8d
callq 0x2736f
cmpb $0x1, 0x4(%rsp)
je 0x25b9a
movq 0x68(%rsp), %rax
movq 0x80(%rsp), %rdx
movq %rdx, %rcx
subq %rax, %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movq $0x0, 0x20(%rbx)
movb 0x8(%rax), %sil
movb %sil, 0x8(%rbx)
movq (%rax), %rsi
movq %rsi, (%rbx)
cmpq %rdx, 0x70(%rsp)
jae 0x25a26
movq 0xa0(%rsp), %rsi
movq %rsi, 0x60(%rsp)
movq %rdx, 0x70(%rsp)
leaq 0x9(%rax), %rsi
cmpq %rdx, %rsi
movslq %ecx, %rcx
movl $0x9, %edx
cmovaq %rcx, %rdx
leaq 0x10(%rbx), %r14
addq %rax, %rdx
movq %rdx, 0x68(%rsp)
movzwl (%rbx), %eax
movzbl 0x2(%rbx), %r13d
shll $0x10, %r13d
orl %eax, %r13d
testl %r13d, %r13d
je 0x25aad
bswapl %r13d
shrl $0x8, %r13d
movq %r14, %rdi
movq %r13, %rsi
callq 0x23788
leaq 0x50(%rsp), %rsi
movq %r12, (%rsi)
movq %rsp, %rcx
movl $0x0, (%rcx)
movb $0x0, 0x4(%rcx)
movq %rbp, 0x8(%rcx)
movq %r15, %rdi
movq %r13, %rdx
xorl %r8d, %r8d
callq 0x2736f
cmpb $0x1, 0x4(%rsp)
je 0x25be5
movq 0x68(%rsp), %rsi
movq (%r14), %rdi
movq %r13, %rdx
callq 0xb500
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xd9b3(%rip), %rsi      # 0x33471
leaq 0xd9b0(%rip), %rdx      # 0x33475
leaq 0x10(%rsp), %rdi
callq 0x1025a
cmpb $0x1, 0x220f2(%rip)     # 0x47bc8
jne 0x25b18
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x21497(%rip), %rdi     # 0x46f80
callq 0xb730
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0xb5b0
movsbl %al, %esi
movq %r15, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb450
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x25b2f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xb600
cmpb $0x1, 0x22092(%rip)     # 0x47bc8
jne 0x25b40
movq %rbx, %rdi
callq 0x28370
leaq 0x20649(%rip), %rax     # 0x46190
movq %rax, 0x58(%rsp)
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x25b69
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0xb600
movq 0x213a8(%rip), %rax     # 0x46f18
addq $0x10, %rax
leaq 0x90(%rsp), %rdi
movq %rax, -0x38(%rdi)
callq 0xb950
movq %rbx, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rbx
movq 0x8(%rsp), %r14
leaq 0xb77a(%rip), %rsi      # 0x31324
leaq 0x10(%rsp), %rdi
callq 0xbc90
leaq 0x1f725(%rip), %rax     # 0x452e0
leaq 0x40(%rsp), %rcx
movq %rax, -0x30(%rcx)
movq %rbx, -0x20(%rcx)
movq %r14, -0x18(%rcx)
movq %rcx, -0x10(%rcx)
movq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
leaq 0x10(%rsp), %rdi
callq 0xe1b4
movq (%rsp), %r15
movq 0x8(%rsp), %r12
leaq 0xb72f(%rip), %rsi      # 0x31324
leaq 0x10(%rsp), %rdi
callq 0xbc90
leaq 0x1f6da(%rip), %rax     # 0x452e0
leaq 0x40(%rsp), %rcx
movq %rax, -0x30(%rcx)
movq %r15, -0x20(%rcx)
movq %r12, -0x18(%rcx)
movq %rcx, -0x10(%rcx)
movq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
leaq 0x10(%rsp), %rdi
callq 0xe1b4
movq %rax, %r15
leaq 0x10(%rsp), %rdi
callq 0xde38
jmp 0x25c74
movq %rax, %r15
leaq 0x10(%rsp), %rdi
callq 0xde38
jmp 0x25c88
jmp 0x25c71
movq %rax, %r15
jmp 0x25c88
movq %rax, %r15
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x25c74
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xb600
jmp 0x25c74
movq %rax, %r15
movq (%r14), %rdi
testq %rdi, %rdi
je 0x25c88
movq 0x20(%rbx), %rsi
subq %rdi, %rsi
callq 0xb600
leaq 0x58(%rsp), %rdi
callq 0x237b4
movq %r15, %rdi
callq 0xbbb0