// File: /workspace/github_cpp_makefile_star2_O1/kztomita[P]http-dump/./http2_socket.h
// Function: void write_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 const&)
void write_http2_frame(SyncWriteStream& socket, const http2_frame& frame) {
  namespace asio = boost::asio;

  if (frame.header().length() != frame.payload().size()) {
    std::cerr << "payload length mismatch." << std::endl;
  }

  asio::write(socket, asio::buffer(reinterpret_cast<const char*>(&frame.header()), sizeof(http2_frame_header)));

  if (frame.payload().size()) {
    asio::write(socket, asio::buffer(reinterpret_cast<const char*>(frame.payload_buffer()), frame.payload().size()));
  }

  debug_message("SEND");
  debug_dump(frame);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movzwl (%rsi), %eax
movzbl 0x2(%rsi), %ecx
shll $0x10, %ecx
orl %eax, %ecx
bswapl %ecx
shrl $0x8, %ecx
movq 0x18(%rsi), %rax
subq 0x10(%rsi), %rax
cmpq %rcx, %rax
je 0x274df
movq 0x20b44(%rip), %r15     # 0x47fe8
leaq 0xcfa8(%rip), %rsi      # 0x34453
movl $0x18, %edx
movq %r15, %rdi
callq 0xb730
movq (%r15), %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
leaq 0x60(%rsp), %r15
movq %rbx, (%r15)
movq $0x9, 0x8(%r15)
leaq 0x10(%rsp), %r12
movl $0x0, (%r12)
movb $0x0, 0x4(%r12)
leaq 0x1ed67(%rip), %r13     # 0x46270
movq %r13, 0x8(%r12)
leaq 0x20(%rsp), %rdx
movq %r15, (%rdx)
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rcx
callq 0x26645
cmpb $0x1, 0x4(%r12)
je 0x27621
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
subq %rax, %rcx
je 0x27581
movq %rax, 0x60(%rsp)
movq %rcx, 0x68(%rsp)
leaq 0x10(%rsp), %r12
movl $0x0, (%r12)
movb $0x0, 0x4(%r12)
movq %r13, 0x8(%r12)
leaq 0x20(%rsp), %rdx
movq %r15, (%rdx)
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rcx
callq 0x26645
cmpb $0x1, 0x4(%r12)
je 0x2766c
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xcedb(%rip), %rsi      # 0x3446c
leaq 0xced8(%rip), %rdx      # 0x34470
leaq 0x20(%rsp), %rdi
callq 0x10322
cmpb $0x1, 0x2161f(%rip)     # 0x48bc8
jne 0x275eb
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x209cc(%rip), %rdi     # 0x47f88
callq 0xb730
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0xb5b0
movsbl %al, %esi
movq %r14, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb450
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x27602
movq 0x30(%rsp), %rsi
incq %rsi
callq 0xb600
cmpb $0x1, 0x215bf(%rip)     # 0x48bc8
jne 0x27613
movq %rbx, %rdi
callq 0x28764
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movups 0x10(%rsp), %xmm0
movaps %xmm0, (%rsp)
leaq 0xc8da(%rip), %rsi      # 0x33f0b
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0xbc90
leaq 0x1ebfb(%rip), %rax     # 0x46240
movq %rax, (%rbx)
movaps (%rsp), %xmm0
movups %xmm0, 0x10(%rbx)
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq %rbx, %rdi
callq 0xe1ef
movups 0x10(%rsp), %xmm0
movaps %xmm0, (%rsp)
leaq 0xc88f(%rip), %rsi      # 0x33f0b
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0xbc90
leaq 0x1ebb0(%rip), %rax     # 0x46240
movq %rax, (%rbx)
movaps (%rsp), %xmm0
movups %xmm0, 0x10(%rbx)
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq %rbx, %rdi
callq 0xe1ef
jmp 0x276be
movq %rax, %rbx
jmp 0x276e7
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xde76
jmp 0x276e7
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x276e7
movq 0x30(%rsp), %rsi
incq %rsi
callq 0xb600
movq %rbx, %rdi
callq 0xbbb0