// File: /workspace/github_cpp_makefile_star2_O3/kztomita[P]http-dump/./http2_socket.h
// Function: void send_http2_window_update<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>>>>>&, unsigned int, unsigned int)
void send_http2_window_update(SyncWriteStream& stream, uint32_t stream_id, uint32_t increment) {
  if (increment & 0x80000000) {
    throw std::invalid_argument("increment too large");
  }

  http2_frame window_update;

  auto& header = window_update.header();
  header.set_length(4);
  header.type = http2_frame_header::TYPE_WINDOW_UPDATE;
  header.flags = 0x00;
  header.set_stream_id(stream_id);

  auto& payload = window_update.payload();
  payload.resize(4);
  uint32_t value;
  value = htonl(increment);
  std::memcpy(&payload[0], &value, 4);

  write_http2_frame(stream, window_update);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
testl %edx, %edx
js 0x26205
movl %edx, %ebp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x8(%rsp), %rdi
movups %xmm0, 0x10(%rdi)
movq $0x0, 0x20(%rdi)
movb $0x4, 0x2(%rdi)
movw $0x0, (%rdi)
movw $0x8, 0x3(%rdi)
callq 0x27028
leaq 0x18(%rsp), %rdi
movl $0x4, %esi
callq 0x23788
bswapl %ebp
leaq 0x8(%rsp), %rsi
movq 0x10(%rsi), %rax
movl %ebp, (%rax)
movq %rbx, %rdi
callq 0x270ec
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x261fc
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0xb600
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl $0x10, %edi
callq 0xb300
movq %rax, %r14
leaq 0xd29a(%rip), %rsi      # 0x334b3
movq %rax, %rdi
callq 0xbcd0
movq 0x20d90(%rip), %rsi     # 0x46fb8
movq 0x20d61(%rip), %rdx     # 0x46f90
movq %r14, %rdi
callq 0xbb60
movq %rax, %rbx
movq %r14, %rdi
callq 0xb4b0
jmp 0x26262
jmp 0x26248
jmp 0x26248
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x26262
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0xb600
movq %rbx, %rdi
callq 0xbbb0