public static Surrogate argumentTargetType(List parametertypes, int ninputtypes, int argindex) {
    { StandardObject targettype = ((StandardObject)(parametertypes.nth(Stella.integer_min(argindex, ninputtypes - 1))));

      if (StandardObject.typeSpecToBaseType(targettype) == Logic.SGT_STELLA_CONS) {
        if (Surrogate.subtypeOfParametricTypeSpecifierP(Stella_Object.safePrimaryType(targettype))) {
          { ParametricTypeSpecifier targettype000 = ((ParametricTypeSpecifier)(targettype));

            return (StandardObject.typeSpecToBaseType(((StandardObject)(targettype000.specifierParameterTypes.first()))));
          }
        }
        else {
          return (Logic.SGT_STELLA_OBJECT);
        }
      }
      else {
        return (((Surrogate)(targettype)));
      }
    }
  }