getAwaitArgGuardPayload = awaitArgGuard => {
  if (matches(awaitArgGuard, LegacyAwaitArgGuardShape)) {
    // @ts-expect-error Legacy adaptor can be ill typed
    const { klass: _, ...payload } = awaitArgGuard;
    // @ts-expect-error Legacy adaptor can be ill typed
    return payload;
  }
  assertAwaitArgGuard(awaitArgGuard);
  return awaitArgGuard.payload;
}
By using this abstraction rather than accessing the properties directly,
we smooth the transition to https://github.com/endojs/endo/pull/1712,
tolerating both the legacy and current guard shapes.

Note that technically, tolerating the old LegacyAwaitArgGuardShape
is an exploitable bug, in that a record that matches this
shape is also a valid parameter pattern that should allow
an argument that matches that pattern, i.e., a copyRecord argument that
at least contains a `klass: 'awaitArgGuard'` property.

@param {AwaitArgGuard} awaitArgGuard
@returns {AwaitArgGuardPayload}