public RemapInfo doRemap(int index) {
    int remappedIndex;

    if (index < params.getArgsSizeOnStack()) {
      ParameterInfo info = params.getParameterByDeclarationSlot(index);
      StackValue remapped = remapValues[index];
      if (info.isSkipped || remapped == null) {
        return new RemapInfo(info);
      }
      if (info.isRemapped()) {
        return new RemapInfo(remapped, info, REMAPPED);
      } else {
        remappedIndex = ((StackValue.Local) remapped).index;
      }
    } else {
      remappedIndex =
          actualParamsSize
              - params.getArgsSizeOnStack()
              + index; // captured params not used directly in this inlined method, they used in
                       // closure
    }

    return new RemapInfo(
        StackValue.local(remappedIndex + additionalShift, AsmTypes.OBJECT_TYPE), null, SHIFT);
  }