function [buildInfoPathsOriginalAbs, buildInfoPathsOriginalRelative] = ...
        getOriginalPathsFromInstrumented(lBuildInfo, lInstrPartOfPath, lBuildInfoPathsTokenized)
% Get original BuildInfo paths from instrumented paths

%   Copyright 2019 The MathWorks, Inc.
    
    
    buildInfoPaths = strrep(lBuildInfoPathsTokenized, '$(START_DIR)', lBuildInfo.Settings.LocalAnchorDir);

    % Remove the instrumented part of the path to obtain original paths 
    % (i.e. location of original buildInfo)
    buildInfoPathsOriginalAbs = regexprep(buildInfoPaths, ...
        ['(\\|\/)' regexptranslate('escape', lInstrPartOfPath) '$'], '', 'once');
    
    % Additionally obtain path relative to the anchor folder
    buildInfoPathsOriginalRelative = ...
        regexprep(buildInfoPathsOriginalAbs, ...
        [regexptranslate('escape', lBuildInfo.Settings.LocalAnchorDir) '.|$'], '');
end
