def METHOD_NAME(params_paths: List[str], parse_args) -> List[str]:
    # First two lines are "swift_worker" and "swiftc"
    skip_next = 2
    processed_opts = []
    next_previous_opt = None
    for params_path in params_paths:
        opts_iter = parse_args(params_path)
        next_opt = None
        while True:
            if next_opt:
                opt = next_opt
                next_opt = None
            else:
                opt = next(opts_iter, None)
                if opt == None:
                    break
                # Remove trailing newline
                opt = opt[:-1]
            previous_opt = next_previous_opt
            next_previous_opt = opt
            if skip_next:
                skip_next -= 1
                continue
            # Change "compile.params" from `shell` to `multiline` format
            # https://bazel.build/versions/6.1.0/rules/lib/Args#set_param_file_format.format
            if opt.startswith("'") and opt.endswith("'"):
                opt = opt[1:-1]
            root_opt = opt.split("=")[0]
            compound_skip_next = _SWIFTC_SKIP_COMPOUND_OPTS.get(root_opt)
            if compound_skip_next:
                next_opt = next(opts_iter, None)
                if next_opt:
                    # Remove trailing newline
                    next_opt = next_opt[:-1]
                    skip_next = compound_skip_next.get(next_opt, 0)
                    if skip_next:
                        # No need to decrement 1, since we need to skip the
                        # first opt
                        continue
            skip_next = _SWIFTC_SKIP_OPTS.get(root_opt, 0)
            if skip_next:
                skip_next -= 1
                continue
            is_frontend_opt = previous_opt == "-Xfrontend"
            if is_frontend_opt and opt.startswith("-vfsoverlay"):
                # Handled in opts.bzl
                continue
            processed_opt = _inner_process_swiftcopts(
                opt = opt,
                previous_opt = previous_opt,
            )
            if processed_opt and is_frontend_opt:
                # We filter out `-Xfrontend`, then add it back only if the
                # current opt wasn't filtered out
                processed_opts.append(previous_opt)
            opt = processed_opt
            if not opt:
                continue
            # Use Xcode set `DEVELOPER_DIR`
            opt = opt.replace(
                "__BAZEL_XCODE_DEVELOPER_DIR__",
                "$(DEVELOPER_DIR)",
            )
            # Use Xcode set `SDKROOT`
            opt = opt.replace("__BAZEL_XCODE_SDKROOT__", "$(SDKROOT)")
            # Quote the option if it contains spaces or build setting variables
            if " " in opt or ("$(" in opt and ")" in opt):
                opt = f"'{opt}'"
            processed_opts.append(opt)
    return processed_opts