// Hidden C++ exception states: #wind=1
char __fastcall RakNet::RakPeer::sendRbxOpenReply2(
        RakNet::RakPeer *this,
        RakNet::RakPeer::RemoteSystemStruct *rss,
        const RakNet::SystemAddress *systemAddress,
        const RakNet::SystemAddress *udmuxAddress,
        std::shared_ptr<RakNet::RakNetSocket> *rakNetSocket)
{
  unsigned int v10; // edx
  bool v11; // al
  RBX::Security::RakPeerCrypto *v12; // r15
  const unsigned __int8 *v13; // rdx
  unsigned __int8 *v14; // rdx
  RakNet::RakPeer_vtbl *v15; // rax
  unsigned __int8 *v16; // rbx
  unsigned __int8 *v17; // rdx
  const unsigned __int8 *v18; // rdx
  const char *v19; // rdi
  const char *v20; // rbx
  bool v21; // al
  const char *v22; // r8
  unsigned __int64 v23; // rbx
  const unsigned __int8 *v24; // rdx
  unsigned __int8 v25; // cl
  const char *v26; // rdx
  unsigned int v27; // r8d
  unsigned __int8 *data; // rdx
  std::shared_ptr<RakNet::RakNetSocket> *v29; // rax
  std::_Ref_count_base *Rep; // rcx
  char v31; // bl
  unsigned __int8 version[4]; // [rsp+60h] [rbp-A0h] BYREF
  unsigned __int16 ciphertextLen[2]; // [rsp+64h] [rbp-9Ch] BYREF
  unsigned __int8 inByteArray; // [rsp+68h] [rbp-98h] BYREF
  unsigned __int8 selectedEncryption; // [rsp+69h] [rbp-97h] BYREF
  unsigned __int8 tokenSize[2]; // [rsp+6Ah] [rbp-96h] BYREF
  unsigned __int16 mtu16[2]; // [rsp+6Ch] [rbp-94h] BYREF
  unsigned __int8 inOutByteArray[4]; // [rsp+70h] [rbp-90h] BYREF
  unsigned __int8 v39[4]; // [rsp+74h] [rbp-8Ch] BYREF
  unsigned __int8 v40[8]; // [rsp+78h] [rbp-88h] BYREF
  unsigned __int8 v41[8]; // [rsp+80h] [rbp-80h] BYREF
  std::shared_ptr<RakNet::RakNetSocket> v42; // [rsp+88h] [rbp-78h] BYREF
  unsigned __int8 v43[8]; // [rsp+98h] [rbp-68h] BYREF
  unsigned __int8 v44[8]; // [rsp+A0h] [rbp-60h] BYREF
  RBX::ArrayView<unsigned char> publicEphemeralKey; // [rsp+A8h] [rbp-58h] BYREF
  unsigned __int8 token[24]; // [rsp+B8h] [rbp-48h] BYREF
  RakNet::BitStream bsOut; // [rsp+D0h] [rbp-30h] BYREF
  RakNet::SystemAddress v48; // [rsp+200h] [rbp+100h] BYREF
  unsigned __int8 aadLen; // [rsp+258h] [rbp+158h] BYREF

  if ( *(&rss->reliabilityLayer.rbxSessionCrypto._Ptr + 4) )
  {
    v10 = 952;
    if ( FFlag::RuppTokEn4.value )
      v10 = 1088;
    RakNet::BitStream::BitStream(&bsOut, v10);
    v11 = FFlag::RuppTokEn4.value && this->getServerReceiveRuppToken(this) && rss->tokenOptions._Has_value;
    version[0] = v11;
    aadLen = 0;
    ciphertextLen[0] = 0;
    v12 = *(&rss->reliabilityLayer.rbxSessionCrypto._Ptr + 4);
    RBX::Security::RakPeerCrypto::getPublicKey(v12, &publicEphemeralKey);
    if ( publicEphemeralKey.buffer && publicEphemeralKey.length )
    {
      selectedEncryption = RBX::Security::SessionCrypto::getRakCryptoFormat(v12);
      inByteArray = 125;
      RakNet::BitStream::WriteBits(&bsOut, &inByteArray, 8u, 1);
      RakNet::BitStream::WriteAlignedBytes(&bsOut, OFFLINE_MESSAGE_DATA_ID, 0x10u);
      RakNet::BitStream::WriteBits(&bsOut, version, 8u, 1);
      RakNet::BitStream::WriteBits(&bsOut, &aadLen, 8u, 1);
      if ( RakNet::BitStream::IsNetworkOrder() )
      {
        v13 = ciphertextLen;
      }
      else
      {
        RBX::Network::NetworkStream::ReverseBytes(ciphertextLen, inOutByteArray, 2u);
        v13 = inOutByteArray;
      }
      RakNet::BitStream::WriteBits(&bsOut, v13, 0x10u, 1);
      aadLen = bsOut.numberOfBitsUsed >> 3;
      RakNet::BitStream::WriteAlignedBytes(&bsOut, publicEphemeralKey.buffer, 0x20u);
      *v41 = rss->remoteCommonCapabilities;
      if ( RakNet::BitStream::IsNetworkOrder() )
      {
        v14 = v41;
      }
      else
      {
        RBX::Network::NetworkStream::ReverseBytes(v41, v43, 8u);
        v14 = v43;
      }
      RakNet::BitStream::WriteBits(&bsOut, v14, 0x40u, 1);
      v15 = this->__vftable;
      v48 = RakNet::UNASSIGNED_SYSTEM_ADDRESS_35;
      v16 = (v15->GetGuidFromSystemAddress)(this, &v48);
      if ( RakNet::BitStream::IsNetworkOrder() )
      {
        v17 = v16;
      }
      else
      {
        RBX::Network::NetworkStream::ReverseBytes(v16, v44, 8u);
        v17 = v44;
      }
      RakNet::BitStream::WriteBits(&bsOut, v17, 0x40u, 1);
      mtu16[0] = rss->MTUSize;
      if ( RakNet::BitStream::IsNetworkOrder() )
      {
        v18 = mtu16;
      }
      else
      {
        RBX::Network::NetworkStream::ReverseBytes(mtu16, v39, 2u);
        v18 = v39;
      }
      RakNet::BitStream::WriteBits(&bsOut, v18, 0x10u, 1);
      RakNet::BitStream::WriteBits(&bsOut, &selectedEncryption, 8u, 1);
      RakNet::BitStream::Write<RakNet::SystemAddress>(&bsOut, &rss->systemAddress);
      if ( FFlag::RuppTokEn4.value && version[0] )
      {
        tokenSize[0] = 16;
        RakNet::BitStream::WriteBits(&bsOut, tokenSize, 8u, 1);
        *token = 0LL;
        this->generateUdmuxToken(this, token, systemAddress, rss->tokenOptions._Value);
        RakNet::BitStream::WriteAlignedBytes(&bsOut, token, 0x10u);
      }
      if ( DFLog::RuppTokenLog )
      {
        v19 = "not replied.";
        if ( version[0] )
          v19 = "replied.";
        v20 = "not received";
        if ( rss->tokenOptions._Has_value )
          v20 = "received";
        v21 = this->getServerReceiveRuppToken(this);
        v22 = "not expected";
        if ( v21 )
          v22 = "expected";
        FLog::FastLogFormatted(
          DFLog::RuppTokenLog,
          "[DFLog::RuppTokenLog] Token %s.  RbxOpenRequest2 token %s.  RbxOpenReply2 token %s",
          v22,
          v20,
          v19);
      }
      ciphertextLen[0] = (bsOut.numberOfBitsUsed >> 3) - aadLen;
      RakNet::BitStream::WriteAlignedBytes(&bsOut, kZeroPacket, 0x1Cu);
      v23 = bsOut.numberOfBitsUsed >> 3;
      RakNet::BitStream::SetWriteOffset(&bsOut, 0x90u, 0);
      RakNet::BitStream::WriteBits(&bsOut, &aadLen, 8u, 1);
      if ( RakNet::BitStream::IsNetworkOrder() )
      {
        v24 = ciphertextLen;
      }
      else
      {
        RBX::Network::NetworkStream::ReverseBytes(ciphertextLen, v40, 2u);
        v24 = v40;
      }
      RakNet::BitStream::WriteBits(&bsOut, v24, 0x10u, 1);
      RakNet::BitStream::SetWriteOffset(&bsOut, 8 * v23, 0);
      if ( RBX::Security::RakPeerCrypto::earlyEncryptData(v12, &bsOut, aadLen, 0) )
      {
        v27 = (bsOut.numberOfBitsUsed + 7) >> 3;
        data = bsOut.data;
        v42 = 0LL;
        v29 = rakNetSocket;
        Rep = rakNetSocket->_Rep;
        if ( Rep )
        {
          _InterlockedIncrement(&Rep->_Uses);
          Rep = v29->_Rep;
        }
        v42._Ptr = v29->_Ptr;
        v42._Rep = Rep;
        if ( !RakNet::SocketLayer::SendToOrDelay(
                &v42,
                data,
                v27,
                systemAddress,
                udmuxAddress,
                0,
                this,
                0LL,
                0LL,
                "C:\\buildAgent\\work\\ci_nbs_stu-x64\\Client\\Network\\raknet\\Source\\RakPeer.cpp",
                6771) )
          RakNet::RakPeer::ConnectionRequestsStats::Increment(&this->connectionRequestsStats, OpenRep2Sent);
        v31 = 1;
        goto LABEL_52;
      }
      v25 = DFLog::SessionCrypto;
      if ( DFLog::SessionCrypto )
      {
        v26 = "[DFLog::SessionCrypto] RbxOpenReply2 encrypt failed";
LABEL_50:
        FLog::FastLog(v25, v26, 0LL);
      }
    }
    else
    {
      v25 = DFLog::SessionCrypto;
      if ( DFLog::SessionCrypto )
      {
        v26 = "[DFLog::SessionCrypto] RbxOpenReply2 no public key";
        goto LABEL_50;
      }
    }
    v31 = 0;
LABEL_52:
    RakNet::BitStream::~BitStream(&bsOut);
    return v31;
  }
  if ( DFLog::SessionCrypto )
    FLog::FastLog(DFLog::SessionCrypto, "[DFLog::SessionCrypto] RbxOpenReply2 no session crypto", 0LL);
  return 0;
}

Reverse engineer this C++ psuedocode.