writeStructToLazyStructWriter = (lazyWriter, struct, offset) => {
  // flush curr if we start another client
  if (lazyWriter.written > 0 && lazyWriter.currClient !== struct.id.client) {
    flushLazyStructWriter(lazyWriter);
  }

  if (lazyWriter.written === 0) {
    lazyWriter.currClient = struct.id.client; // write next client

    lazyWriter.encoder.writeClient(struct.id.client); // write startClock

    encoding.writeVarUint(lazyWriter.encoder.restEncoder, struct.id.clock + offset);
  }

  struct.write(lazyWriter.encoder, offset);
  lazyWriter.written++;
}
@param {LazyStructWriter} lazyWriter
@param {Item | GC} struct
@param {number} offset