function extractClosureDependencies(
    codeRequire, closureRequire, closureProvide) {
  var closureDeps = codeRequire.getAllDependencies().filter(function(element) {
    return element.slice(0, 4) == 'goog';
  });

  var map = new Map();
  closureDeps.forEach(function(ns) {
    map.set(ns, closureProvide.get(ns));
  });

  var oldCount;
  do {
    oldCount = map.size;
    map.forEach(function(value, key) {
      var requires = closureRequire.get(value);
      requires.forEach(function(ns) {
        map.set(ns, closureProvide.get(ns));
      });
    });
  } while (map.size != oldCount);

  var closureFiles = new Set();
  map.forEach(function(value, key) {
    closureFiles.add(value);
  });
  return closureFiles;
}
@param {!RequireMap_} codeRequire
@param {!RequireMap_} closureRequire
@param {!ProvideMap_} closureProvide
@return {!Set<string>} Associated Closure files